I am using jorgebg/yii-eoauth library. I use the library with Yii EAuth extension. By requirements yii eauth
Requirements
Yii 1.1 or above
PHP curl extension
loid extension
EOAuth extension
Well, I come across with this problem. I checked it in local with linkedin account (no social accounts work on local server, except linkedin ) and it works perfectly. But login system doesn't work on server. Can you help me in this case ? Thanks in advance !
I didn't write my code here, because I thought, the problem doesn't depend on my code. If it is not, I can put here necessary code.
EDIT:
Error was :
Argument 1 passed to EOAuthUtils::GetAccessToken() must be an instance of
OAuthConsumer, instance of __PHP_Incomplete_Class given, called in
protected/extensions/eoauth/EOAuthUserIdentity.php on line 138 and defined
In line 138 of EOAuthUserIdentity.php was written:
// Upgrade to access token.
$token = EOAuthUtils::GetAccessToken($consumer, $token, $oauthVerifier,
$this->provider->access_token_endpoint);
I put logger pre($consumer,1); before above code. and I had in local:
OAuthConsumer Object
(
[key] => 7........k
[secret] => s........r
[callback_url] =>
)
I had on server:
__PHP_Incomplete_Class Object
(
[__PHP_Incomplete_Class_Name] => OAuthConsumer
[key] => 7.........k
[secret] => s........r
[callback_url] =>
)
the same php version on local and server
You need load class before unserialize object. If u don't do this, object unserialize to __PHP_Incomplete_Class.
see PHP problem with "__php_incomplete_class"
Related
I've never used SOAP before, and I'm getting this when I print out an array. Could someone tell me whether it's working, or not? I'm not sure what the Resource id stands for and I couldn't find an answer..
$this->client = new SoapClient("https://api.cvent.com/soap/V200611.ASMX?WSDL", array('trace' => true, 'exceptions' => true));
echo '<pre>';print_r($this->client);echo '</pre>';
SoapClient Object
(
[trace] => 1
[_soap_version] => 1
[sdl] => Resource id #251
)
If anyone could help me out, that'd be great.
I'm glad you solved your issue.
I went ahead anyway to figure out what sdl is and how to use it.
I checked the SOAP extension source code and it looks like the resource represents the parsed and interpreted WSDL which is used internally for near enough all the SoapClient methods to lookup and return definitions data.
#L379 le_sdl = zend_register_list_destructors_ex(delete_sdl_res, NULL, "SOAP SDL", module_number);
le_sdl is of type sdlPtr (service definition language pointer? ) and is referenced throughout.
https://github.com/php/php-src/blob/7bbc85f16ac7b54b3cdbadc787518aed33369b7e/ext/soap/soap.c
I have no idea why we can view this resource as a public property SOAP_GLOBAL(sdl) as it doesn't look like it can be read by any PHP function.
Its not in the list of defined resource types and the Soap documentation clearly says that the extension doesn't have any defined.
This extension has no resource types defined.
I'm using the PHP library of the BigCommerce API. I am seeming to have trouble and keep getting error messages. I am not sure if this is an authorization issue or if I'm missing something.
I'm using XAMPP and install composer along with the BigCommerce PHP package I need. I followed this guide: https://github.com/bigcommerce/bigcommerce-api-php
So here's what my code looks like (credentials X'd out):
<?php
require "vendor/autoload.php";
use Bigcommerce\Api\Client as Bigcommerce;
Bigcommerce::configure(array(
'store_url' => 'http://store-XXXXXXXX.mybigcommerce.com',
'username' => 'admin',
'api_key' => 'xxxxxxxxxxxxxxxxxxxxxxxxx'
));
$ping = Bigcommerce::getTime();
if (!$ping ) {
$error = Bigcommerce::getLastError();
print_r($error);
}
?>
This returns: Array ( [0] => stdClass Object ( [status] => 400 [message] => The connection is not secure. API requests must be made via HTTPS. ) )
I was wondering if it had to do with the "store_url" I used in the configuring. So I changed it to the front-end URL (real name of my store), and upon doing so I get this message instead:
Fatal error: Uncaught exception 'Bigcommerce\Api\NetworkError' with message 'SSL certificate problem: self signed certificate in certificate chain' in C:\xampp\htdocs\test\PSC_BigC\bigcommerce-api-php-master\src\vendor\bigcommerce\api\src\Bigcommerce\Api\Connection.php:274 Stack trace: #0 C:\xampp\htdocs\test\PSC_BigC\bigcommerce-api-php-master\src\vendor\bigcommerce\api\src\Bigcommerce\Api\Connection.php(368): Bigcommerce\Api\Connection->handleResponse() #1 C:\xampp\htdocs\test\PSC_BigC\bigcommerce-api-php-master\src\vendor\bigcommerce\api\src\Bigcommerce\Api\Client.php(423): Bigcommerce\Api\Connection->get('https://psc-dev...') #2 C:\xampp\htdocs\test\PSC_BigC\bigcommerce-api-php-master\src\test.php(19): Bigcommerce\Api\Client::getTime() #3 {main} thrown in C:\xampp\htdocs\test\PSC_BigC\bigcommerce-api-php-master\src\vendor\bigcommerce\api\src\Bigcommerce\Api\Connection.php on line 274
Its because youre using a self signed certificate.
you need to configure Bigcommerce to ignore the warning.
Bigcommerce::verifyPeer(false);
this effectively turns checking off in the cURL client it seems to be using.
The error states : "API requests must be made via HTTPS."
Change your store URL to "https://store-XXXXXXXX.mybigcommerce.com" as it is secure.
Example from the docs (store URL needs to be HTTPS).
https://github.com/bigcommerce/bigcommerce-api-php
Bigcommerce::configure(array(
'store_url' => 'https://store.mybigcommerce.com',
'username' => 'admin',
'api_key' => 'd81aada4xc34xx3e18f0xxxx7f36ca'
));
I'm currently writing an app in PHP that connects to a MongoDB database.
I've managed to successfully authenticate a user with the dbAdmin role in the MongoDB Database that I've setup, and I've created a user "TestUser" with no roles that I want to get information about while authenticated as the dbAdmin User. however I can't figure out how to run the "db.getUser()" command from PHP.
My understanding is that I should be able to use the "MongoDB::command()" method to run any actual mongoDB commands directly, however, the following code...
$mongo = new MongoClient("localhost:27017");
$mongoDb = $mongo->{'test'}
$mongoDb->authenticate($username, $password); //This returns a successful response of array('ok' => 1)
print_r($mongoDb->command(array("getUser" => "TestUser")));
Generates this response: -
(
[ok] => 0
[errmsg] => no such command: getUser
[code] => 59
[bad cmd] => stdClass Object
(
[getUser] => TestUser
)
)
The "getUser" is a command of a Database in MongoDB though, right? If so, why am I getting this response, and how do I construct a correct statement to be able to get information about a User from MongoDB in PHP?
I looked into this more, by fetching a list of all possible methods available to the database by using...
$mongoDb->command(array("listCommands" => 1));
This informed me that "getUser" apparently is not an existing command. I'm not sure why not, I guess it's because it's a User Management command and not a typical Database Command.
At any rate, "usersInfo" is a command that is available. By doing the following...
$mongoDb->command(array("usersInfo" => array("user" => $username, "db" => $database)));
I was able to get the data about the user that I wanted, so I guess that answers my question. Hopefully this helps anyone else whose encountering the same problem trying to setup their PHP app with MongoDb.
I am new to zend framework and I am working on REST web service API. While my model output is protected object variables Zend_Rest_Server(). It is unable to handle that and throw an error.
Array
(
[0] => Webservices_Models_Token Object
(
[_id:protected] => 1
[_token_key:protected] => 123
[_mapper:protected] =>
)
)
While why model is returning above result, I am getting error. I got this result from zend model mapper.
Oh Dear!
You seem to have arrived here by error, or the page you are seeking
has been removed and can no longer be displayed.
Perhaps you are looking for a page that has been moved during the
recent improvements to our website. An error occurred ** This needs to
be altered before go live Exception information:
Message: Invalid Character Error
Bellow output works fine and generating xml from $this->_server = new Zend_Rest_Server()
Array
(
[0] => stdClass Object
(
[id] => 1
[token_key] => 123
)
)
Can anyone tell me whats the problem?
How can I solve it?
This is did the trick for me. toArray()
$select = $this->getDbTable()->select()->where($where);
return $this->getDbTable()->fetchAll($select)->toArray();
Thanks.
Is there a way to get the output of "rs.status();" from the php driver?
Passing the following setting to the Command function of the MongoDB Driver
array('replSetGetStatus'=>1)
Results in an error message:
Array
(
[0] => access denied; use admin db
[1] => 0
)
You can reuse the same connection; you just have to get the admin db from the object:
$connection->admin->command(array("replSetGetStatus"=>1)
If you haven't already, you'll need to create a database connection object to the 'admin' db so that you can then call the output of rs.status() through the driver as you specified.
mongodb://[username:password#]host1[:port1][,host2[:port2:],...]/db
See the docs here