Skip to content

Commit 50721a7

Browse files
author
yishuo
committed
merged revision 3587-3611 from laboatory/trunk
git-svn-id: http://svn.simba.taobao.com/svn/PW_WindFramework/trunk@3612 18ba2127-5a84-46d4-baec-3457e417f034
1 parent ccaa20b commit 50721a7

38 files changed

Lines changed: 818 additions & 889 deletions

demos/blog/conf/config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
//应用控制器后缀定义
2222
'controller-suffix' => 'Controller',
2323
//模板目录定义
24-
'template-dir' => 'template',
24+
'template-path' => 'template',
2525
//编译文件目录定义
26-
'compile-dir' => 'data.compile',
26+
'compile-path' => 'data.compile',
2727
//错误处理句柄定义
2828
'error-handler' => 'controller.ErrorController',
2929
)

tool/command.php

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,34 @@
88
define('WIND_DEBUG', 1);
99
define('EXT', '.php');
1010
define('_COMPILE_PATH', dirname(__FILE__) . '/');
11-
include '../wind/Wind.php';
11+
include '../../wind/Wind.php';
1212

13+
//检查是否在命令行下以及目录是否可写
1314
if (!$_SERVER['argv']) e('Script should be run at command line');
1415
if (!is_writable(WIND_PATH)) e('WIND_PATH not writable');
16+
17+
//检查输入的路径
1518
$folders = array_slice($_SERVER['argv'], 1);
16-
if (empty($folders) || array_search('--help', $folders)) {
17-
$message = <<<EOD
19+
if (empty($folders) || in_array('--help', $folders)) {
20+
$message = <<<EOA
1821
这是一个动态编译脚本,你可以输入需要打包的文件夹进行打包。\n
1922
每一个输入的目录可被注册为命名空间,你可以通过这个命令空间来引入这个目录里打包好的类。\n
2023
例如:php compile.php ../wind/base ../wind/cache [...] \n
2124
对于'../wind/base'默认将用'BASE:'作为别名,你也可以输入自定义的'WIND:base'来作为这个目录的别名 \n
2225
注:此处的别名必须是你使用Wind::import方法导入类将使用的真实目录别名
23-
EOD;
26+
EOA;
2427
e($message);
2528
}
2629

30+
//遍历各个路径
2731
$classes = $imports = $fileList = array();
2832
foreach ($folders as $folder) {
2933
$alias = '';
3034
if (!is_dir($folder)) e("'$folder' is not a real directory!\n");
3135
$alias = strtoupper(basename($folder)) . ':';
32-
$message = <<<EOD
33-
'$folder' is to be register as '$alias' ? (Y|N)
34-
EOD;
35-
$r = getLine($message);
36+
$r = getLine("'$folder' is to be register as '$alias' ? (Y|N) ");
3637
if (strtolower($r[0]) != 'y') $alias = getLine(
37-
'please input the relative path using namespace: ');
38+
'Please input the relative path using namespace: ');
3839
$fileList += readRecur(realpath($folder), $alias);
3940
}
4041

@@ -47,6 +48,7 @@
4748
$message = array();
4849
$message[] = "COMPILE: pack core file successful~";
4950

51+
/*装载imports和classes*/
5052
$data = '<?php Wind::$_imports += ' . var_export($imports, true) . ';' . 'Wind::$_classes += ' . var_export(
5153
$classes, true) . ';';
5254
WindFile::write(_COMPILE_PATH . 'wind_imports.php', $data);

tool/controller/InstallController.php

Lines changed: 0 additions & 44 deletions
This file was deleted.

tool/demo/Wind.php

Lines changed: 0 additions & 273 deletions
This file was deleted.

0 commit comments

Comments
 (0)