同步操作将从 黎晓/JavaScript 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php/*** Class Minify_Controller_Base* @package Minify*//*** Base class for Minify controller** The controller class validates a request and uses it to create sources* for minification and set options like contentType. It's also responsible* for loading minifier code upon request.** @package Minify* @author Stephen Clay <steve@mrclay.org>*/abstract class Minify_Controller_Base {/*** Setup controller sources and set an needed options for Minify::source** You must override this method in your subclass controller to set* $this->sources. If the request is NOT valid, make sure $this->sources* is left an empty array. Then strip any controller-specific options from* $options and return it. To serve files, $this->sources must be an array of* Minify_Source objects.** @param array $options controller and Minify options** @return array $options Minify::serve options*/abstract public function setupSources($options);/*** Get default Minify options for this controller.** Override in subclass to change defaults** @return array options for Minify*/public function getDefaultMinifyOptions() {return array('isPublic' => true,'encodeOutput' => function_exists('gzdeflate'),'encodeMethod' => null // determine later,'encodeLevel' => 9,'minifierOptions' => array() // no minifier options,'contentTypeCharset' => 'utf-8','maxAge' => 1800 // 30 minutes,'rewriteCssUris' => true,'bubbleCssImports' => false,'quiet' => false // serve() will send headers and output,'debug' => false// if you override these, the response codes MUST be directly after// the first space.,'badRequestHeader' => 'HTTP/1.0 400 Bad Request','errorHeader' => 'HTTP/1.0 500 Internal Server Error'// callback function to see/modify content of all sources,'postprocessor' => null// file to require to load preprocessor,'postprocessorRequire' => null);}/*** Get default minifiers for this controller.** Override in subclass to change defaults** @return array minifier callbacks for common types*/public function getDefaultMinifers() {$ret[Minify::TYPE_JS] = array('JSMin', 'minify');$ret[Minify::TYPE_CSS] = array('Minify_CSS', 'minify');$ret[Minify::TYPE_HTML] = array('Minify_HTML', 'minify');return $ret;}/*** Is a user-given file within an allowable directory, existing,* and having an extension js/css/html/txt ?** This is a convenience function for controllers that have to accept* user-given paths** @param string $file full file path (already processed by realpath())** @param array $safeDirs directories where files are safe to serve. Files can also* be in subdirectories of these directories.** @return bool file is safe** @deprecated use checkAllowDirs, checkNotHidden instead*/public static function _fileIsSafe($file, $safeDirs){$pathOk = false;foreach ((array)$safeDirs as $safeDir) {if (strpos($file, $safeDir) === 0) {$pathOk = true;break;}}$base = basename($file);if (! $pathOk || ! is_file($file) || $base[0] === '.') {return false;}list($revExt) = explode('.', strrev($base));return in_array(strrev($revExt), array('js', 'css', 'html', 'txt'));}/*** @param string $file* @param array $allowDirs* @param string $uri* @return bool* @throws Exception*/public static function checkAllowDirs($file, $allowDirs, $uri){foreach ((array)$allowDirs as $allowDir) {if (strpos($file, $allowDir) === 0) {return true;}}throw new Exception("File '$file' is outside \$allowDirs. If the path is". " resolved via an alias/symlink, look into the \$min_symlinks option.". " E.g. \$min_symlinks['/" . dirname($uri) . "'] = '" . dirname($file) . "';");}/*** @param string $file* @throws Exception*/public static function checkNotHidden($file){$b = basename($file);if (0 === strpos($b, '.')) {throw new Exception("Filename '$b' starts with period (may be hidden)");}}/*** instances of Minify_Source, which provide content and any individual minification needs.** @var array** @see Minify_Source*/public $sources = array();/*** Short name to place inside cache id** The setupSources() method may choose to set this, making it easier to* recognize a particular set of sources/settings in the cache folder. It* will be filtered and truncated to make the final cache id <= 250 bytes.** @var string*/public $selectionId = '';/*** Mix in default controller options with user-given options** @param array $options user options** @return array mixed options*/public final function mixInDefaultOptions($options){$ret = array_merge($this->getDefaultMinifyOptions(), $options);if (! isset($options['minifiers'])) {$options['minifiers'] = array();}$ret['minifiers'] = array_merge($this->getDefaultMinifers(), $options['minifiers']);return $ret;}/*** Analyze sources (if there are any) and set $options 'contentType'* and 'lastModifiedTime' if they already aren't.** @param array $options options for Minify** @return array options for Minify*/public final function analyzeSources($options = array()){if ($this->sources) {if (! isset($options['contentType'])) {$options['contentType'] = Minify_Source::getContentType($this->sources);}// last modified is needed for caching, even if setExpires is setif (! isset($options['lastModifiedTime'])) {$max = 0;foreach ($this->sources as $source) {$max = max($source->lastModified, $max);}$options['lastModifiedTime'] = $max;}}return $options;}/*** Send message to the Minify logger** @param string $msg** @return null*/public function log($msg) {Minify_Logger::log($msg);}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。