<?php 


/** 
***************************************************
*欢迎使用免费版SiteTeam企业建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.SiteTeam.cn 
***************************************************
**/




 if (!defined('IN_CKFINDER')) exit; class CKFinder_Connector_Core_Connector { private $_registry; function __construct() { $this->_registry =& CKFinder_Connector_Core_Factory::getInstance("Core_Registry"); $this->_registry->set("errorHandler", "ErrorHandler_Base"); } public function handleInvalidCommand() { $oErrorHandler =& $this->getErrorHandler(); $oErrorHandler->throwError(CKFINDER_CONNECTOR_ERROR_INVALID_COMMAND); } public function executeCommand($command) { if (!CKFinder_Connector_Core_Hooks::run('BeforeExecuteCommand', array(&$command))) { return; } switch ($command) { case 'FileUpload': $this->_registry->set("errorHandler", "ErrorHandler_FileUpload"); $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command); $obj->sendResponse(); break; case 'QuickUpload': $this->_registry->set("errorHandler", "ErrorHandler_QuickUpload"); $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command); $obj->sendResponse(); break; case 'DownloadFile': case 'Thumbnail': $this->_registry->set("errorHandler", "ErrorHandler_Http"); $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command); $obj->sendResponse(); break; case 'CopyFiles': case 'CreateFolder': case 'DeleteFile': case 'DeleteFolder': case 'GetFiles': case 'GetFolders': case 'Init': case 'MoveFiles': case 'RenameFile': case 'RenameFolder': $obj =& CKFinder_Connector_Core_Factory::getInstance("CommandHandler_".$command); $obj->sendResponse(); break; default: $this->handleInvalidCommand(); break; } } public function &getErrorHandler() { $_errorHandler = $this->_registry->get("errorHandler"); $oErrorHandler =& CKFinder_Connector_Core_Factory::getInstance($_errorHandler); return $oErrorHandler; } } 