@@ -12,31 +12,22 @@ This project combines these two tools into one project. The code generation is
1212
1313The code generated is tagged for [ phpdoc] ( https://github.com/phpDocumentor/phpDocumentor2 ) .
1414
15+ ## Installation
16+
17+ Simply download the latest ` php-cs.phar ` from the releases page and put it where you'd like. We recommend adding it to
18+ your path in whatever fashion you prefer.
19+
1520## Code Generation
1621
17- A quick example :
22+ ### Define a configuration file :
1823
19- ``` php
20- $generator = new \MyENA\CloudStackClientGenerator\Generator(new \MyENA\CloudStackClientGenerator\Configuration(
21- [
22- 'api_key' => '', // YOUR_API_KEY (required)
23- 'secret_key' => '', // YOUR_SECRET_KEY (required)
24- 'host' => 'localhost', // Your CloudStack host (required)
25- 'scheme' => 'http', // http or https (defaults to http)
26- 'port' => 8080, // api port (defaults to 8080)
27- 'path_prefix' => 'client', // url prefix (defaults to 'client')
28- 'api_path' => 'api', // admin api path (defaults to 'api')
29- 'console_path' => 'console', // console api path (defaults to 'console')
30- 'output_dir' => '', // Where you'd like the generated files to go (defaults to ./output)
31- 'namespace' => '', // The namespace that will be used in the generated files (optional)
32- 'http_client' => null, // GuzzleHttp\ClientInterface compatible client
33- ]
34- ));
24+ Please see [ files/config_prototype.yml] ( ./files/config_prototype.yml ) for an example configuration file
3525
36- $generator->generate();
37- ```
26+ ### Execute build
3827
39- If you do not specify anything for ` output_dir ` , all generated files will be placed under [ output] ( ./output )
28+ ``` php
29+ php-cs phpcs:build --config your_config_file.yml
30+ ```
4031
4132There are 3 directories of files created by this generated process, however you will only directly interact with 3:
4233
@@ -56,9 +47,8 @@ PHP Library Usage
5647 'host' => 'localhost', // Your CloudStack host (required)
5748 'scheme' => 'http', // http or https (defaults to http)
5849 'port' => 8080, // api port (defaults to 8080)
59- 'path_prefix' => 'client', // url prefix (defaults to 'client')
60- 'api_path' => 'api', // admin api path (defaults to 'api')
61- 'console_path' => 'console', // console api path (defaults to 'console')
50+ 'api_path' => 'client/api', // admin api path (defaults to 'client/api')
51+ 'console_path' => 'client/console', // console api path (defaults to 'client/console')
6252 'http_client' => null, // GuzzleHttp\ClientInterface compatible client
6353 ]);
6454
0 commit comments