Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/felixgirault/essence-interfaces
Provides interfaces to use external libraries with Essence.
https://github.com/felixgirault/essence-interfaces
Last synced: about 2 months ago
JSON representation
Provides interfaces to use external libraries with Essence.
- Host: GitHub
- URL: https://github.com/felixgirault/essence-interfaces
- Owner: felixgirault
- License: other
- Created: 2013-07-15T20:10:33.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-29T12:58:47.000Z (almost 11 years ago)
- Last Synced: 2024-05-01T12:40:49.816Z (9 months ago)
- Language: PHP
- Size: 195 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Essence interfaces
==================A set of interfaces to use third-party libraries within Essence.
* [Usage](#usage)
* [Cache interfaces](#cache-interfaces)
* [Http interfaces](#http-interfaces)Usage
-----Here is how to use a Doctrine cache throughout the application:
```php
$Essence = Essence\Essence::instance([
'Cache' => Essence\Di\Container::unique( function( ) {
return new Essence\Cache\Engine\Doctrine(
new Doctrine\Common\Cache\FilesystemCache( 'path/to/cache/directory' )
);
})
]);
```Cache interfaces
----------------### CakePHP
```php
$Cache = new Essence\Cache\Engine\Cake( 'configuration' );
```### Doctrine
```php
$Cache = new Essence\Cache\Engine\Doctrine(
new Doctrine\Common\Cache\FilesystemCache( 'path/to/cache/directory' ),
$ttl
);
```### Zend
```php
$Cache = new Essence\Cache\Engine\Zend(
Zend\Cache\StorageFactory::adapterFactory( 'apc' )
);
```HTTP interfaces
---------------### CakePHP
```php
$Http = new Essence\Http\Client\Cake( new HttpSocket( ));
```Log interfaces
---------------### CakePHP
```php
$Log = new Essence\Log\Logger\Cake( 'scope' );
```### PSR/Monolog
```php
$Log = new Essence\Log\Logger\Psr( new CustomPsrLogger( ));
``````php
$Monolog = new Monolog\Logger( 'essence' );
$Monolog->pushHandler(
new Monolog\Handler\StreamHandler( 'path/to/log/file' )
);$Log = new Essence\Log\Logger\Psr( $Monolog );
```