zend-framework2,composer-php,updates,apigility
Why do you think the latest version of Apigility is 1.1.1? https://packagist.org/packages/zfcampus/zf-apigility shows 1.0.3 (which you already have) as the latest version, as does the Github repository. It's the skeleton application, that's at version 1.1.1....
php,zend-framework2,one-to-many,datamapper,apigility
I have finally found a solution. (Thanks once again @ poisa for his solution suggestion on GitHub.) In short, the idea is to enrich the (projects) list items with nested (image) items lists on the hydration step. I actually don't really like this way, since it's too much model logic...
That's because the ServiceLocator is injected through a mechanism called 'setter injection'. For that to happen, something (e.g., ServiceManager) needs to call a setter for a class, in this case setServiceLocator. When you directly instantiate Auth that's not the case. You need to add your class to the service locator,...
got it in return response in apigility: so change my code in userapiResource.php public function create($data) { $client = new Client(); $client->setUri('http://xxxx/xxxx/public/mob-app/client/update'); // set some parameters $client->setParameterPost(array('userid'=> $data->userid,'price'=>$data->price)); // POST request $client->setMethod('POST'); $respons=$client->send(); $respons->getContent(); $returnArray = []; $final_array = [ 'content' => json_decode($respons->getContent()) ]; $returnArray['data'] =...
I'm guessing based on your question that you've got ApiOne with a route to /user and ApiTwo with a route to /user? The problem is that they are not different routes. ZF2 is going to use (I believe) the one that is defined last in the combined configuration file. If...
zend-framework2,postman,apigility
Click on Headers then add Authorization as Header and Bearer 62f6109dcbce42b38f9117b21529faf30fc0ee86 as Value ...
php,curl,zend-framework2,apigility
$response_body = json_decode($body); curl_close ($ch); return array($response_header, $response_body); http://ca1.php.net/manual/en/function.json-decode.php Return Values Returns the value encoded in json in appropriate PHP type. Values true, false and null are returned as TRUE, FALSE and NULL respectively. NULL is returned if the json cannot be decoded or if the encoded data is...
zend-framework,zend-framework2,apigility
You don't need password protection for ApiGility UI. Access should only be allowed in the Dev environment. php public/index.php development enable <- to enable the UI php public/index.php development disable <- to disable the UI If you consist of having password protection for it. Then you can add an event...
database,rest,zend-framework2,apigility
In order to use multiple DB adapters, one simply need to create an appropriate configuration block in the (global.php for the generall setting like driver and local.php for the credentials) -- it can be done manually or over the Apugility GUI (Dashboard -> Database Adapters) global.php return array( 'db' =>...
oauth,zend-framework2,apigility
What you're likely looking for is the "password" grant type. In this scenario, you will have a way of registering users and their passwords, and then a "login" screen of sorts. This login screen will send the following information: username password client_id -- this will be the OAuth2 client ID...
error-handling,zend-framework2,error-logging,apigility
It handles error rendering if you use ApiProblem objects to encapsulate your errors. It doesn't handle logging out of the box, you'll have to add your application's logging strategy yourself....
zend-framework,zend-framework2,apigility
You need to supply your data as http body (payload) in json format. Make the call to the URI without the query params. https://cloud.mysite.dev:8890/api/updatecart/1 { "prod_id": 1, "quantity": 1, "update_type": 1, "tax": "0.00" } Also make sure you supply the right request headers: Accept: application/json Content-Type: application/json ...
doctrine2,zend-framework2,version,dbconnection,apigility
The following section of your config: [ 'db'=>[ 'adapters' => [ 'DB\\myproject_v1' => [], 'DB\\myproject_v2' => [], ] ] ] configures an abstract factory that registers the service names DB\\myproject_v1 and DB\\myproject_v2 with db adapter instances. It is the part of the configuration below that actually assigns the adapter to...
php,zend-framework2,apigility,hal
What you did in your edit using getHydratorConfig was correct, the error message you're seeing is caused because within your factory method you're attempting to fetch your image service from the hydrator plugin manager. The solution is simple, as with other plugin managers you need to call getServiceLocator() on the...
php,rest,zend-framework2,zend-studio,apigility
The Apigility documentation (REST Service Tutorial -> Create a REST Service -> [infobox] Code-Connected vs DB-Connected services) provides the perfect answer: Code-Connected vs DB-Connected services When you create a Code-Connected service, Apigility creates a stub "Resource" class that defines all the various operations available in a REST service. These operations...
It seems to me that you have two different goals here. 1. Store a header variable from a route event. 2. Get a variable into the constructor function of a class To answer 1. You can make a listener class and attach this class to your eventManager. This would look...
php,zend-framework2,apigility,content-negotiation
You could write a listener in which you check the Accept header of the incoming request. If no Accept header is set you can add an Accept header with a default value; for example application/json. So something like: /** * Set empty accept header by default to `application/json` * *...
the interface/protocol/API between a Resource Server and an Authorization Server is not standardized in OAuth 2.0; work is underway to do that as an extension: https://tools.ietf.org/html/draft-ietf-oauth-introspection-03 this means that there is extremely little chance that you can use Apigility with another Authorization Server unless they happen to implement the same...
What I did to resolve this was to create an autoload file: mydev.local.php and to include the following in it: <?php return [ 'zfc_rbac' => [ 'protection_policy' => \ZfcRbac\Guard\GuardInterface::POLICY_ALLOW ] Problem solved. thanks! ]; This means that any route that is not in my guards is not protected... of course...
How to customize error response in Apigility Apigility works seamlessly together with ZF Api Problem for error handling. Creating an error response from a controller or listener is as simple as: use ZF\ApiProblem\ApiProblem; ... return new ApiProblem(500, "My Internal Server Error"); The status titles for common errors are set here...
The problem is that you're trying to send parameters as form data. Instead you'll want to send it as "raw." Click on the "raw" tab in the Headers section. Then enter your data as a JSON string. {"quantity_accumulation": "1"} ...
1. Yes you can, as long as you use a properly configured (secure) https connection. By using a security certificate you will ensure encryption of the data being sent and received by the client and it will be unreadable when intercepted. 2. When using implicit grant you will still need...
configuration,zend-framework2,apigility
The solution in this case was to run a composer.phar update which resolved the issue.
php,doctrine2,zend-framework2,apigility,zend-tool
You are only showing Db configs. You need a Doctrine config something like this: <?php return array( 'doctrine' => array( 'connection' => array( // default connection name 'orm_default' => array( 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', 'params' => array( 'host' => 'localhost', 'port' => '3306', 'user' => 'username', 'password' => 'password', 'dbname' =>...
doctrine2,doctrine-odm,apigility
The Answer to this is as I have above: I have this working although I am not keen on it as I hit the DB twice. The first time to build the array (Which is the entire result set which could be very big for some applications) and then the...
php,authentication,zend-framework2,basic-authentication,apigility
As of the new version of Apigility (not sure exactly which one, but greater than 1.0) there's the ability to create multiple Auth adapters and associate each API to a different Auth adapter. If you've created an auth adapter (Authentication on the top -> Adapters -> New Adapter) you'll have...
In this case, it would seem the problem is to do with htaccess or apache. The simplest solution has been to encode the url using: base64_encode($url) which can be de-coded at the other end.
In general you POST your new entities on the collection endpoint so in your case /api/verify/merchant. The server will respond with a new resource with a self href for the newly created Merchant. This href will be formatted like /api/verify/merchant[/merchant_code] where merchant_code will be the identifier for the newly added...
php,api,zend-framework2,apigility
If you create a new resource on a Restful API you do a post on the collection route. So you should add your POST method to the collection_http_methods array. This is totally according to Restful specifications. 'collection_http_methods' => array( 0 => 'GET', 1 => 'POST', ), I think if you...
1. Yes, you can use several modules with their own module.config.php files like you would normally do inside a ZF2 application. It is also useful to split into several config files. You can for example create: metadata.config.php, controller.config.php and inputfilter.config.php And then merge the config files in your module.php Module::getConfig...