summaryrefslogtreecommitdiff
path: root/app/Console
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2018-05-09 14:21:43 -0700
committerFrédéric Guillot <fred@kanboard.net>2018-05-09 14:21:43 -0700
commitfea684279c3997733f5d05c709d0b9662d1139b8 (patch)
treef53f7ed8d08d5ad119c75b58c10179765ffda83d /app/Console
parentf413ab20dd99324f2728d874059117154254ea13 (diff)
Make cli locale commands working outside of source tree
Diffstat (limited to 'app/Console')
-rw-r--r--app/Console/LocaleComparatorCommand.php4
-rw-r--r--app/Console/LocaleSyncCommand.php6
2 files changed, 5 insertions, 5 deletions
diff --git a/app/Console/LocaleComparatorCommand.php b/app/Console/LocaleComparatorCommand.php
index fd29d13e..2c6c007d 100644
--- a/app/Console/LocaleComparatorCommand.php
+++ b/app/Console/LocaleComparatorCommand.php
@@ -21,7 +21,7 @@ class LocaleComparatorCommand extends BaseCommand
protected function execute(InputInterface $input, OutputInterface $output)
{
$strings = array();
- $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('app'));
+ $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(APP_DIR));
$it->rewind();
while ($it->valid()) {
@@ -44,7 +44,7 @@ class LocaleComparatorCommand extends BaseCommand
public function compare(array $strings)
{
- $reference_file = 'app/Locale/'.self::REF_LOCALE.'/translations.php';
+ $reference_file = APP_DIR.DIRECTORY_SEPARATOR.'Locale'.DIRECTORY_SEPARATOR.self::REF_LOCALE.DIRECTORY_SEPARATOR.'translations.php';
$reference = include $reference_file;
echo str_repeat('#', 70).PHP_EOL;
diff --git a/app/Console/LocaleSyncCommand.php b/app/Console/LocaleSyncCommand.php
index 11cfbde0..23a5adfd 100644
--- a/app/Console/LocaleSyncCommand.php
+++ b/app/Console/LocaleSyncCommand.php
@@ -19,12 +19,12 @@ class LocaleSyncCommand extends BaseCommand
protected function execute(InputInterface $input, OutputInterface $output)
{
- $reference_file = 'app/Locale/'.self::REF_LOCALE.'/translations.php';
+ $reference_file = APP_DIR.DIRECTORY_SEPARATOR.'Locale'.DIRECTORY_SEPARATOR.self::REF_LOCALE.DIRECTORY_SEPARATOR.'translations.php';
$reference = include $reference_file;
- foreach (new DirectoryIterator('app/Locale') as $fileInfo) {
+ foreach (new DirectoryIterator(APP_DIR.DIRECTORY_SEPARATOR.'Locale') as $fileInfo) {
if (! $fileInfo->isDot() && $fileInfo->isDir() && $fileInfo->getFilename() !== self::REF_LOCALE) {
- $filename = 'app/Locale/'.$fileInfo->getFilename().'/translations.php';
+ $filename = APP_DIR.DIRECTORY_SEPARATOR.'Locale'.DIRECTORY_SEPARATOR.$fileInfo->getFilename().DIRECTORY_SEPARATOR.'translations.php';
echo $fileInfo->getFilename().' ('.$filename.')'.PHP_EOL;
file_put_contents($filename, $this->updateFile($reference, $filename));