@@ -17,24 +17,24 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class UnregisterCommand extends ModuleCommand |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * {@inheritdoc} |
|
| 22 | - */ |
|
| 23 | - protected function configure() |
|
| 24 | - { |
|
| 25 | - parent::configure(); |
|
| 20 | + /** |
|
| 21 | + * {@inheritdoc} |
|
| 22 | + */ |
|
| 23 | + protected function configure() |
|
| 24 | + { |
|
| 25 | + parent::configure(); |
|
| 26 | 26 | |
| 27 | - $this->setName('module:unregister') |
|
| 28 | - ->setDescription('Uninstall module'); |
|
| 29 | - } |
|
| 27 | + $this->setName('module:unregister') |
|
| 28 | + ->setDescription('Uninstall module'); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * {@inheritdoc} |
|
| 33 | - */ |
|
| 34 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 35 | - { |
|
| 36 | - $module = new Module($input->getArgument('module')); |
|
| 37 | - $module->unRegister(); |
|
| 38 | - $output->writeln(sprintf('unregistered <info>%s</info>', $module->getName())); |
|
| 39 | - } |
|
| 31 | + /** |
|
| 32 | + * {@inheritdoc} |
|
| 33 | + */ |
|
| 34 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 35 | + { |
|
| 36 | + $module = new Module($input->getArgument('module')); |
|
| 37 | + $module->unRegister(); |
|
| 38 | + $output->writeln(sprintf('unregistered <info>%s</info>', $module->getName())); |
|
| 39 | + } |
|
| 40 | 40 | } |
| 41 | 41 | \ No newline at end of file |
@@ -19,38 +19,38 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class UpdateCommand extends ModuleCommand |
| 21 | 21 | { |
| 22 | - use CanRestartTrait; |
|
| 22 | + use CanRestartTrait; |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * {@inheritdoc} |
|
| 26 | - */ |
|
| 27 | - protected function configure() |
|
| 28 | - { |
|
| 29 | - parent::configure(); |
|
| 24 | + /** |
|
| 25 | + * {@inheritdoc} |
|
| 26 | + */ |
|
| 27 | + protected function configure() |
|
| 28 | + { |
|
| 29 | + parent::configure(); |
|
| 30 | 30 | |
| 31 | - $this->setName('module:update') |
|
| 32 | - ->setDescription('Load module updates from Marketplace') |
|
| 33 | - ->addOption('beta', 'b', InputOption::VALUE_NONE, 'Allow the installation of beta releases'); |
|
| 34 | - } |
|
| 31 | + $this->setName('module:update') |
|
| 32 | + ->setDescription('Load module updates from Marketplace') |
|
| 33 | + ->addOption('beta', 'b', InputOption::VALUE_NONE, 'Allow the installation of beta releases'); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * {@inheritdoc} |
|
| 38 | - */ |
|
| 39 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 40 | - { |
|
| 41 | - $module = new Module($input->getArgument('module')); |
|
| 42 | - $modulesUpdated = null; |
|
| 43 | - while ($module->update($modulesUpdated)) |
|
| 44 | - { |
|
| 45 | - if (is_array($modulesUpdated)) |
|
| 46 | - { |
|
| 47 | - foreach ($modulesUpdated as $moduleName => $moduleVersion) |
|
| 48 | - { |
|
| 49 | - $output->writeln(sprintf('updated %s to <info>%s</info>', $moduleName, $moduleVersion)); |
|
| 50 | - } |
|
| 51 | - } |
|
| 52 | - return $this->restartScript($input, $output); |
|
| 53 | - } |
|
| 54 | - return 0; |
|
| 55 | - } |
|
| 36 | + /** |
|
| 37 | + * {@inheritdoc} |
|
| 38 | + */ |
|
| 39 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 40 | + { |
|
| 41 | + $module = new Module($input->getArgument('module')); |
|
| 42 | + $modulesUpdated = null; |
|
| 43 | + while ($module->update($modulesUpdated)) |
|
| 44 | + { |
|
| 45 | + if (is_array($modulesUpdated)) |
|
| 46 | + { |
|
| 47 | + foreach ($modulesUpdated as $moduleName => $moduleVersion) |
|
| 48 | + { |
|
| 49 | + $output->writeln(sprintf('updated %s to <info>%s</info>', $moduleName, $moduleVersion)); |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | + return $this->restartScript($input, $output); |
|
| 53 | + } |
|
| 54 | + return 0; |
|
| 55 | + } |
|
| 56 | 56 | } |
| 57 | 57 | \ No newline at end of file |
@@ -17,24 +17,24 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class RemoveCommand extends ModuleCommand |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * {@inheritdoc} |
|
| 22 | - */ |
|
| 23 | - protected function configure() |
|
| 24 | - { |
|
| 25 | - parent::configure(); |
|
| 20 | + /** |
|
| 21 | + * {@inheritdoc} |
|
| 22 | + */ |
|
| 23 | + protected function configure() |
|
| 24 | + { |
|
| 25 | + parent::configure(); |
|
| 26 | 26 | |
| 27 | - $this->setName('module:remove') |
|
| 28 | - ->setDescription('Uninstall and remove module folder from system'); |
|
| 29 | - } |
|
| 27 | + $this->setName('module:remove') |
|
| 28 | + ->setDescription('Uninstall and remove module folder from system'); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * {@inheritdoc} |
|
| 33 | - */ |
|
| 34 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 35 | - { |
|
| 36 | - $module = new Module($input->getArgument('module')); |
|
| 37 | - $module->remove(); |
|
| 38 | - $output->writeln(sprintf('removed <info>%s</info>', $module->getName())); |
|
| 39 | - } |
|
| 31 | + /** |
|
| 32 | + * {@inheritdoc} |
|
| 33 | + */ |
|
| 34 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 35 | + { |
|
| 36 | + $module = new Module($input->getArgument('module')); |
|
| 37 | + $module->remove(); |
|
| 38 | + $output->writeln(sprintf('removed <info>%s</info>', $module->getName())); |
|
| 39 | + } |
|
| 40 | 40 | } |
| 41 | 41 | \ No newline at end of file |
@@ -61,13 +61,13 @@ |
||
| 61 | 61 | if ($dir) |
| 62 | 62 | { |
| 63 | 63 | $cache->cleanDir($dir); |
| 64 | - $output->writeln('<info>Bitrix cache by "/' . BX_ROOT . '/cache/' . $dir . '" dir was deleted</info>'); |
|
| 64 | + $output->writeln('<info>Bitrix cache by "/'.BX_ROOT.'/cache/'.$dir.'" dir was deleted</info>'); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | if ($tag) |
| 68 | 68 | { |
| 69 | 69 | Application::getInstance()->getTaggedCache()->clearByTag($tag); |
| 70 | - $output->writeln('<info>Bitrix cache by tag "' . $tag . '" was deleted</info>'); |
|
| 70 | + $output->writeln('<info>Bitrix cache by tag "'.$tag.'" was deleted</info>'); |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | \ No newline at end of file |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | protected function restartScript(InputInterface $input, OutputInterface $output) |
| 33 | 33 | { |
| 34 | - $proc = popen('php -f ' . join(' ', $GLOBALS['argv']) . ' 2>&1', 'r'); |
|
| 34 | + $proc = popen('php -f '.join(' ', $GLOBALS['argv']).' 2>&1', 'r'); |
|
| 35 | 35 | while (!feof($proc)) |
| 36 | 36 | { |
| 37 | 37 | $output->write(fread($proc, 4096)); |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | if (is_array($searchResult) && $searchResult['MODULE'] == 'main') |
| 63 | 63 | { |
| 64 | 64 | list(, $path) = explode("|", $searchResult["ID"], 2); |
| 65 | - $output->writeln("\r " . $path, OutputInterface::VERBOSITY_VERBOSE); |
|
| 65 | + $output->writeln("\r ".$path, OutputInterface::VERBOSITY_VERBOSE); |
|
| 66 | 66 | } |
| 67 | 67 | } while (is_array($searchResult)); |
| 68 | 68 | |
@@ -36,11 +36,11 @@ |
||
| 36 | 36 | throw new ArgumentTypeException('callChain', 'array'); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - $chain .= '->' . $method . '(' . static::convertArgsToString($methodArgs) . ')'; |
|
| 39 | + $chain .= '->'.$method.'('.static::convertArgsToString($methodArgs).')'; |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - return '\\' . $className . '::agent(' . static::convertArgsToString($args) . ')' . $chain . ';'; |
|
| 43 | + return '\\'.$className.'::agent('.static::convertArgsToString($args).')'.$chain.';'; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | protected static function convertArgsToString(array $args) |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function setInterval($seconds) |
| 119 | 119 | { |
| 120 | - $this->interval = (int)$seconds; |
|
| 120 | + $this->interval = (int) $seconds; |
|
| 121 | 121 | |
| 122 | 122 | return $this; |
| 123 | 123 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function setPeriodically($periodically) |
| 133 | 133 | { |
| 134 | - $this->periodically = (bool)$periodically; |
|
| 134 | + $this->periodically = (bool) $periodically; |
|
| 135 | 135 | |
| 136 | 136 | return $this; |
| 137 | 137 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function setActive($active) |
| 147 | 147 | { |
| 148 | - $this->active = (bool)$active; |
|
| 148 | + $this->active = (bool) $active; |
|
| 149 | 149 | |
| 150 | 150 | return $this; |
| 151 | 151 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | public function setSort($sort) |
| 175 | 175 | { |
| 176 | - $this->sort = (int)$sort; |
|
| 176 | + $this->sort = (int) $sort; |
|
| 177 | 177 | |
| 178 | 178 | return $this; |
| 179 | 179 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | public function setUserId($userId) |
| 189 | 189 | { |
| 190 | - $this->userId = (int)$userId; |
|
| 190 | + $this->userId = (int) $userId; |
|
| 191 | 191 | |
| 192 | 192 | return $this; |
| 193 | 193 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | protected function initialize(InputInterface $input, OutputInterface $output) |
| 86 | 86 | { |
| 87 | - $this->tmplDir = __DIR__ . '/../../../tmpl'; |
|
| 87 | + $this->tmplDir = __DIR__.'/../../../tmpl'; |
|
| 88 | 88 | $this->questionHelper = $this->getHelper('question'); |
| 89 | 89 | |
| 90 | 90 | parent::initialize($input, $output); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $this->createEnvironmentsDir($input, $output); |
| 101 | 101 | $this->createConfiguration($input, $output); |
| 102 | 102 | |
| 103 | - $output->writeln('<info>' . static::COMPLETED_LOGO . '</info>'); |
|
| 103 | + $output->writeln('<info>'.static::COMPLETED_LOGO.'</info>'); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -111,14 +111,14 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | protected function createEnvironmentsDir(InputInterface $input, OutputInterface $output) |
| 113 | 113 | { |
| 114 | - $targetDir = getcwd() . '/' . $this->envDir; |
|
| 115 | - $tmplDir = $this->tmplDir . '/environments'; |
|
| 114 | + $targetDir = getcwd().'/'.$this->envDir; |
|
| 115 | + $tmplDir = $this->tmplDir.'/environments'; |
|
| 116 | 116 | |
| 117 | 117 | $output->writeln(' - Environment settings'); |
| 118 | 118 | |
| 119 | 119 | if (file_exists($targetDir)) { |
| 120 | 120 | $question = new ConfirmationQuestion( |
| 121 | - ' <error>Directory ' . $targetDir . ' already exists</error>' . PHP_EOL |
|
| 121 | + ' <error>Directory '.$targetDir.' already exists</error>'.PHP_EOL |
|
| 122 | 122 | . ' <info>Overwrite? [Y/n]</info> ', |
| 123 | 123 | true, |
| 124 | 124 | '/^(y|j)/i' |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $iterator = new \RecursiveIteratorIterator($tmplIterator, \RecursiveIteratorIterator::SELF_FIRST); |
| 135 | 135 | |
| 136 | 136 | foreach ($iterator as $item) { |
| 137 | - $itemPath = $targetDir . '/' . $iterator->getSubPathName(); |
|
| 137 | + $itemPath = $targetDir.'/'.$iterator->getSubPathName(); |
|
| 138 | 138 | |
| 139 | 139 | if ($item->isDir()) { |
| 140 | 140 | $fs->mkdir($itemPath); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - $output->writeln(' Created directory settings of environments: <comment>' . $targetDir . '</comment>'); |
|
| 146 | + $output->writeln(' Created directory settings of environments: <comment>'.$targetDir.'</comment>'); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -154,13 +154,13 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | protected function createConfiguration(InputInterface $input, OutputInterface $output) |
| 156 | 156 | { |
| 157 | - $path = $this->getApplication()->getRoot() . '/.jedi.php'; |
|
| 157 | + $path = $this->getApplication()->getRoot().'/.jedi.php'; |
|
| 158 | 158 | |
| 159 | 159 | $output->writeln(' - Configuration'); |
| 160 | 160 | |
| 161 | 161 | if (file_exists($path)) { |
| 162 | 162 | $question = new ConfirmationQuestion( |
| 163 | - ' <error>Configuration file ' . $path . ' already exists</error>' . PHP_EOL |
|
| 163 | + ' <error>Configuration file '.$path.' already exists</error>'.PHP_EOL |
|
| 164 | 164 | . ' <info>Overwrite? [Y/n]</info> ', |
| 165 | 165 | true, |
| 166 | 166 | '/^(y|j)/i' |
@@ -174,20 +174,20 @@ discard block |
||
| 174 | 174 | $fs = new Filesystem(); |
| 175 | 175 | |
| 176 | 176 | $question = new Question(' <info>Enter path to web directory relative to ' |
| 177 | - . $this->getApplication()->getRoot() . ':</info> ' . PHP_EOL |
|
| 178 | - . ' (or do not specify if you are already in the web directory)' . PHP_EOL); |
|
| 177 | + . $this->getApplication()->getRoot().':</info> '.PHP_EOL |
|
| 178 | + . ' (or do not specify if you are already in the web directory)'.PHP_EOL); |
|
| 179 | 179 | |
| 180 | - $question->setValidator(function ($answer) use ($fs) { |
|
| 180 | + $question->setValidator(function($answer) use ($fs) { |
|
| 181 | 181 | $path = $answer; |
| 182 | 182 | |
| 183 | 183 | if ($answer === null) { |
| 184 | 184 | $path = $this->getApplication()->getRoot(); |
| 185 | 185 | } elseif (!$fs->isAbsolutePath($answer)) { |
| 186 | - $path = $this->getApplication()->getRoot() . '/' . $answer; |
|
| 186 | + $path = $this->getApplication()->getRoot().'/'.$answer; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | if (!is_dir($path)) { |
| 190 | - throw new \RuntimeException('Directory "' . $path . '" is missing'); |
|
| 190 | + throw new \RuntimeException('Directory "'.$path.'" is missing'); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | return $answer; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | $webDir = $this->questionHelper->ask($input, $output, $question); |
| 197 | 197 | |
| 198 | - $content = file_get_contents($this->tmplDir . '/.jedi.php'); |
|
| 198 | + $content = file_get_contents($this->tmplDir.'/.jedi.php'); |
|
| 199 | 199 | $content = str_replace( |
| 200 | 200 | ['%web-dir%', '%env-dir%'], |
| 201 | 201 | [addslashes($webDir), addslashes($this->envDir)], |
@@ -203,6 +203,6 @@ discard block |
||
| 203 | 203 | ); |
| 204 | 204 | $fs->dumpFile($path, $content); |
| 205 | 205 | |
| 206 | - $output->writeln(' Created configuration file of application <comment>' . $path . '</comment>'); |
|
| 206 | + $output->writeln(' Created configuration file of application <comment>'.$path.'</comment>'); |
|
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | \ No newline at end of file |