I am trying to athenticate from the elgg local server.
by refering
http://www.danielansari.com/wordpress/2008/12/how-to-use-the-rest-api-in-elgg-11/
I am getting following error:
Status: **** ERROR (-1) ****
Message: Method call 'login' has not been implemented.
Result: exception 'APIException' with message 'Method call 'login' has not been implemented.' in C:\xampp\htdocs\elgg1.6.1\engine\lib\api.php:562
Stack trace:
#0 C:\xampp\htdocs\elgg1.6.1\services\api\rest.php(46): execute_method()
#1 C:\xampp\htdocs\elgg1.6.1\engine\lib\api.php(1219): include('C:\xampp\htdocs...')
#2 C:\xampp\htdocs\elgg1.6.1\engine\lib\pagehandler.php(42): api_endpoint_handler('login', Array, '')
#3 C:\xampp\htdocs\elgg1.6.1\engine\handlers\pagehandler.php(23): page_handler(Array, 'api')
#4 {main}
Basically my aim is to upload an image in a community made by using ELGG. But In this place only I am stuck.
How to solve it?
Well, I can't help you with that exception, but I can tell you that there is no way directly in Elgg's REST API to upload an image. I tried doing this and had to replicate the logic of the upload.php action in my own huge honking function.
Related
I'm using codeception and I'm trying to run the migration for the test database.
From inside the tests folder I run the command
php codeception/bin/yii migrate/up --interactive=0
but I'm getting the error
Exception 'yii\base\InvalidConfigException' with message 'The configuration for the "user" component must contain a "class" element.'
in /www/shopboxyii-v2/vendor/yiisoft/yii2/di/ServiceLocator.php:205
Stack trace:
#0 /www/shopboxyii-v2/vendor/yiisoft/yii2/di/ServiceLocator.php(261): yii\di\ServiceLocator->set('user', Array)
#1 /www/shopboxyii-v2/vendor/yiisoft/yii2/base/Component.php(180): yii\di\ServiceLocator->setComponents(Array)
#2 /www/shopboxyii-v2/vendor/yiisoft/yii2/BaseYii.php(546): yii\base\Component->__set('components', Array)
#3 /www/shopboxyii-v2/vendor/yiisoft/yii2/base/BaseObject.php(107): yii\BaseYii::configure(Object(yii\console\Application), Array)
#4 /www/shopboxyii-v2/vendor/yiisoft/yii2/base/Application.php(206): yii\base\BaseObject->__construct(Array)
#5 /www/shopboxyii-v2/vendor/yiisoft/yii2/console/Application.php(89): yii\base\Application->__construct(Array)
#6 /www/shopboxyii-v2/tests/codeception/bin/yii(25): yii\console\Application->__construct(Array)
#7 {main}
Does anyone know anything about this error or what's causing it??
You don't need the user component configuration in the console/config/main.php (if using advanced-app) or app/config/web.php (if using basic-app), you should just remove the component configurations and it will start working seamlessly.
I have an API in WSO2. When I try to test it in the store with valid parameters via GET, it returns the following error message:
<am:fault xmlns:am="http://wso2.org/apimanager">
<am:code>101504</am:code>
<am:type>Status report</am:type>
<am:message>Runtime Error</am:message>
<am:description>Send timeout</am:description>
</am:fault>
I have already searched and tried a lot, but with no success, always returning the same error. Don't know if helps, but the api that I try to access is a PHP file.
Any ideas?
EDIT:
I have identical apis to this one, changing only the response, that are working properly. Even if I erase the php file that the API is pointing, the error keep coming.
EDIT:
I changed the code in Management Console, in Metadata>List>APIs:
{"production_endpoints":
{"url":"http://site/myapi.php","config":
{"format":"leave-as-is","optimize":"leave-as-
is","actionSelect":"fault","actionDuration":30000}},
"sandbox_endpoints":
{"url":"http://site/myapi.php","config":
{"format":"leave-as-is","optimize":"leave-as-
is","actionSelect":"fault","actionDuration":30000}},
"implementation_status":"managed","endpoint_type":"http"}
to this:
{"production_endpoints":
{"url":"http://10.20.40.189/ConsultaAutorizacaoCadPos.php","config":null},
"sandbox_endpoints":{"url":"http://10.20.40.189/ConsultaAutorizacaoCadPos.php","config":null},
"implementation_status":"managed","endpoint_type":"http"}
And this error message vanishes. But this new one appears:
<am:fault xmlns:am="http://wso2.org/apimanager">
<am:code>303001</am:code>
<am:type>Status report</am:type>
<am:message>Runtime Error</am:message>
<am:description>Currently , Address endpoint : [ Name : admin--myapi_APIproductionEndpoint_0 ] [ State : SUSPENDED ]</am:description>
EDIT: this error message is appearing just sometimes. Most of the time the request takes long time to run and then returns nothing( no content )
Any ideas how to solve it?
I am using dirkgroenen pinterest api, so it was perfectly fine for 1 month but now when changing code to an access token I am getting this error
Notice: Array to string conversion in /home/socialwe/public_html/SWT/SMs/pinterestApi/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Transport/Request.php on line 227
Fatal error: Uncaught exception 'DirkGroenen\Pinterest\Exceptions\PinterestException' with message 'Pinterest error (code: 403) with message: Forbidden' in /home/socialwe/public_html/SWT/SMs/pinterestApi/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Transport/Request.php:227 Stack trace: #0 /home/socialwe/public_html/SWT/SMs/pinterestApi/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Transport/Request.php(98): DirkGroenen\Pinterest\Transport\Request->execute('POST', 'https://api.pin...', Array) #1 /home/socialwe/public_html/SWT/SMs/pinterestApi/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Auth/PinterestOAuth.php(143): DirkGroenen\Pinterest\Transport\Request->post('oauth/token', Array) #2 /home/socialwe/public_html/SWT/SMs/pinterestApi/index.php(18): DirkGroenen\Pinterest\Auth\PinterestOAuth->getOAuthToken('dfb587ef87beaaa...') #3 {main} thrown in /home/socialwe/public_html/SWT/SMs/pinterestApi/vendor/dirkgroenen/pinterest-api-php/src/Pinterest/Transport/Request.php on line 227
Its because my server IP have blocked by pinterest.
Now I have checked it on another server and its working fine there
I'm currently receiving the following error message with Zend Framework and Doctrine. I'm trying to figure out how to solve this issue..
Fatal error: Uncaught exception 'LogicException' with message 'Passed array does not specify an existing static method (class 'Doctrine' does not have a method 'modelsAutoload')' in /home/bellalun/library/Smallunch/lib/Bootstrap.php:173 Stack trace: #0 /home/bellalun/library/Smallunch/lib/Bootstrap.php(173): spl_autoload_register(Array) #1 /etc/ZendFramework/1.9.0/Zend/Application/Bootstrap/BootstrapAbstract.php(660): Bootstrap->_initDoctrine() #2 /etc/ZendFramework/1.9.0/Zend/Application/Bootstrap/BootstrapAbstract.php(613): Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('doctrine') #3 /etc/ZendFramework/1.9.0/Zend/Application/Bootstrap/BootstrapAbstract.php(577): Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap(NULL) #4 /etc/ZendFramework/1.9.0/Zend/Application.php(324): Zend_Application_Bootstrap_BootstrapAbstract->bootstrap() #5 /home/bellalun/application/bootstrap.php(14): Zend_Application->bootstrap() #6 /home/bellalun/public_html/dev.php(8): require('/home/bellalun/...') #7 {main} thrown in /home/bellalun/library/Smallunch/lib/Bootstrap.php on line 173
Here's what's on line 173
$this->getApplication()->getAutoloader()
->pushAutoloader(array('Doctrine', 'autoload'));
spl_autoload_register(array('Doctrine', 'modelsAutoload'));
$manager = Doctrine_Manager::getInstance();
$manager->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true);
My hosting company made some changes over the weekend that messed up a few of my sites, taking them down. They switched me from Apache to LiteSpeed and my PHP handler from DSO to SuPHP. Not sure if this is related or not..
I don't use Doctrine, but the code sample you've posted doesn't make a lot of sense. On the first line you're registering Doctrine's autoload function with the ZF autoloader. This looks good, and seems to match this tutorial. On the next line, you're registering another autoloader with SPL directly (this is bad), and doing so using another, apparently non-existent function (modelsAutoload). Since this is the line that's erroring I'd guess commenting that line out will fix your problem.
I need to convert a dynamic web page to pdf... So as a start, I use this code for practice,
This works fine as long as I use the directory c:/test.php. But everytime I change the directory to something like d:/xampp/htdocs/test.php I get the error message:
Fatal error: Uncaught exception 'PDFlibException' with message 'pdf_begin_document() expects exactly 3 parameters, 2 given' in D:\xampp\htdocs\mypdftest\pdf_file.php:1… Stack trace: #0 D:\xampp\htdocs\mypdftest\pdf_file.php(1… pdf_begin_document(Resource id #2, 'test.pdf') #1 {main} thrown in D:\xampp\htdocs\mypdftest\pdf_file.php on line 18
Please tell me what's going wrong and how to fix it... Any help is appreciated...
Read the documentation on this one. It seems that the function pdf_begin_document() accepts 3 mandatory parameters, which are:
PDF_begin_document($pdfdoc, $filename, $optlist );
where $optlist is an option list (not much documentation here), like this example:
$optlist = "destination={page=1 type=fixed zoom=1 top=100 left=50}";