xp-framework/xp-framework — Issue #95: XPCLI: BC break in properties injection
Author: thekid
Created: 2011-12-31 15:32:04+00:00
State: open
Labels: bc-break, bug

The XPCLI behaviour has changed - most probably caused by pull request #91.

Given the following:

*~/tmp/Configured.class.php*

```php
out->writeLine('Inject key = ', $conf->readString('default', 'key'));
}

public function run() {
$this->out->writeLine('Running');
}
}
?>

With an XP Framework before
--
(Commit xp-framework@75feb01642d4bc9a0d76a415cb1f09e33c24a11f)

```sh
$ echo -e "[default]\nkey=value" > etc/config.ini
$ xpcli -c etc Configured
Inject key = value
Running
$ rm etc/config.ini
$ xpcli -c etc Configured
*** Error injecting util.Properties config: Exception io.FileNotFoundException (File "etc/config.ini" not found)
```

After the change
--
(Commit xp-framework@97a10d86491f3a997abd3f64cf6512ad76a8dbff)

```sh
$ echo -e "[default]\nkey=value" > etc/config.ini
$ xpcli -c etc Configured
Inject key = value
Running
$ rm etc/config.ini
$ xpcli -c etc Configured
*** Error injecting util.Properties config: Exception lang.IllegalArgumentException (Argument 1 passed to Configured::configure() must be an instance of Properties, null given @ F:\cygwin\home\Timm Friebe\tmp\Configured.class.php:7)
```