12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- //设置插件别名
- $plugins = array(
- 'uc' => 'ucenter',
- 'dpcl' => 'dpcl',
- 'dpyh' => 'dpyh',
- 'dpsb' => 'dpsb',
- 'dpsj' => 'dpsj',
- 'dpxf' => 'dpxf',
- 'dpqd' => 'dpqd',
- 'dpjk' => 'dpjk',
- );
- //获取并检查插件标识前缀
- if(PHP_SAPI == 'cli'){
- if(count($argv) >= 2 && in_array($argv[1],array('start','stop','status')) ){
- if(count($argv)>=3 && $argv[2] == '-d')
- $_GET['s'] = $argv[3];
- else
- $_GET['s'] = $argv[2];
- } else{
- $_GET['s'] = $argv[1];
- }
- }
- else{
- if(! isset($_GET['s']))
- $_GET['s'] = 'uc_manage/login';
- }
- $prefix = substr( $_GET['s'] ,0,strpos($_GET['s'] ,'_'));
- if(!isset($plugins[$prefix]))
- die('unknown plugin prefix - ' . $prefix);
- //运行相应插件
- $path = __DIR__ . '/' . $plugins[$prefix] . '/stub.php';
- if(! file_exists($path) )
- die('invalid plugin path - ' . $path);
- define('SCRIPT_FILENAME', $path);
- require $path;
- require __DIR__.'/jrtp/stub.php';
|