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); }
/** * 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'); } } }
/** * コンストラクタ */ 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'); } } }
function init() { Command::getCommand('show')->attach($this); }
function init() { Command::getCommand('edit')->attach($this); }