Skip to content

Commit

Permalink
Revert "Changing folder create logic to use Folder->tree"
Browse files Browse the repository at this point in the history
This reverts commit a606770.
  • Loading branch information
AD7six committed Aug 2, 2009
1 parent a0bd6e9 commit db6f2ce
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions cake/console/libs/tasks/plugin.php
Expand Up @@ -60,8 +60,8 @@ function initialize() {
function execute() { function execute() {
if (empty($this->params['skel'])) { if (empty($this->params['skel'])) {
$this->params['skel'] = ''; $this->params['skel'] = '';
if (is_dir(CAKE . 'console' . DS . 'templates' . DS . 'skel') === true) { if (is_dir(CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel') === true) {
$this->params['skel'] = CAKE . 'console' . DS . 'templates' . DS . 'skel'; $this->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel';
} }
} }
$plugin = null; $plugin = null;
Expand Down Expand Up @@ -139,15 +139,20 @@ function bake($plugin) {
if (strtolower($looksGood) == 'y') { if (strtolower($looksGood) == 'y') {
$verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n'); $verbose = $this->in(__('Do you want verbose output?', true), array('y', 'n'), 'n');


$skel = CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel'; $skel = CAKE_CORE_INCLUDE_PATH . DS . dirname(CONSOLE_LIBS) . DS . 'templates' . DS . 'skel';
$Skel =& new Folder($skel); $Skel =& new Folder($skel);
$Folder =& new Folder($this->path . $pluginPath, true); $Folder =& new Folder($this->path . $pluginPath);
$dirs = array_reverse($Folder->tree($skel, array('plugin', 'tmp'), 'dir')); $allFiles = $Skel->findRecursive();
foreach ($dirs as $dir) { $directories = array();
$dir = str_replace($skel, $this->path . $pluginPath, $dir); foreach($allFiles as $file) {
if (!is_dir($dir)) { $dir = ltrim(str_replace($skel, '', dirname($file)), DS);
new File($dir . DS . 'empty', true); if (!$dir || preg_match('@^(tmp|plugins)@', $dir) || in_array($dir, $directories)) {
continue;
} }
$dirPath = $this->path . $pluginPath . DS . $dir;
$Folder->create($dirPath);
$File =& new File($dirPath . DS . 'empty', true);
$directories[] = $dir;
} }


if (strtolower($verbose) == 'y') { if (strtolower($verbose) == 'y') {
Expand Down

0 comments on commit db6f2ce

Please sign in to comment.