Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.29 KB | None | 0 0
  1. <?php
  2. /*
  3. *************************************************************************
  4. MODX Content Management System and PHP Application Framework
  5. Managed and maintained by Raymond Irving, Ryan Thrash and the
  6. MODX community
  7. *************************************************************************
  8. MODX is an opensource PHP/MySQL content management system and content
  9. management framework that is flexible, adaptable, supports XHTML/CSS
  10. layouts, and works with most web browsers, including Safari.
  11.  
  12. MODX is distributed under the GNU General Public License
  13. *************************************************************************
  14.  
  15. MODX CMS and Application Framework ("MODX")
  16. Copyright 2005 and forever thereafter by Raymond Irving & Ryan Thrash.
  17. All rights reserved.
  18.  
  19. This file and all related or dependant files distributed with this filie
  20. are considered as a whole to make up MODX.
  21.  
  22. MODX is free software; you can redistribute it and/or modify
  23. it under the terms of the GNU General Public License as published by
  24. the Free Software Foundation; either version 2 of the License, or
  25. (at your option) any later version.
  26.  
  27. MODX is distributed in the hope that it will be useful,
  28. but WITHOUT ANY WARRANTY; without even the implied warranty of
  29. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  30. GNU General Public License for more details.
  31.  
  32. You should have received a copy of the GNU General Public License
  33. along with MODX (located in "/assets/docs/"); if not, write to the Free Software
  34. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  35.  
  36. For more information on MODX please visit http://modx.com/
  37.  
  38. **************************************************************************
  39. Originally based on Etomite by Alex Butter
  40. **************************************************************************
  41. */
  42.  
  43. /**
  44. * Initialize Document Parsing
  45. * -----------------------------
  46. */
  47. $base_path = str_replace('\\','/',dirname(__FILE__)) . '/';
  48. if(is_file($base_path . 'assets/cache/siteManager.php'))
  49. include_once($base_path . 'assets/cache/siteManager.php');
  50. if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
  51. define('MGR_DIR','manager');
  52. if(is_file($base_path . 'assets/cache/siteHostnames.php'))
  53. include_once($base_path . 'assets/cache/siteHostnames.php');
  54. if(!defined('MODX_SITE_HOSTNAMES'))
  55. define('MODX_SITE_HOSTNAMES','');
  56.  
  57. // get start time
  58. $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime;
  59. $mstart = memory_get_usage();
  60.  
  61. // harden it
  62. require_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/protect.inc.php');
  63.  
  64. // set some settings, and address some IE issues
  65. @ini_set('url_rewriter.tags', '');
  66. @ini_set('session.use_trans_sid', 0);
  67. @ini_set('session.use_only_cookies',1);
  68. session_cache_limiter('');
  69. header('P3P: CP="NOI NID ADMa OUR IND UNI COM NAV"'); // header for weird cookie stuff. Blame IE.
  70. header('Cache-Control: private, must-revalidate');
  71. ob_start();
  72.  
  73. /**
  74. * Filename: index.php
  75. * Function: This file loads and executes the parser. *
  76. */
  77.  
  78. define("IN_ETOMITE_PARSER", "true"); // provides compatibility with etomite 0.6 and maybe later versions
  79. define("IN_PARSER_MODE", "true");
  80. if (!defined('IN_MANAGER_MODE')) {
  81. define("IN_MANAGER_MODE", "false");
  82. }
  83. if (!defined('MODX_API_MODE')) {
  84. define('MODX_API_MODE', false);
  85. }
  86.  
  87. // initialize the variables prior to grabbing the config file
  88. $database_type = '';
  89. $database_server = '';
  90. $database_user = '';
  91. $database_password = '';
  92. $dbase = '';
  93. $table_prefix = '';
  94. $base_url = '';
  95. $base_path = '';
  96.  
  97. // get the required includes
  98. if($database_user=="") {
  99. $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php');
  100. // Be sure config.inc.php is there and that it contains some important values
  101. if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) {
  102. echo "
  103. <style type=\"text/css\">
  104. *{margin:0;padding:0}
  105. body{margin:50px;background:#eee;}
  106. .install{padding:10px;border:5px solid #f22;background:#f99;margin:0 auto;font:120%/1em serif;text-align:center;}
  107. p{ margin:20px 0; }
  108. a{font-size:200%;color:#f22;text-decoration:underline;margin-top: 30px;padding: 5px;}
  109. </style>
  110. <div class=\"install\">
  111. <p>MODX is not currently installed or the configuration file cannot be found.</p>
  112. <p>Do you want to <a href=\"install/index.php\">install now</a>?</p>
  113. </div>";
  114. exit;
  115. }
  116. }
  117.  
  118. // start session
  119. startCMSSession();
  120.  
  121. // initiate a new document parser
  122. include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php');
  123. $modx = new DocumentParser;
  124. $etomite = &$modx; // for backward compatibility
  125.  
  126. // set some parser options
  127. $modx->minParserPasses = 1; // min number of parser recursive loops or passes
  128. $modx->maxParserPasses = 10; // max number of parser recursive loops or passes
  129. $modx->dumpSQL = false;
  130. $modx->dumpSnippets = false; // feed the parser the execution start time
  131. $modx->dumpPlugins = false;
  132. $modx->tstart = $tstart;
  133. $modx->mstart = $mstart;
  134.  
  135. // Debugging mode:
  136. $modx->stopOnNotice = false;
  137.  
  138. // Don't show PHP errors to the public
  139. if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) {
  140. @ini_set("display_errors","0");
  141. }
  142.  
  143. // execute the parser if index.php was not included
  144. if (!MODX_API_MODE) {
  145. $modx->executeParser();
  146. }
  147. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement