webapp.php

Go to the documentation of this file.
00001 <?php
00002   /*
00003    This file is  part of phpWebApp, which is  a framework for building
00004    web application based on relational databases.
00005 
00006    Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007
00007    Dashamir Hoxha, dashohoxha@users.sourceforge.net
00008 
00009    phpWebApp is  free software; you can redistribute  it and/or modify
00010    it under the  terms of the GNU General  Public License as published
00011    by the Free  Software Foundation; either version 2  of the License,
00012    or (at your option) any later version.
00013 
00014    phpWebApp is  distributed in the hope  that it will  be useful, but
00015    WITHOUT  ANY  WARRANTY;  without   even  the  implied  warranty  of
00016    MERCHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU
00017    General Public License for more details.
00018 
00019    You should have  received a copy of the  GNU General Public License
00020    along  with   phpWebApp;  if  not,  write  to   the  Free  Software
00021    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00022    USA
00023   */
00024 
00033   //define APP_PATH and APP_URL
00034 $app_path =  dirname(__FILE__)."/";
00035 define("APP_PATH", $app_path);
00036 
00037 $script_name = $_SERVER["SCRIPT_NAME"];
00038 $app_url =  dirname($script_name);
00039 if ($app_url!='/')  $app_url.='/';
00040 define("APP_URL", $app_url);
00041 
00042 //define the path and the URL of the upper folder
00043 $up_path = ereg_replace('[^/]+/$', '', APP_PATH);
00044 define("UP_PATH", $up_path);
00045 $up_url = ereg_replace('[^/]+/$', '', APP_URL);
00046 define("UP_URL", $up_url);
00047 
00048 //define CONFIG_PATH and include the other path constants
00049 define("CONFIG_PATH",   APP_PATH."config/");
00050 
00051 include CONFIG_PATH."const.Paths.php";
00052 
00053 //include configuration constants
00054 include CONFIG_PATH."const.Options.php";
00055 include CONFIG_PATH."const.Debug.php";
00056 
00057 //include the WebApp framework
00058 include WEBAPP_PATH."WebApp.php";
00059 
00060 //override the domain of L10n, by creating a new $l10n object
00061 $path = APP_PATH.'l10n/';
00062 $domain = 'books';
00063 $l10n = new L10n($path, $domain);
00064 
00065 if (WebApp::first_time())
00066   {
00067     //first time that the user enters in the application
00068     $request->targetPage = FIRSTPAGE;
00069     $event->targetPage = FIRSTPAGE;
00070     if (file_exists("init.php"))  include_once "init.php";
00071   }
00072 
00073 if (file_exists("global.php"))  include_once "global.php";
00074 
00075 if ($event->target=="none")
00076   {
00077     //call the free event
00078     WebApp::callFreeEvent($event);
00079   }
00080 ?>

Generated on Wed Jan 9 08:27:32 2008 for DokBookWiki by  doxygen 1.5.2