function FileUpadter() { FileSystemObject::setRoot(dirname(__FILE__)); $d = new Dir('files'); $fu = new FileUpdater($d->getDir('source/includes'), $d->getDir('target/includes'), $d->getDir('backup/includes')); $command = ArgsHolder::get()->shiftCommand(); if ($command == 'cdo') { $fu->copyDo(); } elseif ($command == 'cundo') { $fu->copyUndo(); } elseif ($command == 'undo') { $fu->undo(); } elseif ($command == 'do') { $fu->run(); } else { io::out('command not found'); } }
static function undeploy($dir) { io::out('Undeploying => ~GRAY~' . substr($dir, strlen(Config::getInstance()->root_dir)) . '~~~: '); $fu = new FileUpdater(Dir::get(Config::getInstance()->root_dir, true), self::restoreTargetPath($dir), $dir); $fu->undo(); }