diff --git a/bundles/SystemBundle/Command/System/Compat/CompatCommand.php b/bundles/SystemBundle/Command/System/Compat/CompatCommand.php new file mode 100644 index 00000000..e6c8991d --- /dev/null +++ b/bundles/SystemBundle/Command/System/Compat/CompatCommand.php @@ -0,0 +1,112 @@ + '; + + /** + * Property offline. + * + * @var int + */ + protected $offline = 0; + + /** + * doExecute + * + * @return void + */ + protected function doExecute() + { + $folder = $this->getArgument(0, 'tmp'); + + $path = JPATH_BASE . '/' . trim($folder, '/\\'); + + $path = realpath($path); + + if (!$path) + { + Folder::create($path); + } + + $this->out('Creating helper file...'); + + $aliases = \JLoader::getDeprecatedAliases(); + + $placeholders = []; + + foreach ($aliases as $alias) + { + $version = $alias['version']; + + if (version_compare(JVERSION, $version, '>=')) + { + continue; + } + + $placeholders[] = $this->getTemplate($alias['old'], $alias['new']); + } + + $placeholders = "out(sprintf('File: %s created.', $path . '/compat.php')); + + return; + } + + /** + * getTemplate + * + * @param string $class + * @param string $targetClass + * + * @return string + */ + protected function getTemplate($class, $targetClass) + { + $class = ucfirst($class); + + return <<addCommand(new ClearCacheCommand); $this->addCommand(new OnCommand); $this->addCommand(new OffCommand); + $this->addCommand(new CompatCommand); } }