]> CyberLeo.Net >> Repos - Github/YOURLS.git/blob - includes/load-yourls.php
Fixed: properly caching options in memory
[Github/YOURLS.git] / includes / load-yourls.php
1 <?php\r
2 // This file initialize everything\r
3 \r
4 // Include everything except auth functions\r
5 require_once (dirname(__FILE__).'/version.php');\r
6 require_once (dirname(__FILE__).'/functions.php');\r
7 require_once (dirname(__FILE__).'/functions-baseconvert.php');\r
8 require_once (dirname(__FILE__).'/class-mysql.php');\r
9 \r
10 // Check if config.php was properly updated for 1.4\r
11 if( !defined('YOURLS_DB_TABLE_OPTIONS') )\r
12         die('<p>Your <tt>config.php</tt> does not contain all the required constant definitions. Please check <tt>config-sample.php</tt> and update your config accordingly, there are new stuffs!</p>');\r
13 \r
14 // Create the YOURLS object $ydb that will contain everything we globally need\r
15 if ( function_exists( 'yourls_db_connect' ) ) {\r
16         global $ydb;\r
17         yourls_db_connect();\r
18 }\r
19 \r
20 // Read option right from start\r
21 yourls_get_all_options();\r
22 \r
23 \r
24 // Check if upgrade is needed. Note: this is bypassable with define('YOURLS_NO_VERSION_CHECK', true)\r
25 if ( !defined('YOURLS_NO_VERSION_CHECK') || YOURLS_NO_VERSION_CHECK != true ) {\r
26         if ( yourls_upgrade_is_needed() ) {\r
27                 yourls_redirect( YOURLS_SITE .'/admin/upgrade.php' );\r
28         }\r
29 }