[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/externals/restful/ -> README.md (source)

   1  # RESTful
   2  
   3  Library for writing RESTful PHP clients.
   4  
   5  [![Build Status](https://secure.travis-ci.org/bninja/restful.png)](http://travis-ci.org/bninja/restful)
   6  
   7  The design of this library was heavily influenced by [Httpful](https://github.com/nategood/httpful). 
   8  
   9  ## Requirements
  10  
  11  - [PHP](http://www.php.net) >= 5.3 **with** [cURL](http://www.php.net/manual/en/curl.installation.php)
  12  - [Httpful](https://github.com/nategood/httpful) >= 0.1
  13      
  14  ## Issues
  15  
  16  Please use appropriately tagged github [issues](https://github.com/bninja/restful/issues) to request features or report bugs.
  17  
  18  ## Installation
  19  
  20  You can install using [composer](#composer), a [phar](#phar) package or from [source](#source). Note that RESTful is [PSR-0](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md) compliant:
  21  
  22  ### Composer
  23  
  24  If you don't have Composer [install](http://getcomposer.org/doc/00-intro.md#installation) it:
  25  
  26      $ curl -s https://getcomposer.org/installer | php
  27  
  28  Add this to your `composer.json`: 
  29  
  30      {
  31          "require": {
  32              "bninja/restful": "*"
  33          }
  34      }
  35      
  36  Refresh your dependencies:
  37  
  38      $ php composer.phar update
  39      
  40  
  41  Then make sure to `require` the autoloader and initialize both:
  42      
  43      <?php
  44      require(__DIR__ . '/vendor/autoload.php');
  45      
  46      Httpful\Bootstrap::init();
  47      RESTful\Bootstrap::init();
  48      ...
  49  
  50  ### Phar
  51  
  52  Download an Httpful [phar](http://php.net/manual/en/book.phar.php) file, which are all [here](https://github.com/nategood/httpful/downloads):    
  53      
  54      $ curl -s -L -o httpful.phar https://github.com/downloads/nategood/httpful/httpful.phar
  55  
  56  Download a RESTful [phar](http://php.net/manual/en/book.phar.php) file, which are all [here](https://github.com/bninja/restful/downloads):
  57  
  58      $ curl -s -L -o restful.phar https://github.com/bninja/restful/downloads/restful-{VERSION}.phar
  59      
  60  And then `include` both:
  61  
  62      <?php
  63      include(__DIR__ . '/httpful.phar');
  64      include(__DIR__ . '/restful.phar');
  65      ...
  66  
  67  ### Source
  68  
  69  Download [Httpful](https://github.com/nategood/httpful) source:
  70  
  71      $ curl -s -L -o httpful.zip https://github.com/nategood/httpful/zipball/master;
  72      $ unzip httpful.zip; mv nategood-httpful* httpful; rm httpful.zip
  73  
  74  Download the RESTful source:
  75  
  76      $ curl -s -L -o restful.zip https://github.com/bninja/restful/zipball/master
  77      $ unzip restful.zip; mv bninja-restful-* restful; rm restful.zip
  78  
  79  And then `require` both bootstrap files:
  80  
  81      <?php
  82      require(__DIR__ . "/httpful/bootstrap.php")
  83      require(__DIR__ . "/restful/bootstrap.php")
  84      ...
  85  
  86  ## Usage
  87  
  88      TODO
  89  
  90  ## Testing
  91      
  92      $ phpunit --bootstrap vendor/autoload.php tests/
  93  
  94  ## Publishing
  95  
  96  1. Ensure that **all** [tests](#testing) pass
  97  2. Increment minor `VERSION` in `src/RESTful/Settings` and `composer.json` (`git commit -am 'v{VERSION} release'`)
  98  3. Tag it (`git tag -a v{VERSION} -m 'v{VERSION} release'`)
  99  4. Push the tag (`git push --tag`)
 100  5. [Packagist](http://packagist.org/packages/bninja/restful) will see the new tag and take it from there
 101  6. Build (`build-phar`) and upload a [phar](http://php.net/manual/en/book.phar.php) file 
 102  
 103  ## Contributing
 104  
 105  1. Fork it
 106  2. Create your feature branch (`git checkout -b my-new-feature`)
 107  3. Write your code **and [tests](#testing)**
 108  4. Ensure all tests still pass (`phpunit --bootstrap vendor/autoload.php tests/`)
 109  5. Commit your changes (`git commit -am 'Add some feature'`)
 110  6. Push to the branch (`git push origin my-new-feature`)
 111  7. Create new pull request


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1