Download the PHP package myena/cloudstack-client-generator without Composer
On this page you can find all versions of the php package myena/cloudstack-client-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download myena/cloudstack-client-generator
More information about myena/cloudstack-client-generator
Files in myena/cloudstack-client-generator
Package cloudstack-client-generator
Short Description PHP client library for the CloudStack User API
License MIT
Informations about the package cloudstack-client-generator
CloudStack PHP Client
PHP client library for the CloudStack API v4.8+ (reference)
This project was originally forked from the following projects:
This project combines these two tools into one project. The code generation is no longer done via scraping of the HTML documentation. We now use the provided call in the CloudStack API to generate the libraries.
The code generated is tagged for phpdoc.
Installation
Simply download the latest php-cloudstack-generator.phar
from the releases page and put it where you'd like. Where to
place the phar will depend heavily on your implementation.
Code Generation
1. Define a configuration file:
Please see files/config_prototype.yml for an example configuration file
2. Generate client
The output of this generator has this basic structure:
3. Include in Project
How you include the generated code depends on how you chose to generate the code, either as a Composer library or as standalone classes.
If you generated the client as a composer package that has been pushed somewhere Composer can reach, simply add to your project's composer.json file
If you just generated code, it is recommended you put the code somewhere in the containing projects include or autoload path(s).
PHP Library Usage
Initialization
Lists
Asynchronous tasks
You may also optionally wait for a job to finish:
Advanced Topics
API Caching
The code generated by this library has the ability to take advantage of any cache library implementing the Doctrine Cache interface
Any / all "read" requests (get, list, etc.) are allowed to have their responses cached.
The workflow looks like this:
Response Object Overloading
During code generation, it is possible to specify a custom class that extends a response class that is generated by this library.
For example, the tags
concept can be used to store all kinds of implementation-specific business logic with
virtual machines, template, isos, zones (in the form of resourcedetails
), the list goes on. It can be quite tedious
to have to extract values from the tag array every time they need to be reference, so one of the ways in which we
utilize class overloading is to define our own ListVirtualMachinesResponse
class with some helper methods to parse and
extract specific tags from the tags
array.
The only real requirement is that the overloading class MUST retain the same __construct
args as the class it is
overloading. And, of course, it must be loadable by your application.
The generator DOES NOT do any kind of validation on the provided overload list! If you specify a class that does not exist, then that query will not work.
All versions of cloudstack-client-generator with dependencies
symfony/console Version @stable
symfony/yaml Version @stable
twig/twig Version @stable
twig/extensions Version @stable
psr/log Version @stable
guzzlehttp/psr7 Version @stable
guzzlehttp/guzzle Version @stable