upgrade shell - added ability to upgrade app separately from plugins

This commit is contained in:
evilbloodydemon 2010-12-11 18:12:40 +03:00
parent 1d87411537
commit 92f92ac051

View file

@ -16,8 +16,14 @@ class UpgradeShell extends Shell {
* @return void * @return void
*/ */
function i18n() { function i18n() {
if ($this->params['plugin']) { if (!empty($this->params['plugin'])) {
$this->_paths = array(App::pluginPath($this->params['plugin'])); $this->_paths = array(App::pluginPath($this->params['plugin']));
} else {
$this->_paths = array(
CONTROLLERS,
MODELS,
VIEWS
);
} }
$this->_findFiles(); $this->_findFiles();
foreach ($this->_files as $file) { foreach ($this->_files as $file) {
@ -26,7 +32,7 @@ class UpgradeShell extends Shell {
} }
} }
protected function _findFiles() { protected function _findFiles($pattern = '') {
foreach ($this->_paths as $path) { foreach ($this->_paths as $path) {
$Folder = new Folder($path); $Folder = new Folder($path);
$files = $Folder->findRecursive('.*\.(php|ctp|thtml|inc|tpl)', true); $files = $Folder->findRecursive('.*\.(php|ctp|thtml|inc|tpl)', true);