Skip to content

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