public static function frontControllerPreDispatch(XenForo_FrontController $fc, XenForo_RouteMatch &$routeMatch)
 {
     if (defined('DEVTOOLS_AUTOLOADER_SETUP') or self::$_checked or $routeMatch->getResponseType() != 'html') {
         return;
     }
     $paths = XenForo_Application::getInstance()->loadRequestPaths();
     $url = $paths['fullBasePath'] . 'filesync.php';
     if (class_exists('XenForo_Dependencies_Admin', false)) {
         $url .= '?admin=1';
     }
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     ob_start();
     curl_exec($ch);
     curl_close($ch);
     self::$_syncOutput = ob_get_contents();
     $logs = explode('<pre>', self::$_syncOutput);
     $errors = array();
     foreach ($logs as $log) {
         $lines = explode("\n", $log);
         foreach ($lines as $line) {
             if (strpos($line, 'E:') === 0) {
                 $origLine = str_replace('E: ', '', $line);
                 $line = '<strong>' . htmlspecialchars($origLine);
                 $pos = strpos($line, ':');
                 $line = substr($line, 0, $pos) . '</strong><i>' . substr($line, $pos);
                 $pos = strpos($line, ' in ' . DIRECTORY_SEPARATOR);
                 // hacked him!
                 $line = substr($line, 0, $pos) . '</i>' . substr($line, $pos);
                 $errors[] = $line;
                 DevTools_ChromePhp::error(trim($origLine));
             } else {
                 DevTools_ChromePhp::log(trim($line));
             }
         }
     }
     ob_end_clean();
     self::$_checked = true;
     self::$_errors = $errors;
 }
Example #2
0
 /**
  * Gets the type of response that has been requested.
  *
  * @return string
  */
 public function getResponseType()
 {
     return $this->_routeMatch->getResponseType();
 }
Example #3
0
 public static function controllerPreDispatch(XenForo_FrontController $fc, XenForo_RouteMatch &$routeMatch)
 {
     /* Listener - Execution order: #1 */
     self::$_responseType = $routeMatch->getResponseType();
 }