Page MenuHomeIn-Portal Phabricator

custom
No OneTemporary

File Metadata

Created
Mon, Feb 24, 1:25 AM
Index: branches/1.2.x/install.php
===================================================================
--- branches/1.2.x/install.php (revision 15642)
+++ branches/1.2.x/install.php (revision 15643)
@@ -1,32 +1,38 @@
<?php
- $module_folder = 'modules/custom';
+$module_folder = 'modules/custom';
- if (!defined('IS_INSTALL')) {
- // separate module install
- define('IS_INSTALL', 1);
- define('ADMIN', 1);
- define('FULL_PATH', realpath(dirname(__FILE__) . '/../..') );
+if ( !defined('IS_INSTALL') ) {
+ // separate module install
+ define('IS_INSTALL', 1);
+ define('ADMIN', 1);
+ define('FULL_PATH', realpath(dirname(__FILE__) . '/../..'));
- include_once(FULL_PATH . '/core/kernel/startup.php');
- require_once FULL_PATH . '/core/install/install_toolkit.php';
+ include_once(FULL_PATH . '/core/kernel/startup.php');
+ require_once FULL_PATH . '/core/install/install_toolkit.php';
- $toolkit = new kInstallToolkit();
- }
- else {
- // install, using installation wizard
- $toolkit =& $this->toolkit;
- /* @var $toolkit kInstallToolkit */
- }
-
- $application =& kApplication::Instance();
- $application->Init();
+ $constants_file = FULL_PATH . '/' . $module_folder . '/constants.php';
- if ($application->RecallVar('user_id') != USER_ROOT) {
- die('restricted access!');
+ if ( file_exists($constants_file) ) {
+ require_once $constants_file;
}
- $toolkit->RunSQL('/' . $module_folder .'/install/install_schema.sql');
- $toolkit->RunSQL('/' . $module_folder .'/install/install_data.sql');
- $toolkit->ImportLanguage('/' . $module_folder .'/install/english');
+ $toolkit = new kInstallToolkit();
+}
+else {
+ // install, using installation wizard
+ $toolkit =& $this->toolkit;
+ /* @var $toolkit kInstallToolkit */
+}
+
+$application =& kApplication::Instance();
+$application->Init();
+
+if ( $application->RecallVar('user_id') != USER_ROOT ) {
+ die('restricted access!');
+}
+
+$toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql');
+$toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql');
+$toolkit->ImportLanguage('/' . $module_folder . '/install/english');
- $toolkit->finalizeModuleInstall($module_folder, false);
\ No newline at end of file
+$toolkit->finalizeModuleInstall($module_folder, false);
\ No newline at end of file

Event Timeline