Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Apr 19, 2017
1 parent 9cc5a23 commit e604c28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ env:
php:
- 7.1
- nightly
- hhvm

matrix:
fast_finish: true
Expand All @@ -25,7 +24,6 @@ matrix:
- COMPOSER_FLAGS="--prefer-stable --prefer-source"
allow_failures:
- php: nightly
- php: hhvm

before_install:
- if [[ -z $TEST_VERSION && -f "/home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini" ]]; then phpenv config-rm xdebug.ini; fi
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

PHP-DI dependency injection container integration for Slim Framework.

In order to allow possible services out there expecting the container to be `Slim\Container` (Pimple) and thus implementing `ArrayAccess`, it has been added to default PHP-DI container. You are encouraged to use array syntax for assignment instead of PHP-DI `set` method if you plan to reuse your code with default container.
In order to allow possible services out there expecting the container to be `Slim\Container` (extending Pimple) and thus implementing `ArrayAccess`, it has been added to default container.

You are encouraged to use array syntax for assignment instead of PHP-DI `set` method if you plan to reuse your code with default Slim container.

## Installation

Expand Down Expand Up @@ -116,8 +118,8 @@ In order for you to use definitions cache you have to `require doctrine/cache`.

#### Additional settings

* `containerClass`, container class that will be built, must implement `\Interop\Container\ContainerInterface`, `\Di\FactoryInterface` and `\DI\InvokerInterface` (`\Jgut\Slim\PHPDI\Container` by default)
* `definitions`, an array or traversable of paths to definition files/directories or arrays of definitions. _Definitions are loaded in order of appearance_
* `containerClass`, container class that will be built. Must implement `\Interop\Container\ContainerInterface`, `\DI\FactoryInterface` and `\DI\InvokerInterface` (`\Jgut\Slim\PHPDI\Container` by default)
* `definitions`, an array of paths to definition files/directories or arrays of definitions. _Definitions are loaded in order of appearance_

## Services registration order

Expand All @@ -126,17 +128,16 @@ Services are registered in the following order:
* Default Slim services
* Definitions provided in configuration in the order they are in the array

Each configuration file or directory overrides previously set definitions.

## Important note

Be aware that if you use cache then all your service definitions must be provided at container creation, and more importantly **do not set any definitions later on** as it is [not allowed](http://php-di.org/doc/php-definitions.html#setting-in-the-container-directly) at runtime when using cache (setting values at runtime is allowed though).
Be aware that when you use cache then all your service definitions must be provided at container creation, and more importantly **do not set any definitions later on** as it is [not allowed](http://php-di.org/doc/php-definitions.html#setting-in-the-container-directly) at runtime when using cache (setting values at runtime is allowed though).

## Migration from 1.x

* PHP-DI have been upgraded to v6. Review PHP-DI documentation: PSR-16 use, create/autowire functions, etc
* PHP-DI settings have been moved into Configuration object. This object accepts an array of settings on instantiation so it's just a matter of providing the settings to it
* Configuration settings names have changed from snake_case to camelCase
* Definitions are included in Configuration object rather than set apart
* Definitions are included in Configuration object rather than set apart. Now you can as well define path(s) to load definition files from

## Contributing

Expand Down

0 comments on commit e604c28

Please sign in to comment.