Move general management into init.php
authorJoey Schulze <joey@infodrom.org>
Wed, 24 Feb 2010 17:25:41 +0000 (18:25 +0100)
committerJoey Schulze <joey@infodrom.org>
Wed, 24 Feb 2010 17:25:41 +0000 (18:25 +0100)
ajax/ajax.php
ajax/ricoXMLquery.php
index.php
init.php [new file with mode: 0644]

index 1dc5c35..311000e 100644 (file)
@@ -1,8 +1,6 @@
 <?php
 
-require_once('../config.php');
-require_once('../lib/general.php');
-
+require_once('../init.php');
 
 function fetch($mask)
 {
index 4c5713b..1886515 100644 (file)
@@ -1,6 +1,6 @@
 <?php\r
 \r
-require_once('../config.php');\r
+require_once('../init.php');\r
 \r
 header("Cache-Control: no-cache");\r
 header("Pragma: no-cache");\r
index 46f5c6c..d7aa154 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,15 +1,7 @@
 <?php
-# Register session
-session_name('W8KLRSESSION');
-session_start();
-
-require_once('config.php');
-require_once('lib/general.php');
+require_once('init.php');
 require_once('lib/menu.php');
 
-connect_db();
-check_session();
-
 $jsfiles = array('lib/json_parse.js');
 $jscode = '';
 $menu = menu();
diff --git a/init.php b/init.php
new file mode 100644 (file)
index 0000000..92ffee0
--- /dev/null
+++ b/init.php
@@ -0,0 +1,12 @@
+<?php
+
+session_name('W8KLRSESSION');
+session_start();
+
+require_once('config.php');
+require_once('lib/general.php');
+
+connect_db();
+check_session();
+
+?>