473,408 Members | 2,161 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How to include simple-rest library in WordPress

56
Dear pals,
I need to implement the REST service which explain in Simple-rest.
I create a file with name xyz.php with code

Expand|Select|Wrap|Line Numbers
  1.     <?php
  2.     if(isset($_POST['type']) && (isset($_POST['id']))) {
  3.         $type = $_POST['type']?$_POST['type']:"undefined";
  4.         $id = $_POST['id']?$_POST['id']:"undefined";
  5.  
  6.         //echo "val is :".$type." id is ".$id;
  7.     } else {
  8.     $type = "table";
  9.     $id = 2;
  10.     }
  11.     ?>
  12.     <?php require_once("wp-load.php");?>
  13.     <?php //get_header();
  14.      wp_head();
  15.     ?>
  16.  
  17.     <?php
  18.     if($type=="chart" && $id!="undefined") {
  19.         $kk_chart = get_html_4_chart(intval($id));
  20.         echo $kk_chart;
  21.     }
  22.     if($type=="table" && $id!="undefined") {
  23.         $kk_table = get_html_4_table(intval($id));
  24.         echo $kk_table;
  25.     }
  26.         wp_footer();
  27.     ?>
in root folder work fine . But i need to make it in a controller method. So I create a folder named "services" in root of WP and create a controller with name "chart" and write code as

Expand|Select|Wrap|Line Numbers
  1.     include_once("../wp-load.php");
  2.     wp_head();
  3.     wp_footer(); 
  4.  
  5.     class Controllers_Chart extends RestController {
  6.         public function get() {
  7.             //$this->response = array('TestResponse' => 'I am GET response. Variables sent are - ' . http_build_query($this->request['params']));
  8.             //$this->responseStatus = 200;
  9.             $kk_chart = get_html_4_chart(2);
  10.             return $kk_chart;
  11.  
  12.         }
  13.     }
I just include the relevant get() method only . But I got some unexpected error like
Warning: include(Translation/Entry.php): failed to open stream: No such file or directory in C:\wamp\www\wp-oscar\services\index.php on line 22
Warning: include(): Failed opening 'Translation/Entry.php' for inclusion (include_path='C:\wamp\www\wp-oscar\services;.;C:\php\pear') in C:\wamp\www\wp-oscar\services\index.php on line 22

alot of warning like this and a Fatal error as
Fatal error: Call to a member function set_filenames() on a non-object in C:\wamp\www\wp-oscar\wp-content\plugins\wp-business-intelligence-lite\functions\functions.php on line 174

please advise me a method to call WordPress Business Intelligence intelligence as a REST service .

Waiting your reply

Thanks,
Anes
Sep 29 '13 #1
0 1448

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Davide Bedin | last post by:
I have a "library" schema with the simple and complex types I commonly use in other schemas and then several other schemas, maybe created by other developers, that import/include the library...
4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
6
by: Gideon de Swardt | last post by:
I am trying to do a server side transformation using an xsl:include in my xslt stylesheet. The include stylesheet is stored /Library/abo.Library.xslt and is included in multiple xslts, one example...
3
by: DrOrbit | last post by:
I'm trying to configure Visual Studio 2005 (C#) to produce a MEX DLL that will interface with MatLab. I found an online source that describes some files that I need to attach to the DLL. The...
6
by: msosno01 | last post by:
log4cxx is an excellent library for logging with a huge amount features: http://logging.apache.org/log4cxx/manual/Introduction.html My friend persuaded me to install it. However, I have a problem...
2
by: Verbal Kint | last post by:
Hello. I am having a problem here, which is difficult to solve for me. I would like to include a library from the net into my program. As IDE I am using Microsoft Visual C++ 8 Professional. The...
1
by: DBuss | last post by:
I'm using C++ in a Linix environment to read from TCP and UDP sockets. I now need to start using multi-threading and we're using pthreads (i.e. pthread.h). When I started including the pthread...
3
by: djbaker | last post by:
Greetings, I am trying to create a class library/dll with C++ and I am running into a lot of trouble. I know that this is a C++ forum and not one specific to windows or VS 2005 but I'm hoping...
1
by: kundasang | last post by:
Hi. I just downloaded boost library from boost.org then build and I don't know what does binary precompiled means. Well, I have installed it and I using bloodshed Dev-Cpp compiler. <bThen,...
12
by: Pablo Suarez | last post by:
When I code #include "myheader.h" then this header file is searched in the current directory. But where does the compiler search the header file when I write #include <myheader.h>
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.