Skip to content

Commit

Permalink
trim directory separator
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Feb 5, 2017
1 parent 762b2d2 commit a769930
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,21 @@ In order for you to use annotations you have to `require doctrine/annotations`.

In order for you to use definitions cache you have to `require doctrine/cache`. [See here](http://php-di.org/doc/performances.html)

## Services registration order

Services are registered in the following order:

* Default Slim services
* Definitions provided as second argument on `build` method

## 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).

## Migration from 1.x

* PHP-DI settings have been moved out from definitions array into its own Configuration object. This object accepts an array of settings on instantiation so it's just a matter of providing settings to it.
* Configuration settings names have changed from snake_case to camelCase.
* There is only one place to override default Slim services, second argument of `build` method.
* PHP-DI settings have been moved out from definitions array into its own Configuration object. This object accepts an array of settings on instantiation so it's just a matter of providing settings to it
* Configuration settings names have changed from snake_case to camelCase

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public function setProxiesPath($proxiesPath)
throw new \RuntimeException(sprintf('%s directory does not exist', $proxiesPath));
}

$this->proxiesPath = $proxiesPath;
$this->proxiesPath = rtrim($proxiesPath, DIRECTORY_SEPARATOR);

return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class ContainerBuilder
/**
* Build PHP-DI container.
*
* @param Configuration $configuration
* @param string|array|\DI\Definition\Source\DefinitionSource $definitions
* @param Configuration $configuration
* @param string|array $definitions
*
* @return \DI\Container
*/
Expand Down

0 comments on commit a769930

Please sign in to comment.