db = System::getInstance()->getDB(); } public function getContentType($actionId, $medium) { return 'text/html'; } public function handleAction(\MCMS\Response &$response) { $system = System::getInstance(); $activeInstance = $system->getTarget('instance'); $activeAction = $system->getTarget('action'); $request = $system->getRequest(); $method = 'run' . ucfirst($activeAction); if(method_exists($this, $method)) return $this->$method($request, $response, $activeInstance); else throw new \MCMS\Exception\PageNotFoundException($activeInstance . ':' . $activeAction); } public function createInstance($siteId, $instanceName, array $param = array()) { } public function removeInstance($siteId, $instanceName, array $param = array()) { $db = System::getInstance()->getDB(); $db->table('websitesettings')->delete(array( 'site_id' => $siteId,'instance' => $instanceName)); System::getInstance()->cacheClean(); } }