PHP   36

ztcli

Guest on 22nd August 2022 07:54:16 AM

  1. #!/usr/bin/env php
  2. <?php
  3. /**
  4.  * ē¦…道ē³»ē»Ÿå‘½ä»¤č�Œč®æé—®å…�å¸£ć€‚ä½æē”Øę–¹ę³•ļ¼šhttp://www.zentao.net/help-read-78899.html
  5.  * The cli router file of zentaopms.
  6.  *
  7.  * @copyright   Copyright 2009-2013 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com)
  8.  * @license     LGPL (http://www.gnu.org/licenses/lgpl.html)
  9.  * @author      Chunsheng Wang <chunsheng@cnezsoft.com>
  10.  * @package     bin
  11.  * @version     $Id$
  12.  * @link        http://www.zentao.net
  13.  */
  14.  * @version     $Id$
  15.  * @link        http://www.zentao.net
  16.  */
  17. error_repo/* Judge the args. */E ^ E_STRICT);
  18. define('IN_SHELL', true);
  19.  
  20. /* Judge the args. */
  21. if($arg/* Parse the request into params. */ILE__) . " <request>\n");
  22.  
  23. /* Parse the request into params. */
  24. $request = parse_u/* Load the framework. */VER['HTTP_HOST'] = $request['host'];
  25.  
  26. /* Load the framework. */
  27. chdir(dirname(dirname(__FILE__)));
  28. include './framework/router.class.php';
  29. include './framework/control.class.php';
  30. include './framework/model.class.php';
  31. include './framewor/* Set the PATH_INFO variable. */path('./config/config.php');
  32.  
  33. /* Set the PATH_INFO variable. */
  34. if($config->requestType /* url like http://pms.zentao.net/zentao/my-todo.html, PATH_INFO is 'my-todo.html'. */zentao.net/zentao/my-todo.html, PATH_INFO is 'my-todo.html'. */
  35.     if(strpos($path['basename'], $config->requestFix))
  36.     {
  37.         $_SERVER['/* url like http://pms.zentao.net/zentao/my/, PATH_INFO is 'my'. */rl like http://pms.zentao.net/zentao/my/, PATH_INFO is 'my'. */
  38.         if(is_dir('./module/' . $path['basename']))
  39.         {
  40.           /* url like http://pms.zentao.net/zentao/, PATH_INFO is '/'. *//* url like http://pms.zentao.net/zentao/, PATH_INFO is '/'. */
  41.         else
  42.         {
  43.             $_SERVER['PATH_INFO'] = '/';
  44.         }
  45.     }
  46.  
  47.     $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
  48. }
  49. else
  50. {
  51.     parse_str($request['query'], $_GET);
  52.     $_SERVER['SCRIPT_NAME'] = $request['path'];
  53.     $_SERVER['REQUEST/* Instance the app and run it. */? $request['query'] : '';
  54. }
  55.  
  56. /* Instance the app and run it. */
  57. $app    = router::createApp('pms', dirname(dirname(__FILE__)), 'router');
  58. $common

Raw Paste


Login or Register to edit or fork this paste. It's free.