本文整理汇总了PHP中Command::getCommand方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::getCommand方法的具体用法?PHP Command::getCommand怎么用?PHP Command::getCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command
的用法示例。
在下文中一共展示了Command::getCommand方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
function init()
{
$db = DataBase::getinstance();
$db->begin();
if (!$db->istable('plugin_referrer')) {
$db->exec(file_get_contents(PLUGIN_DIR . 'referrer/referrer.sql'));
}
$db->commit();
Command::getCommand('show')->attach($this);
}
示例2: __construct
/**
* Constructor
*/
public function __construct()
{
// settings of the page being excuted.
if (empty(Vars::$get['plugin']) && (empty(Vars::$get['cmd']) || mb_strtolower(Vars::$get['cmd']) == 'show')) {
if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != '') {
$this->page = Page::getInstance(rawurldecode($_SERVER['PATH_INFO']));
} else {
if (isset(Vars::$get['page']) && Vars::$get['page'] != '') {
$this->page = Page::getInstance(Vars::$get['page']);
} else {
if (isset(Vars::$get['n']) && Vars::$get['n'] != '') {
$this->page = Page::getinstancebynum(Vars::$get['n']);
} else {
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') {
$this->page = Page::getInstance(rawurldecode($_SERVER['QUERY_STRING']));
} else {
$this->page = Page::getInstance(DEFAULTPAGE);
}
}
}
}
} else {
$this->page = Page::getInstance('');
}
// get a controller to execute
if (isset(Vars::$get['cmd']) && Vars::$get['cmd'] != '') {
$this->controller = Command::getCommand(Vars::$get['cmd']);
} else {
if (isset(Vars::$get['plugin']) && Vars::$get['plugin'] != '') {
$this->controller = Plugin::getPlugin(Vars::$get['plugin']);
} else {
$this->controller = Command::getCommand('show');
}
}
}
示例3: __construct
/**
* コンストラクタ
*/
function __construct()
{
//実行中ページの設定
if (empty(Vars::$get['plugin']) && (empty(Vars::$get['cmd']) || mb_strtolower(Vars::$get['cmd']) == 'show')) {
if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != '') {
$this->page = Page::getinstance(rawurldecode($_SERVER['PATH_INFO']));
} else {
if (isset(Vars::$get['page']) && Vars::$get['page'] != '') {
$this->page = Page::getinstance(Vars::$get['page']);
} else {
if (isset(Vars::$get['n']) && Vars::$get['n'] != '') {
$this->page = Page::getinstancebynum(Vars::$get['n']);
} else {
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '') {
$this->page = Page::getinstance(rawurldecode($_SERVER['QUERY_STRING']));
} else {
$this->page = Page::getinstance(DEFAULTPAGE);
}
}
}
}
} else {
$this->page = Page::getinstance('');
}
//実行するControllerの取得
if (isset(Vars::$get['cmd']) && Vars::$get['cmd'] != '') {
$this->controller = Command::getCommand(Vars::$get['cmd']);
} else {
if (isset(Vars::$get['plugin']) && Vars::$get['plugin'] != '') {
$this->controller = Plugin::getPlugin(Vars::$get['plugin']);
} else {
$this->controller = Command::getCommand('show');
}
}
}
示例4: init
function init()
{
Command::getCommand('show')->attach($this);
}