at the root of their projects. To utilize the library, include
Composer's vendor/autoload.php in the scripts that will use the
Redmine classes.
For example,
<?php// This file is generated by Composerrequire_once'vendor/autoload.php';
$client = new \Redmine\Client\NativeCurlClient('http://redmine.example.com', 'username', 'password');
Manual
It is also possible to install the library oneself, either locally to
a project or globally; say, in /usr/share/php.
Download the library from php-download.com. The advantage of using this site is that no Composer installation is required. This service will resolve all composer dependencies for you and create a zip archive with vendor/autoload.php for you.
Than extract the library somewhere. For example, the following steps extract v1.6.0 of the library into the vendor/php-redmine-api-1.6.0 directory:
Now, in any scripts that will use the Redmine classes, include the vendor/autoload.php file from the php-redmine-api directory. For
example,
<?php// This file ships with php-redmine-apirequire'vendor/php-redmine-api-1.6.0/vendor/autoload.php';
$client = new \Redmine\Client\NativeCurlClient('http://redmine.example.com', 'username', 'password');
Running the test suite
You can run test suite to make sure the library will work properly on your system. Simply run vendor/bin/phpunit in the project's directory :
请发表评论