diff --git a/README.markdown b/README.markdown index bb9d9c60..5306fd39 100644 --- a/README.markdown +++ b/README.markdown @@ -8,32 +8,32 @@ Uses [Redmine API](http://www.redmine.org/projects/redmine/wiki/Rest_api/). * Follows PSR-0 conventions and coding standard: autoload friendly * API entry points implementation state : - * OK Attachments - * OK Groups - * OK Custom Fields - * OK Issues - * OK Issue Categories - * OK Issue Priorities - * *NOK Issue Relations - only partially implemented* - * OK Issue Statuses - * OK News - * OK Projects - * OK Project Memberships - * OK Queries - * OK Roles - * OK Time Entries - * OK Time Entry Activities - * OK Trackers - * OK Users - * OK Versions - * OK Wiki +* OK Attachments +* OK Groups +* OK Custom Fields +* OK Issues +* OK Issue Categories +* OK Issue Priorities +* *NOK Issue Relations - only partially implemented* +* OK Issue Statuses +* OK News +* OK Projects +* OK Project Memberships +* OK Queries +* OK Roles +* OK Time Entries +* OK Time Entry Activities +* OK Trackers +* OK Users +* OK Versions +* OK Wiki ## Todo * Check header's response code (especially for POST/PUT/DELETE requests) - * See http://stackoverflow.com/questions/9183178/php-curl-retrieving-response-headers-and-body-in-a-single-request/9183272#9183272 +* See http://stackoverflow.com/questions/9183178/php-curl-retrieving-response-headers-and-body-in-a-single-request/9183272#9183272 * Maybe Guzzle for handling http connections - * https://github.com/guzzle/guzzle +* https://github.com/guzzle/guzzle ## Limitations @@ -45,27 +45,98 @@ A possible solution to this would be to create an extra APIs implementing the mi ## Requirements -* PHP >= 5.3.2 with [cURL](http://php.net/manual/en/book.curl.php) extension, +* PHP >= 5.4 +* The PHP [cURL](http://php.net/manual/en/book.curl.php) extension +* The PHP [SimpleXML](http://php.net/manual/en/book.simplexml.php) extension +* The PHP [JSON](http://php.net/manual/en/book.json.php) extension +* [PHPUnit](https://phpunit.de/) >= 4.0 (optional) to run the test suite * "Enable REST web service" for your Redmine project (/settings/edit?tab=authentication) - * then obtain your *API access key* in your profile page : /my/account - * or use your *username & password* +* then obtain your *API access key* in your profile page : /my/account +* or use your *username & password* ## Install -Through [composer](http://getcomposer.org/download/), simply run : +### Composer + +[Composer](http://getcomposer.org/download/) users can simply run: ```bash $ php composer.phar require kbsali/redmine-api:~1.0 ``` +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 += 4.0 installed, you can +run the test suite to make sure that the library will function +properly on your system. Simply run `phpunit` in the php-redmine-api +directory. For example, + +``` +$ phpunit +PHPUnit 4.3.1 by Sebastian Bergmann. + +Configuration read from ./phpunit.xml.dist + +............................................................... 63 / 276 ( 22%) +............................................................... 126 / 276 ( 45%) +............................................................... 189 / 276 ( 68%) +............................................................... 252 / 276 ( 91%) +........................ + +Time: 591 ms, Memory: 10.50Mb +``` + ## Basic usage of `php-redmine-api` client ```php api('issue')->all([ ]); ``` -see `example.php` +See `example.php` for further examples. ## User Impersonation @@ -110,4 +181,4 @@ $client->setImpersonateUser(null); * Thanks to [Thomas Spycher](https://github.com/tspycher/) for the 1st version of the class. * Thanks to [Thibault Duplessis aka. ornicar](https://github.com/ornicar) for the php-github-api library, great source of inspiration! * And all the [contributors](https://github.com/kbsali/php-redmine-api/graphs/contributors) - * specially [JanMalte](https://github.com/JanMalte) for his impressive contribution to the test coverage! :) \ No newline at end of file +* specially [JanMalte](https://github.com/JanMalte) for his impressive contribution to the test coverage! :) diff --git a/lib/autoload.php b/lib/autoload.php new file mode 100644 index 00000000..2ae866b6 --- /dev/null +++ b/lib/autoload.php @@ -0,0 +1,31 @@ + diff --git a/test/bootstrap.php b/test/bootstrap.php deleted file mode 100644 index 5ea1025c..00000000 --- a/test/bootstrap.php +++ /dev/null @@ -1,18 +0,0 @@ -add('Redmine\Tests', __DIR__); - -return $loader;