Create application initialization script

This commit is contained in:
Dmitriy Simushev 2012-09-13 13:35:25 +00:00
parent 89c61a5571
commit ce82496013
48 changed files with 58 additions and 75 deletions

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('libs/common.php'); require_once('libs/init.php');
require_once('libs/chat.php'); require_once('libs/chat.php');
require_once('libs/operator.php'); require_once('libs/operator.php');
require_once('libs/groups.php'); require_once('libs/groups.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('libs/common.php'); require_once('libs/init.php');
require_once('libs/captcha.php'); require_once('libs/captcha.php');
$captchaCode = gen_captcha(); $captchaCode = gen_captcha();

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('libs/common.php'); require_once('libs/init.php');
require_once('libs/chat.php'); require_once('libs/chat.php');
require_once('libs/operator.php'); require_once('libs/operator.php');
require_once('libs/groups.php'); require_once('libs/groups.php');

View File

@ -15,8 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/classes/database.php');
$db = Database::getInstance(); $db = Database::getInstance();

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('libs/common.php'); require_once('libs/init.php');
require_once('libs/chat.php'); require_once('libs/chat.php');
require_once('libs/expand.php'); require_once('libs/expand.php');
require_once('libs/groups.php'); require_once('libs/groups.php');

View File

@ -15,12 +15,18 @@
* limitations under the License. * limitations under the License.
*/ */
// Initialize user session
session_start(); session_start();
// Include configuration file
require_once(dirname(__FILE__) . '/config.php'); require_once(dirname(__FILE__) . '/config.php');
require_once(dirname(__FILE__) . '/plugins.php');
// Include system classes
require_once(dirname(__FILE__) . '/classes/database.php'); require_once(dirname(__FILE__) . '/classes/database.php');
require_once(dirname(__FILE__) . '/classes/settings.php'); require_once(dirname(__FILE__) . '/classes/settings.php');
require_once(dirname(__FILE__) . '/classes/event_dispatcher.php');
require_once(dirname(__FILE__) . '/classes/plugin_manager.php');
require_once(dirname(__FILE__) . '/classes/plugin.php');
// Include common libs // Include common libs
require_once(dirname(__FILE__) . '/common/constants.php'); require_once(dirname(__FILE__) . '/common/constants.php');
@ -53,4 +59,9 @@ if (function_exists("date_default_timezone_set")) {
@date_default_timezone_set(function_exists("date_default_timezone_get") ? @date_default_timezone_get() : "GMT"); @date_default_timezone_set(function_exists("date_default_timezone_get") ? @date_default_timezone_get() : "GMT");
} }
if (! empty($plugins_list)) {
// Variable $plugins_config defined in libs/config.php
PluginManager::loadPlugins($plugins_list);
}
?> ?>

View File

@ -1,27 +0,0 @@
<?php
/*
* Copyright 2005-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require_once(dirname(__FILE__) . '/classes/event_dispatcher.php');
require_once(dirname(__FILE__) . '/classes/plugin_manager.php');
require_once(dirname(__FILE__) . '/classes/plugin.php');
if (! empty($plugins_list)) {
// Variable $plugins_config defined in libs/config.php
PluginManager::loadPlugins($plugins_list);
}
?>

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('libs/common.php'); require_once('libs/init.php');
start_html_output(); start_html_output();
require('view/license.php'); require('view/license.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('libs/common.php'); require_once('libs/init.php');
require_once('libs/chat.php'); require_once('libs/chat.php');
require_once('libs/expand.php'); require_once('libs/expand.php');
require_once('libs/groups.php'); require_once('libs/groups.php');

View File

@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/init.php');
require_once('../libs/canned.php'); require_once('../libs/canned.php');
require_once('../libs/common.php');
require_once('../libs/chat.php'); require_once('../libs/chat.php');
require_once('../libs/groups.php'); require_once('../libs/groups.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
$operator = check_login(false); $operator = check_login(false);

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/operator_settings.php'); require_once('../libs/operator_settings.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/chat.php'); require_once('../libs/chat.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/pagination.php'); require_once('../libs/pagination.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/chat.php'); require_once('../libs/chat.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/pagination.php'); require_once('../libs/pagination.php');

View File

@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/init.php');
require_once('../libs/canned.php'); require_once('../libs/canned.php');
require_once('../libs/common.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/settings.php'); require_once('../libs/settings.php');
require_once('../libs/groups.php'); require_once('../libs/groups.php');

View File

@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/init.php');
require_once('../libs/canned.php'); require_once('../libs/canned.php');
require_once('../libs/common.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/pagination.php'); require_once('../libs/pagination.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/settings.php'); require_once('../libs/settings.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/groups.php'); require_once('../libs/groups.php');
require_once('../libs/getcode.php'); require_once('../libs/getcode.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/groups.php'); require_once('../libs/groups.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/groups.php'); require_once('../libs/groups.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
$operator = check_login(); $operator = check_login();

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/chat.php'); require_once('../libs/chat.php');
require_once('../libs/userinfo.php'); require_once('../libs/userinfo.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
$operator = check_login(); $operator = check_login();

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/invitation.php'); require_once('../libs/invitation.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/pagination.php'); require_once('../libs/pagination.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/groups.php'); require_once('../libs/groups.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/invitation.php'); require_once('../libs/invitation.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
$errors = array(); $errors = array();

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
logout_operator(); logout_operator();

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/operator_settings.php'); require_once('../libs/operator_settings.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
$operator = check_login(); $operator = check_login();

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/operator_settings.php'); require_once('../libs/operator_settings.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/settings.php'); require_once('../libs/settings.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/operator_settings.php'); require_once('../libs/operator_settings.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/chat.php'); require_once('../libs/chat.php');
require_once('../libs/expand.php'); require_once('../libs/expand.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/settings.php'); require_once('../libs/settings.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/settings.php'); require_once('../libs/settings.php');
require_once('../libs/notify.php'); require_once('../libs/notify.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/settings.php'); require_once('../libs/settings.php');
require_once('../libs/styles.php'); require_once('../libs/styles.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/chat.php'); require_once('../libs/chat.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/statistics.php'); require_once('../libs/statistics.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/chat.php'); require_once('../libs/chat.php');
require_once('../libs/pagination.php'); require_once('../libs/pagination.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/chat.php'); require_once('../libs/chat.php');
require_once('../libs/userinfo.php'); require_once('../libs/userinfo.php');

View File

@ -15,8 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/init.php');
require_once('../libs/chat.php'); require_once('../libs/chat.php');
require_once('../libs/common.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/track.php'); require_once('../libs/track.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/pagination.php'); require_once('../libs/pagination.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/chat.php'); require_once('../libs/chat.php');
require_once('../libs/userinfo.php'); require_once('../libs/userinfo.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/settings.php'); require_once('../libs/settings.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/chat.php'); require_once('../libs/chat.php');
require_once('../libs/userinfo.php'); require_once('../libs/userinfo.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('../libs/common.php'); require_once('../libs/init.php');
require_once('../libs/operator.php'); require_once('../libs/operator.php');
require_once('../libs/groups.php'); require_once('../libs/groups.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('libs/common.php'); require_once('libs/init.php');
require_once('libs/invitation.php'); require_once('libs/invitation.php');
require_once('libs/operator.php'); require_once('libs/operator.php');
require_once('libs/track.php'); require_once('libs/track.php');

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
require_once('libs/common.php'); require_once('libs/init.php');
require_once('libs/chat.php'); require_once('libs/chat.php');
require_once('libs/operator.php'); require_once('libs/operator.php');