Index: branches/5.2.x/core/ckeditor/ckfinder/core/connector/php/php5/Core/Config.php =================================================================== diff -u -N -r15316 -r16404 --- branches/5.2.x/core/ckeditor/ckfinder/core/connector/php/php5/Core/Config.php (.../Config.php) (revision 15316) +++ branches/5.2.x/core/ckeditor/ckfinder/core/connector/php/php5/Core/Config.php (.../Config.php) (revision 16404) @@ -2,8 +2,8 @@ /* * CKFinder * ======== - * http://ckfinder.com - * Copyright (C) 2007-2012, CKSource - Frederico Knabben. All rights reserved. + * http://cksource.com/ckfinder + * Copyright (C) 2007-2013, CKSource - Frederico Knabben. All rights reserved. * * The software, this file and its contents are subject to the CKFinder * License. Please read the license.txt file before using, installing, copying, @@ -185,6 +185,24 @@ * @access private */ private $_forceAscii = false; + /** + * Temporary directory + * + * @var string + * @access private + */ + private $_tempDirectory = ''; + /** + * If set to true send files using X-Sendfile server module + * @var bool $_xsendfile + */ + private $_xsendfile = false; + /** + * Additional Nginx X-Sendfile configuration + * + * @var array $_xsendfileNginx Configuration for location => root + */ + private $_xsendfileNginx = array(); function __construct() { @@ -531,6 +549,15 @@ $this->_defaultResourceTypes = explode(",", $_defaultResourceTypes); } } + if (isset($GLOBALS['config']['TempDirectory'])) { + $this->_tempDirectory = $GLOBALS['config']['TempDirectory']; + } + if (isset($GLOBALS['config']['XSendfile'])) { + $this->_xsendfile = CKFinder_Connector_Utils_Misc::booleanValue($GLOBALS['config']['XSendfile']); + } + if (isset($GLOBALS['config']['XSendfileNginx'])) { + $this->_xsendfileNginx = (array)$GLOBALS['config']['XSendfileNginx']; + } } /** @@ -554,4 +581,40 @@ return $_names; } + + /** + * Get temporary directory + * @access public + * @return string + */ + public function getTempDirectory() + { + return $this->_tempDirectory; + } + + /** + * Get X-Sendfile option + */ + public function getXSendfile(){ + return $this->_xsendfile; + } + + /** + * Get the dditional Nginx X-Sendfile configuration (location => root) + */ + public function getXSendfileNginx(){ + $xsendfileNginx = array(); + foreach ( $this->_xsendfileNginx as $location => $root ){ + $root = (string)$root; + $location = rtrim((string)$location,'/').'/'; + if ( substr($root,-1,1) != '/' && substr($root,-1,1) != '\\') { + // root and location paths are concatenated + // @see http://wiki.nginx.org/XSendfile + $root = CKFinder_Connector_Utils_FileSystem::combinePaths(rtrim($root,'/'),$location); + } + $xsendfileNginx[$location] = $root; + } + return $xsendfileNginx; + } + }