- <?
- /**
- * Init of the myPHP packages.
- * This is the global init file for all the packages in the myPHP system.
- * This is where all the different packages are initialized.
- *
- * @package myPHP
- * @filesource
- * @see PORTAL_PATH.CURRENT_MYPHP_VERSION/init.php
- * @copyright (c) http://Finn-Rasmussen.com
- * @license http://Finn-Rasmussen.com/license/ myPHP License conditions
- * @author http://Finn-Rasmussen.com
- * @version 1.9
- * @since 21-oct-2005
- */
-
- /**
- * @global MYPHP_BASE_PATH The Base package is always REQUIRED. Defines the Include Path for each package, FIXED, do not change ...
- */
- define('MYPHP_BASE_PATH',MYPHP_BASE_NAME);
-
- /**
- * This package is always required and MUST be run
- * Initialize the myPHP BASE Package, FIXED, do not change ...
- * @see MYPHP_BASE_PATH.'/init.php' The Base Package
- */
- if (defined('MYPHP_BASE_PATH')) {
- require_once(MYPHP_BASE_PATH.'/init.php');
- }
-
- /**
- * The Init of the whole myPHP system, FIXED, do not change ...
- * @see PORTAL_PATH.CURRENT_MYPHP_VERSION.DEFAULT_PAGE_INIT_FILE_NAME The Init of the different myPHP modules
- */
- if (defined('DEFAULT_PAGE_INIT_FILE_NAME')) {
- require_once(PORTAL_PATH.CURRENT_MYPHP_VERSION.DEFAULT_PAGE_INIT_FILE_NAME); //
- }
-
- /**
- * The Config File, if exists, search order
- * domain-language-config.php
- * domain-config.php
- * language-config.php
- * config.php
- * @see DEFAULT_CONFIG_FILE_NAME, The Config File
- */
- if (defined('DEFAULT_CONFIG_FILE_NAME')) {
- if (file_exists(DEFAULT_DOMAIN_NAME.'-'.LANGUAGE.'-'.DEFAULT_CONFIG_FILE_NAME)) {
- require(DEFAULT_DOMAIN_NAME.'-'.LANGUAGE.'-'.DEFAULT_CONFIG_FILE_NAME);
- } else {
- if (file_exists(DEFAULT_DOMAIN_NAME.'-'.DEFAULT_CONFIG_FILE_NAME)) {
- require(DEFAULT_DOMAIN_NAME.'-'.DEFAULT_CONFIG_FILE_NAME);
- } else {
- if (file_exists(LANGUAGE.'-'.DEFAULT_CONFIG_FILE_NAME)) {
- require(LANGUAGE.'-'.DEFAULT_CONFIG_FILE_NAME);
- } else {
- if (file_exists(DEFAULT_CONFIG_FILE_NAME)) {
- require(DEFAULT_CONFIG_FILE_NAME);
- } else {
- // Do nothing
- }
- }
- }
- }
- }
-
- /**
- * root/tab/xx/config.php
- * Initialize the local tab config, FIXED, do not change ...
- * The DEFAULT_MENU_TAB_PATH.'/'.DEFAULT_CONFIG_FILE_NAME must come after the ./config.php
- * @see DEFAULT_MENU_TAB_PATH.'/'.DEFAULT_CONFIG_FILE_NAME The Local tab config for this page only
- */
- if (defined('DEFAULT_CONFIG_FILE_NAME') && !empty($_GET[REQUEST_TAB])) {
- if (defined('DEFAULT_MENU_TAB_PATH') && file_exists(DEFAULT_MENU_TAB_PATH.'/'.DEFAULT_CONFIG_FILE_NAME)) {
- require_once(DEFAULT_MENU_TAB_PATH.'/'.DEFAULT_CONFIG_FILE_NAME); // Overrule local ./config.php
- } else {
- // Ok, if no file exist
- }
- } else {
- // Ok, if no request tab
- }
-
- /**
- * ./setup.php
- * Initialize the local setup, FIXED, do not change ...
- * The ./setup.php must come before root/setup-version.php
- * @see './setup.php' The Local setup for this page only
- */
- if (file_exists('./setup-'.CURRENT_VERSION.'.php')) {
- // Must be root
- //require_once('./setup-'.CURRENT_VERSION.'.php');
-
- } else {
- if (file_exists('./setup.php')) {
- //require_once('./setup.php');
- } else {
- // Ok, if no file exist
- //die('MYPHP_PATH/init.php, Unable to include ./setup[-version].php from '.getcwd());
-
- }
- }
-
- /**
- * root/site-version.php
- * Initialize the project site-version.php, FIXED, do not change ...
- * The root/site-version.php must come before Setup-version.php
- * @see PROJECT_PATH.'/site-version.php' The setup of the Site
- */
- if (file_exists(PROJECT_PATH.'/site-'.CURRENT_VERSION.'.php')) {
- require_once(PROJECT_PATH.'/site-'.CURRENT_VERSION.'.php'); // Project Site Setup
- } else {
- die('MYPHP_PATH/init.php, Unable to include '.PROJECT_PATH.'/site-'.CURRENT_VERSION.'.php from '.PROJECT_PATH);
- }
-
- /**
- * root/setup-version.php
- * Initialize the project setup-version.php, FIXED, do not change ...
- * The root/setup-version.php must come before XXX_PATH/Setup.php
- * @see PROJECT_PATH.'/setup-version.php' The setup of the Site
- */
- if (file_exists(PROJECT_PATH.'/setup-'.CURRENT_VERSION.'.php')) {
- require_once(PROJECT_PATH.'/setup-'.CURRENT_VERSION.'.php'); // Project Setup
- } else {
- die('MYPHP_PATH/init.php, Unable to include '.PROJECT_PATH.'/setup-'.CURRENT_VERSION.'.php from '.PROJECT_PATH);
- }
-
- /**
- * Language
- * Initialize the Language to use, FIXED, do not change ...
- * @see HTML_LANGUAGE_RESOURCE_PATH.'/Setup.php', The Language Setup Package
- */
- if (defined('HTML_LANGUAGE_RESOURCE_PATH')) {
- require_once(HTML_LANGUAGE_RESOURCE_PATH.'/Setup.php');
- } else {
- /**
- * LANGUAGE
- * This is the default language to use
- * @global LANGUAGE The Language to use
- */
- if (!defined('LANGUAGE')) {
- if (defined('DEFAULT_PAGE_LANGUAGE')) {
- define('LANGUAGE',DEFAULT_PAGE_LANGUAGE);
- } else {
- /**
- * @ignore
- */
- define('LANGUAGE','da'); // What else to do?
- }
- }
- }
-
- /**
- * Setup of Base HTML
- * Initialize the final Base Setup, FIXED, do not change ...
- * @see HTML_BASE_RESOURCE_PATH.'/Setup.php', The Base Setup Package
- */
- if (defined('HTML_BASE_RESOURCE_PATH')) {
- require_once(HTML_BASE_RESOURCE_PATH.'/Setup.php');
- }
-
- /**
- * Initialize the Inc Path, if not already done
- * The INC_PATH my already been defined as a request param
- * or may be defined in the local confi or setup file
- * @global INC_PATH Include Path for the templates
- */
- if (defined('PAGE_START_FILE_NAME') && !defined('INC_PATH')) {
- // Look for local templates
- if (file_exists('.'.PAGE_START_FILE_NAME)) {
- define('INC_PATH','.');
- } else {
- // Look for site templates at DOCUMENT_ROOT
- if (file_exists(PORTAL_PATH.PAGE_START_FILE_NAME)) {
- /**
- * @ignore
- */
- define('INC_PATH',PORTAL_PATH);
- } else {
- // Look for site templates at PROJECT_PATH/DEFAULT_INC_PATH
- if (file_exists(PROJECT_PATH.DEFAULT_INC_PATH.PAGE_START_FILE_NAME)) {
- /**
- * @ignore
- */
- define('INC_PATH',PROJECT_PATH.DEFAULT_INC_PATH);
- } else {
- // Look for Default templates in myPHP System
- if (defined('DEFAULT_INC_PATH')) {
- if (file_exists(MYPHP_TEMPLATE_PATH.DEFAULT_INC_PATH.PAGE_START_FILE_NAME)) {
- /**
- * @ignore
- */
- define('INC_PATH',MYPHP_TEMPLATE_PATH.DEFAULT_INC_PATH);
- } else {
- die('MYPHP_PATH/init.php, Unable to find a PAGE_START_FILE_NAME='.PAGE_START_FILE_NAME.' template for DEFAULT_INC_PATH='.DEFAULT_INC_PATH);
- }
- }
- }
- }
- }
- } else {
- // Already defined
- }
- ?>