Compare commits
No commits in common. "942f8a4bde1b4b7e8e3d7d1d980acb2ad3d76dc0" and "acdb06f766c080eb0126fa8c16cdcd8c11cd011e" have entirely different histories.
942f8a4bde
...
acdb06f766
2 changed files with 5 additions and 16 deletions
8
bin/cfg
8
bin/cfg
|
|
@ -22,7 +22,7 @@ foreach ($autoloadFiles as $autoloadFile) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$version = '0.3';
|
$version = '0.2';
|
||||||
|
|
||||||
$actions = [ 'show', 'write', 'help' ];
|
$actions = [ 'show', 'write', 'help' ];
|
||||||
$settings = ['key' => '', 'value' => ''];
|
$settings = ['key' => '', 'value' => ''];
|
||||||
|
|
@ -158,7 +158,7 @@ try {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fwrite(STDERR, $ex->getMessage().PHP_EOL);
|
echo $ex->getMessage().PHP_EOL;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -204,7 +204,7 @@ try {
|
||||||
$cfg->load(require($cfgFile));
|
$cfg->load(require($cfgFile));
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
fwrite(STDERR, "Error: ".$e->getMessage().PHP_EOL);
|
echo "Error: ".$e->getMessage()."\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
//var_dump($cfg);
|
//var_dump($cfg);
|
||||||
|
|
@ -220,7 +220,7 @@ if ($settings['key'])
|
||||||
$result = $result->{$setting};
|
$result = $result->{$setting};
|
||||||
}
|
}
|
||||||
catch (\OutOfRangeException $e) {
|
catch (\OutOfRangeException $e) {
|
||||||
fwrite(STDERR, $e->getMessage().PHP_EOL);
|
echo $e->getMessage().PHP_EOL;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace rabe\Util;
|
||||||
* Settings Class to read Configuration Files
|
* Settings Class to read Configuration Files
|
||||||
* @author Norbert.e.Wagner dev@norb.me
|
* @author Norbert.e.Wagner dev@norb.me
|
||||||
*/
|
*/
|
||||||
class Settings implements \Iterator, \Countable
|
class Settings implements \Iterator
|
||||||
{
|
{
|
||||||
private const SITE = 0x01;
|
private const SITE = 0x01;
|
||||||
|
|
||||||
|
|
@ -314,17 +314,6 @@ class Settings implements \Iterator, \Countable
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
|
|
||||||
// Countable {{{
|
|
||||||
/**
|
|
||||||
* Count elements
|
|
||||||
* @link https://www.php.net/countable.count.php
|
|
||||||
*/
|
|
||||||
public function count()
|
|
||||||
{
|
|
||||||
count($this->settings);
|
|
||||||
}
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
// Magic getter/setter methods {{{
|
// Magic getter/setter methods {{{
|
||||||
public function __set( $name, $value )
|
public function __set( $name, $value )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue