/** * Send message to the Minify logger * * @param string $msg * * @return null */ public function log($msg) { Minify_Logger::log($msg); }
/** * On IIS, create $_SERVER['DOCUMENT_ROOT'] * * @param bool $unsetPathInfo (default false) if true, $_SERVER['PATH_INFO'] * will be unset (it is inconsistent with Apache's setting) * * @return null */ public static function setDocRoot($unsetPathInfo = false) { if (isset($_SERVER['SERVER_SOFTWARE']) && 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/') ) { $_SERVER['DOCUMENT_ROOT'] = rtrim(substr( $_SERVER['PATH_TRANSLATED'] ,0 ,strlen($_SERVER['PATH_TRANSLATED']) - strlen($_SERVER['SCRIPT_NAME']) ), '\\'); if ($unsetPathInfo) { unset($_SERVER['PATH_INFO']); } require_once 'Minify/Logger.php'; Minify_Logger::log("setDocRoot() set DOCUMENT_ROOT to \"{$_SERVER['DOCUMENT_ROOT']}\""); } }
/** * Send message to the Minify logger * @param string $msg * @return null */ protected function _log($msg) { require_once 'Minify/Logger.php'; Minify_Logger::log($msg); }
/** * Send message to the Minify logger * @param string $msg * @return null */ public function log($msg) { //require _once MINIFY_MIN_DIR . '/Minify/Logger.php'; Minify_Logger::log($msg); }
/** * Send message to the Minify logger * @param string $msg * @return null */ protected function log($msg) { w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Logger.php'); Minify_Logger::log($msg); }
/** * Send message to the Minify logger * @param string $msg * @return null */ protected function _log($msg) { Minify_Logger::log($msg); }
/** * Send message to the Minify logger * * @param string $msg * * @return null */ public function log($msg) { require_once 'Minify/Logger.php'; Minify_Logger::log($msg); }
/** * 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 */ protected function analyzeSources($options = array()) { if (!$this->sources) { return $options; } $type = null; foreach ($this->sources as $source) { $sourceType = $source->getContentType(); if (!empty($options['contentType'])) { // just verify sources have null content type or match the options if ($sourceType !== null && $sourceType !== $options['contentType']) { // TODO better logging Minify_Logger::log('ContentType mismatch'); $this->sources = array(); return $options; } continue; } if ($type === null) { $type = $sourceType; } elseif ($sourceType !== $type) { // TODO better logging Minify_Logger::log('ContentType mismatch'); $this->sources = array(); return $options; } } if (empty($options['contentType'])) { if (null === $type) { $type = 'text/plain'; } $options['contentType'] = $type; } // last modified is needed for caching, even if setExpires is set if (!isset($options['lastModifiedTime'])) { $max = 0; foreach ($this->sources as $source) { $max = max($source->getLastModified(), $max); } $options['lastModifiedTime'] = $max; } return $options; }
/** * On IIS, create $_SERVER['DOCUMENT_ROOT'] * * @param bool $unsetPathInfo (default false) if true, $_SERVER['PATH_INFO'] * will be unset (it is inconsistent with Apache's setting) * * @return null */ public static function setDocRoot($unsetPathInfo = false) { if (isset($_SERVER['SERVER_SOFTWARE']) && 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/')) { $_SERVER['PATH_TRANSLATED'] = preg_replace('~[/\\\\]+~', '/', $_SERVER['PATH_TRANSLATED']); $_SERVER['DOCUMENT_ROOT'] = rtrim(substr($_SERVER['PATH_TRANSLATED'], 0, strlen($_SERVER['PATH_TRANSLATED']) - strlen($_SERVER['SCRIPT_NAME'])), '\\'); if ($unsetPathInfo) { unset($_SERVER['PATH_INFO']); } w3_require_once(W3TC_LIB_MINIFY_DIR . '/Minify/Logger.php'); Minify_Logger::log("setDocRoot() set DOCUMENT_ROOT to \"{$_SERVER['DOCUMENT_ROOT']}\""); } }
/** * Send message to the Minify logger * @param string $msg * @return null */ protected function _log($msg) { //require _once MINIFY_MIN_DIR . '/Minify/Logger.php'; Minify_Logger::log($msg); }