Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 82 lines (70 sloc) 2.811 kb
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
1 <?php
2 /*
fc8aab1f » opengeek
2011-03-24 Update Copyright date and MODx references to MODX
3 * MODX Revolution
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
4 *
fc8aab1f » opengeek
2011-03-24 Update Copyright date and MODx references to MODX
5 * Copyright 2006-2011 by MODX, LLC.
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
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
4ce99ab1 » opengeek
2010-12-27 Merge initial sqlsrv implementation into develop
28 error_reporting(E_ALL | E_STRICT);
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
29
30 /* define this as true in another entry file, then include this file to simply access the API
fc8aab1f » opengeek
2011-03-24 Update Copyright date and MODx references to MODX
31 * without executing the MODX request handler */
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
32 if (!defined('MODX_API_MODE')) {
33 define('MODX_API_MODE', false);
34 }
35
fc8aab1f » opengeek
2011-03-24 Update Copyright date and MODx references to MODX
36 /* this can be used to disable caching in MODX absolutely */
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
37 $modx_cache_disabled= false;
38
39 /* include custom core config and define core path */
40 @include(dirname(__FILE__) . '/config.core.php');
41 if (!defined('MODX_CORE_PATH')) define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');
42
43 /* include the modX class */
4493feda » Shaun McCormick
2009-10-27 [REBUILD/UPGRADE REQUIRED]
44 if (!@include_once (MODX_CORE_PATH . "model/modx/modx.class.php")) {
45 $errorMessage = 'Site temporarily unavailable';
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
46 @include(MODX_CORE_PATH . 'error/unavailable.include.php');
47 header('HTTP/1.1 503 Service Unavailable');
4493feda » Shaun McCormick
2009-10-27 [REBUILD/UPGRADE REQUIRED]
48 echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
49 exit();
50 }
51
52 /* start output buffering */
53 ob_start();
54
55 /* Create an instance of the modX class */
a8d468df » opengeek
2011-02-02 Cache refactoring to reduce impact when clearing
56 $modx= new modX();
4493feda » Shaun McCormick
2009-10-27 [REBUILD/UPGRADE REQUIRED]
57 if (!is_object($modx) || !($modx instanceof modX)) {
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
58 @ob_end_flush();
fc8aab1f » opengeek
2011-03-24 Update Copyright date and MODx references to MODX
59 $errorMessage = '<a href="setup/">MODX not installed. Install now?</a>';
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
60 @include(MODX_CORE_PATH . 'error/unavailable.include.php');
61 header('HTTP/1.1 503 Service Unavailable');
4493feda » Shaun McCormick
2009-10-27 [REBUILD/UPGRADE REQUIRED]
62 echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
63 exit();
64 }
65
66 /* Set the actual start time */
67 $modx->startTime= $tstart;
68
69 /* Set additional logging options including level and target: */
4493feda » Shaun McCormick
2009-10-27 [REBUILD/UPGRADE REQUIRED]
70 $modx->setLogLevel(modX::LOG_LEVEL_ERROR);
b41ed7e4 » opengeek
2009-04-30 IMPORTANT -- creating the official revolution 2.0 release development…
71 $modx->setLogTarget('FILE');
72
73 /* Set debugging mode (i.e. error_reporting): */
74 $modx->setDebug(E_ALL & ~E_NOTICE);
75
76 /* Initialize the default 'web' context */
77 $modx->initialize('web');
78
79 /* execute the request handler */
80 if (!MODX_API_MODE) {
81 $modx->handleRequest();
82 }
Something went wrong with that request. Please try again.