daily pastebin goal
2%
SHARE
TWEET

hquadrat

a guest Nov 29th, 2009 2,152 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3.  * MODx Revolution
  4.  *
  5.  * Copyright 2006, 2007, 2008, 2009 by the MODx Team.
  6.  * All rights reserved.
  7.  *
  8.  * This program is free software; you can redistribute it and/or modify it under
  9.  * the terms of the GNU General Public License as published by the Free Software
  10.  * Foundation; either version 2 of the License, or (at your option) any later
  11.  * version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful, but WITHOUT
  14.  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15.  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  16.  * details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License along with
  19.  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  20.  * Place, Suite 330, Boston, MA 02111-1307 USA
  21.  *
  22.  */
  23. $mtime= microtime();
  24. $mtime= explode(" ", $mtime);
  25. $mtime= $mtime[1] + $mtime[0];
  26. $tstart= $mtime;
  27.  
  28. error_reporting(E_ALL & ~E_NOTICE);
  29.  
  30. /**
  31.  * @deprecated 2.0.0
  32.  * For backward compatibility with MODx 0.9.x
  33.  */
  34. define("IN_PARSER_MODE", "true");
  35. /**
  36.  * @deprecated 2.0.0
  37.  * For backward compatibility with MODx 0.9.x
  38.  */
  39. define("IN_MANAGER_MODE", false);
  40.  
  41. /* define this as true in another entry file, then include this file to simply access the API
  42.  * without executing the MODx request handler */
  43. if (!defined('MODX_API_MODE')) {
  44.     define('MODX_API_MODE', false);
  45. }
  46.  
  47. /* this can be used to disable caching in MODx absolutely */
  48. $modx_cache_disabled= false;
  49.  
  50. /* include custom core config and define core path */
  51. @include(dirname(__FILE__) . '/config.core.php');
  52. if (!defined('MODX_CORE_PATH')) define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
  53.  
  54. /* include the modX class */
  55. if (!@include_once (MODX_CORE_PATH . "model/modx/modx.class.php")) {
  56.     $errorMessage = 'Site temporarily unavailable';
  57.     @include(MODX_CORE_PATH . 'error/unavailable.include.php');
  58.     header('HTTP/1.1 503 Service Unavailable');
  59.     echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
  60.     exit();
  61. }
  62.  
  63. /* start output buffering */
  64.  
  65. /* Create an instance of the modX class */
  66. if (empty($options) || !is_array($options)) $options = array();
  67. $modx= new modX('', $options);
  68. if (!is_object($modx) || !($modx instanceof modX)) {
  69.     @ob_end_flush();
  70.     $errorMessage = '<a href="setup/">MODx not installed. Install now?</a>';
  71.     @include(MODX_CORE_PATH . 'error/unavailable.include.php');
  72.     header('HTTP/1.1 503 Service Unavailable');
  73.     echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
  74.     exit();
  75. }
  76.  
  77. /* Set the actual start time */
  78. $modx->startTime= $tstart;
  79.  
  80. /* Set additional logging options including level and target: */
  81. $modx->setLogLevel(modX::LOG_LEVEL_ERROR);
  82. $modx->setLogTarget('FILE');
  83.  
  84. /* Set debugging mode (i.e. error_reporting): */
  85. $modx->setDebug(E_ALL & ~E_NOTICE);
  86.  
  87. /* Initialize the default 'web' context */
  88. $modx->initialize('web');
  89.  
  90. /* execute the request handler */
  91. if (!MODX_API_MODE) {
  92.     $modx->handleRequest();
  93. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top