Closed alganet closed 11 years ago
Sounds awesome but unfortunately I am not following completely.
We can now do
$container->{"conn Pdo"} = array(
'dsn' => 'sqlite::memory:',
);
/** to overwrite any configurations before calling */
$container->conn;
We can also overwrite the configuration and bypass the Instantiator completely with something like:
$container->conn = new \PDO('sqlite::memory:');
Does this satisfy the requirement here?
I've implemented something similar as Locked Containers (undocumented I believe), but tested:
https://github.com/Respect/Config/blob/develop/tests/library/Respect/Config/ContainerTest.php#L311
As usual with older issues, I forgot to close this.
sweet... :panda_face: another one dusted!
Given a config like:
The current behavior of config is throw an Exception if we try to
$container->conn
. This proposal is to add a __callable interface to Config and allow things like$container->conn(array('dsn'=>'sqlite::memory:'));'
for the above ini to work properly.This would also be the primary way of cross-container communication:
Maybe eds could use this as well to declare inter-dependencies between files.