Browse Source

Fixes #1332: generate subdirectories when needed during message extraction process.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
d803b6f409
  1. 10
      framework/yii/console/controllers/MessageController.php

10
framework/yii/console/controllers/MessageController.php

@ -107,11 +107,13 @@ class MessageController extends Controller
@mkdir($dir); @mkdir($dir);
} }
foreach ($messages as $category => $msgs) { foreach ($messages as $category => $msgs) {
$file = str_replace("\\", '/', "$dir/$category.php");
$path = dirname($file);
if (!is_dir($path)) {
mkdir($path, 0755, true);
}
$msgs = array_values(array_unique($msgs)); $msgs = array_values(array_unique($msgs));
$this->generateMessageFile($msgs, $dir . DIRECTORY_SEPARATOR . $category . '.php', $this->generateMessageFile($msgs, $file, $config['overwrite'], $config['removeUnused'], $config['sort']);
$config['overwrite'],
$config['removeUnused'],
$config['sort']);
} }
} }
} }

Loading…
Cancel
Save