Compare commits
3 commits
1c851632c3
...
56872a04c4
| Author | SHA1 | Date | |
|---|---|---|---|
|
56872a04c4 |
|||
|
f87ada6c15 |
|||
|
6f1f78fc33 |
1 changed files with 17 additions and 26 deletions
43
bin/cfg
43
bin/cfg
|
|
@ -105,7 +105,7 @@ $collection = (new Input\InputCollection())
|
|||
->description('Path where the config/ directory of the package conf files is located, defaults to the working dir')
|
||||
) // }}}
|
||||
|
||||
->add( Input\InputTypeFactory::build('LongOption')->name('siteDir') // {{{
|
||||
->add( Input\InputTypeFactory::build('LongOption')->name('siteDir')->short('s') // {{{
|
||||
->flags(AbstractInputType::FLAG_OPTIONAL | Input\AbstractInputType::FLAG_VALUE_REQUIRED)
|
||||
->description('Site/instance directory below config/. Accepts owner_xyz or config/owner_xyz')
|
||||
->validator(new Input\Validator(
|
||||
|
|
@ -320,16 +320,6 @@ $appPath = $argv->find('appPath');
|
|||
if (!$appPath) $appPath = getcwd().'/';
|
||||
$appPath = rtrim($appPath, '/').'/';
|
||||
|
||||
/* $it = new RecursiveDirectoryIterator($appPath);
|
||||
|
||||
foreach(new RecursiveIteratorIterator($it) as $file)
|
||||
{
|
||||
$configDir = $file->getPath();
|
||||
if ($file->isDir() && $file->getFilename() == '.' && basename($configDir) == 'config') {
|
||||
echo "found config dir: $configDir\n";
|
||||
}
|
||||
}
|
||||
*/
|
||||
$mode = ($argv->find('mode') == '') ? null : $argv->find('mode');
|
||||
$cfg = (new Settings([], $mode))->appPath($appPath)->prefix($prefix);
|
||||
// pkgPath points to package defaults (e.g. <prefix>.default.conf.php)
|
||||
|
|
@ -389,21 +379,22 @@ case 'show':
|
|||
echo $out.PHP_EOL;
|
||||
break;
|
||||
|
||||
case 'write':
|
||||
$inputPayload = $argv->find('in');
|
||||
if (!$inputPayload && $settings['key'] === '')
|
||||
{
|
||||
fwrite(STDERR, 'Nothing to write: provide SETTING or --in.'.PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
$path = ($settings['key'] !== '') ? explode(':', $settings['key']) : [];
|
||||
verboseLog($verbose, 'write source: '.($inputPayload ? '--in' : 'SETTING'));
|
||||
if ($inputPayload)
|
||||
{
|
||||
$setting2write = $inputPayload;
|
||||
}
|
||||
else
|
||||
{
|
||||
case 'write':
|
||||
$inputPayload = $argv->find('in');
|
||||
if (!$inputPayload && $settings['key'] === '')
|
||||
{
|
||||
fwrite(STDERR, 'Nothing to write: provide SETTING or --in.'.PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
$path = ($settings['key'] !== '') ? explode(':', $settings['key']) : [];
|
||||
verboseLog($verbose, 'write source: '.($inputPayload ? '--in' : 'SETTING'));
|
||||
|
||||
if ($inputPayload)
|
||||
{
|
||||
$setting2write = $inputPayload;
|
||||
}
|
||||
else
|
||||
{
|
||||
$setting2write = $settings['value'];
|
||||
}
|
||||
verboseLog($verbose, 'write path: '.json_encode($path));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue