简体   繁体   中英

Zend framework 3 and rackspace authenticate() is not working

This code was working fine with zf2 but when i migrated to ZF3 it is giving me the following error

$user = 'username';
$key  = 'secret key';

$rackspace = new ZendService\Rackspace\Files($user,$key);

if ($rackspace->authenticate()) {
    printf("Authenticated with token: %s",$rackspace->getToken());
} else {
    printf("ERROR: %s",$rackspace->getErrorMsg());
}

File : zendframework\\zendservice-rackspace\\library\\ZendService\\Rackspace\\AbstractRackspace.php:365

Message: Call to a member function getFieldValue() on boolean

The error is from the Rackspace library, I haven't use getFieldValue() anywhere

IN the Library itself there is a line that was causing the error

The line 401 in AbstractRackspace.php

$this->managementUrl = $result->getHeaders()->get(self::MANAGEMENT_URL)->getFieldValue();

the error was due to this line as the MANAGEMENT_URL is not set there in the header. i commented that line in the file and the error is gone

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM