Skip to content
Newer
Older
100755 82 lines (70 sloc) 2.75 KB
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
1 <?php
2 /*
fc8aab1 @opengeek Update Copyright date and MODx references to MODX
opengeek authored Mar 24, 2011
3 * MODX Revolution
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
4 *
fc8aab1 @opengeek Update Copyright date and MODx references to MODX
opengeek authored Mar 24, 2011
5 * Copyright 2006-2011 by MODX, LLC.
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
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
4ce99ab @opengeek Merge initial sqlsrv implementation into develop
opengeek authored Dec 27, 2010
28 error_reporting(E_ALL | E_STRICT);
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
29
30 /* define this as true in another entry file, then include this file to simply access the API
fc8aab1 @opengeek Update Copyright date and MODx references to MODX
opengeek authored Mar 24, 2011
31 * without executing the MODX request handler */
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
32 if (!defined('MODX_API_MODE')) {
33 define('MODX_API_MODE', false);
34 }
35
fc8aab1 @opengeek Update Copyright date and MODx references to MODX
opengeek authored Mar 24, 2011
36 /* this can be used to disable caching in MODX absolutely */
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
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 */
4493fed [REBUILD/UPGRADE REQUIRED]
Shaun McCormick authored Oct 27, 2009
44 if (!@include_once (MODX_CORE_PATH . "model/modx/modx.class.php")) {
45 $errorMessage = 'Site temporarily unavailable';
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
46 @include(MODX_CORE_PATH . 'error/unavailable.include.php');
47 header('HTTP/1.1 503 Service Unavailable');
4493fed [REBUILD/UPGRADE REQUIRED]
Shaun McCormick authored Oct 27, 2009
48 echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
49 exit();
50 }
51
52 /* start output buffering */
53 ob_start();
54
55 /* Create an instance of the modX class */
a8d468d @opengeek Cache refactoring to reduce impact when clearing
opengeek authored Feb 2, 2011
56 $modx= new modX();
4493fed [REBUILD/UPGRADE REQUIRED]
Shaun McCormick authored Oct 27, 2009
57 if (!is_object($modx) || !($modx instanceof modX)) {
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
58 @ob_end_flush();
fc8aab1 @opengeek Update Copyright date and MODx references to MODX
opengeek authored Mar 24, 2011
59 $errorMessage = '<a href="setup/">MODX not installed. Install now?</a>';
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
60 @include(MODX_CORE_PATH . 'error/unavailable.include.php');
61 header('HTTP/1.1 503 Service Unavailable');
4493fed [REBUILD/UPGRADE REQUIRED]
Shaun McCormick authored Oct 27, 2009
62 echo "<html><title>Error 503: Site temporarily unavailable</title><body><h1>Error 503</h1><p>{$errorMessage}</p></body></html>";
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
63 exit();
64 }
65
66 /* Set the actual start time */
67 $modx->startTime= $tstart;
68
69 /* Set additional logging options including level and target: */
4493fed [REBUILD/UPGRADE REQUIRED]
Shaun McCormick authored Oct 27, 2009
70 $modx->setLogLevel(modX::LOG_LEVEL_ERROR);
b41ed7e @opengeek IMPORTANT -- creating the official revolution 2.0 release development…
opengeek authored Apr 30, 2009
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.