* @link http://skeeks.com/ * @copyright 2010-2014 SkeekS (Sx) * @date 19.02.2015 * @since 1.0.0 */ include_once __DIR__ . '/Base.php'; /** * Class Install */ class Install extends Base { public function init() { parent::init(); echo "SkeekS CMS Application Install Tool " . file_get_contents(__DIR__ . "/VERSION") . "\n\n"; } /** * Стандартный процесс установки */ public function actionInstall() { if (isset($this->params['autoremove'])) { $this->stdoutN(' - remove all'); $this->systemCmdRoot("rm -rf .composer"); $this->systemCmdRoot("rm -f composer.lock"); $this->systemCmdRoot("rm -f composer.phar"); $this->systemCmdRoot("rm -rf vendor"); } $this->stdoutN(' - set executable'); Helper::setExecutable(ROOT_DIR, $this->setExecutable); $this->stdoutN(' - set writable'); Helper::setWritable(ROOT_DIR, $this->setWritable); $this->stdoutN(' - composer install'); if (file_exists(ROOT_DIR . '/composer.phar')) { $this->systemCmdRoot("php composer.phar self-update 1.0.0-alpha10"); } else { $this->systemCmdRoot("php -r \"readfile('https://getcomposer.org/installer');\" | php"); $this->systemCmdRoot("COMPOSER_HOME=.composer php composer.phar self-update 1.0.0-alpha10"); } $this->systemCmd("COMPOSER_HOME=.composer php composer.phar global require \"fxp/composer-asset-plugin:1.0.3\" --profile"); $this->systemCmd("COMPOSER_HOME=.composer php composer.phar install --profile"); //TODO: не запускать автоматически, сначало нужно отредактировать настройки подключения к базе данных. //$this->systemCmd("php yii cms/update/project"); } /** * */ public function actionRemove() { $this->stdoutN(' - delete all'); $this->systemCmdRoot("rm -rf .composer"); $this->systemCmdRoot("rm -f composer.lock"); $this->systemCmdRoot("rm -f composer.phar"); $this->systemCmdRoot("rm -rf vendor"); } }