12345678910111213141516171819202122232425262728 |
- <?php
- //error_reporting(E_ALL);
- //检测必须是命令行执行
- if(php_sapi_name() != 'cli'){
- echo 'intall.php must be executed under cli mode';
- exit;
- }
- //检查命令行参数是否正确
- if($_SERVER['argc'] <= 1){
- echo 'intall.php must be executed with 1 paramter';
- exit;
- }
- //获取命令行参数 (构件部署配置文件)
- $assembly_json = $_SERVER['argv'][1];
- if(!file_exists($assembly_json)){
- echo 'intall.php must be existing json file';
- exit;
- }
- $indexfile = __DIR__ .'/dp_index.php';
- //拷贝index.php
- copy($indexfile, dirname(__DIR__) .'/index.php');
- echo 'success';
- ?>
|