+ add the cli of zentaopms.

This commit is contained in:
wangchunsheng
2010-03-16 08:07:45 +00:00
parent 1842870bc7
commit 41b84342a2
3 changed files with 64 additions and 0 deletions

62
bin/ztcli Executable file
View File

@@ -0,0 +1,62 @@
#!/usr/bin/env php
<?php
/**
* The command router file of zentaopms.
*
* ZenTaoPMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* ZenTaoPMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with ZenTaoPMS. If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright: 2009-2010 Chunsheng Wang
* @author Chunsheng Wang <wwccss@263.net>
* @package ZenTaoPMS
* @version $Id$
* @link http://www.zentao.cn
*/
define('IN_SHELL', true);
/* <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
if($argc != 2)
{
die('Usage: ' . basename(__FILE__) . " <request>\n");
}
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>*/
chdir(dirname(__FILE__));
include '../../../framework/router.class.php';
include '../../../framework/control.class.php';
include '../../../framework/model.class.php';
include '../../../framework/helper.class.php';
/* ʵ<><CAB5><EFBFBD><EFBFBD>·<EFBFBD>ɶ<EFBFBD><C9B6>󣬲<EFBFBD><F3A3ACB2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD>ݿ⡣*/
$app = router::createApp('pms');
$config = $app->loadConfig('common');
$dbh = $app->connectDB();
/* <20><><EFBFBD><EFBFBD><EFBFBD>ն<EFBFBD>ʹ<EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ԣ<EFBFBD><D4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ع<EFBFBD><D8B9>õ<EFBFBD>ģ<EFBFBD>顣*/
$app->setClientLang('zh-cn');
$common = $app->loadCommon();
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>lib<69>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD>ȫ<EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD>*/
$app->loadClass('front', $static = true);
$app->loadClass('filter', $static = true);
$app->setSuperVars();
/* <20><><EFBFBD><EFBFBD>PATH_INFO<46><4F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
putenv('PATH_INFO=' . trim($argv[1]));
$config->requestType = 'PATH_INFO';
$config->pathType = 'clean';
$config->requestFix = '-';
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>󣬼<EFBFBD><F3A3ACBC><EFBFBD>ģ<EFBFBD>顣*/
$app->parseRequest();
$app->loadModule();

1
bin/ztcli.bat Normal file
View File

@@ -0,0 +1 @@
php ztcli %*

1
bin/ztcli.sh Executable file
View File

@@ -0,0 +1 @@
php ztcli $*