Updated README.md.
This commit is contained in:
50
README.md
50
README.md
@@ -30,10 +30,58 @@ install, or you may use the PEAR installer.
|
||||
|
||||
### Importing the Library
|
||||
|
||||
The HPCloud PHP library follows the PHP 5.3 recommended practices for
|
||||
including and loading. In short: Use an autoloader.
|
||||
|
||||
#### Autoloading
|
||||
|
||||
HPCloud is [PSR-0 compliant](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md),
|
||||
which means that it should work with any PSR-0 autoloader. However,
|
||||
it also comes with its own autoloader for apps that don't yet make use
|
||||
of a standard autoloader.
|
||||
|
||||
##### PSR-0 Autoloading
|
||||
|
||||
For any PSR-0 autoloader, just ensure that the `HPCloud` directory (in
|
||||
`src`) is available in your PHP include path. A PSR-0 autoloader can
|
||||
take it from there.
|
||||
|
||||
#### Using the Built-In Autoloader
|
||||
|
||||
If your project does not include its own autoloader, you can use the one
|
||||
that comes built-in. This is not a full autoloader. It's a
|
||||
special-purpose one that works only for the HPCloud source (and this is
|
||||
by design -- it's supposed to play nicely with other autoloaders).
|
||||
|
||||
To use it, you can do the following:
|
||||
|
||||
```php
|
||||
<?php
|
||||
require_once 'HPCloud/Bootstrap.php';
|
||||
|
||||
\HPCloud\Bootstrap::useAutoloader();
|
||||
?>
|
||||
```
|
||||
|
||||
This will register the autoloader as an SPL autoloader. From here,
|
||||
HPCloud classes should "just work", with no further `require` statements
|
||||
necessary.
|
||||
|
||||
You can see this in action in `test/TestCase.php`, the base class for
|
||||
unit tests.
|
||||
|
||||
### Authenticating
|
||||
|
||||
As the Component Services framework is rolled out, a unified
|
||||
authentication layer will become available.
|
||||
|
||||
Prior to that, however, each service may have its own authentication.
|
||||
|
||||
### Working with Object Storage
|
||||
|
||||
The central class for Object Storage is, appropriately enough,
|
||||
`\HPCloud\Storage\ObjectStorage`.
|
||||
|
||||
## More information
|
||||
|
||||
[HP Cloud](http://hpcloud.com) is a cloud computing platform that
|
||||
@@ -43,4 +91,4 @@ storage, and a host of hosted services.
|
||||
This library provides access to those services.
|
||||
|
||||
----
|
||||
HPCloud-PHP by HPCloud (2011)
|
||||
HPCloud-PHP is maintained by HP Cloud Services.
|
||||
|
||||
Reference in New Issue
Block a user