当前位置: 首页>>代码示例>>PHP>>正文


PHP CKFinder_Connector_Core_Factory::initFactory方法代码示例

本文整理汇总了PHP中CKFinder_Connector_Core_Factory::initFactory方法的典型用法代码示例。如果您正苦于以下问题:PHP CKFinder_Connector_Core_Factory::initFactory方法的具体用法?PHP CKFinder_Connector_Core_Factory::initFactory怎么用?PHP CKFinder_Connector_Core_Factory::initFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CKFinder_Connector_Core_Factory的用法示例。


在下文中一共展示了CKFinder_Connector_Core_Factory::initFactory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 protected function execute()
 {
     \CKFinder_Connector_Core_Factory::initFactory();
     $connector =& \CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
     if ($this->request->query->has('command')) {
         $connector->executeCommand($this->request->query->get('command'));
     } else {
         $connector->handleInvalidCommand();
     }
 }
开发者ID:spin7ion,项目名称:JonlilCKFinderBundle,代码行数:10,代码来源:AbstractConnector.php

示例2: resolveUrl

/**
 * Simple function required by config.php - discover the server side path
 * to the directory relative to the "$baseUrl" attribute
 *
 * @package CKFinder
 * @subpackage Connector
 * @param string $baseUrl
 * @return string
 */
function resolveUrl($baseUrl)
{
    $fileSystem =& CKFinder_Connector_Core_Factory::getInstance("Utils_FileSystem");
    return $fileSystem->getDocumentRootPath() . $baseUrl;
}
$utilsSecurity =& CKFinder_Connector_Core_Factory::getInstance("Utils_Security");
$utilsSecurity->getRidOfMagicQuotes();
/**
 * $config must be initialised
 */
$config = array();
/**
 * read config file
 */
require_once CKFINDER_CONNECTOR_CONFIG_FILE_PATH;
CKFinder_Connector_Core_Factory::initFactory();
$connector =& CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
if (isset($_GET['command'])) {
    $connector->executeCommand($_GET['command']);
} else {
    $connector->handleInvalidCommand();
}
开发者ID:elderxavier,项目名称:SII9-CREATIVE-STUDIO,代码行数:31,代码来源:connector.php

示例3: indexAction

 public function indexAction()
 {
     $config = $this->getServiceLocator()->get('CKFinderModule\\Config');
     $ckFinderPath = realpath($config['ckfinder_vendor_path']) . '/';
     $ckFinderConnectorPath = $ckFinderPath . 'core/connector/php/';
     $ckFinderConfigPath = realpath($config['ckfinder_config_path']);
     // Below is basically a copy from connector.php:
     /**
      * Protect against sending content before all HTTP headers are sent (#186).
      */
     ob_start();
     /**
      * define required constants
      */
     require_once $ckFinderConnectorPath . '/constants.php';
     // @ob_end_clean();
     // header("Content-Encoding: none");
     /**
      * we need this class in each call
      */
     require_once CKFINDER_CONNECTOR_LIB_DIR . '/CommandHandler/CommandHandlerBase.php';
     /**
      * singleton factory
      */
     require_once CKFINDER_CONNECTOR_LIB_DIR . '/Core/Factory.php';
     /**
      * utils class
      */
     require_once CKFINDER_CONNECTOR_LIB_DIR . '/Utils/Misc.php';
     /**
      * hooks class
      */
     require_once CKFINDER_CONNECTOR_LIB_DIR . '/Core/Hooks.php';
     $utilsSecurity =& \CKFinder_Connector_Core_Factory::getInstance("Utils_Security");
     $utilsSecurity->getRidOfMagicQuotes();
     /**
      * $config must be initialised
      */
     $config = array();
     $config['Hooks'] = array();
     $config['Plugins'] = array();
     /**
      * Fix cookies bug in Flash.
      */
     if (!empty($_GET['command']) && $_GET['command'] == 'FileUpload' && !empty($_POST)) {
         foreach ($_POST as $key => $val) {
             if (strpos($key, "ckfcookie_") === 0) {
                 $_COOKIE[str_replace("ckfcookie_", "", $key)] = $val;
             }
         }
     }
     /**
      * read config file
      */
     require_once $ckFinderConfigPath;
     \CKFinder_Connector_Core_Factory::initFactory();
     $connector =& \CKFinder_Connector_Core_Factory::getInstance("Core_Connector");
     // The globals array is being used for the config and connector
     // ( and $GLOBALS['CKFLang'], which is set by ckfinder itself )
     // we are however not in a global context right now, so we're going to
     // have to add the keys/references manually
     $GLOBALS['config'] =& $config;
     $GLOBALS['connector'] =& $connector;
     // Now that the config is setup like it would be in a normal ckfinder run:
     if (isset($_GET['command'])) {
         $connector->executeCommand($_GET['command']);
     } else {
         $connector->handleInvalidCommand();
     }
     // Please do not render view / layout!
     return $this->response;
 }
开发者ID:JaapMoolenaar,项目名称:CKFinderModule,代码行数:72,代码来源:ConnectorController.php


注:本文中的CKFinder_Connector_Core_Factory::initFactory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。