[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/projectpier/application/ -> application.php (source)

   1  <?php
   2  
   3    /**
   4    * Main application file. Use this file to register new classes to auto loader 
   5    * service, define application level constants, init specific application 
   6    * resources etc
   7    *
   8    * @version 1.0
   9    * @http://www.projectpier.org/
  10    */
  11    
  12    define('FILE_STORAGE_FILE_SYSTEM', 'fs');
  13    define('FILE_STORAGE_MYSQL', 'mysql');
  14    
  15    // Init flash!
  16    Flash::instance();
  17    Localization::instance()->loadSettings(DEFAULT_LOCALIZATION, ROOT . '/language');
  18    include_once  APPLICATION_PATH . '/functions.php';
  19    
  20    try {
  21      CompanyWebsite::init();
  22      
  23      if(config_option('upgrade_check_enabled', false)) {
  24        VersionChecker::check(false);
  25      } // if
  26      
  27      if(config_option('file_storage_adapter', 'mysql') == FILE_STORAGE_FILE_SYSTEM) {
  28        FileRepository::setBackend(new FileRepository_Backend_FileSystem(FILES_DIR));
  29      } else {
  30        FileRepository::setBackend(new FileRepository_Backend_MySQL(DB::connection()->getLink(), TABLE_PREFIX));
  31      } // if
  32      
  33      PublicFiles::setRepositoryPath(ROOT . '/public/files');
  34      if(trim(PUBLIC_FOLDER) == '') {
  35        PublicFiles::setRepositoryUrl(with_slash(ROOT_URL) . 'files');
  36      } else {
  37        PublicFiles::setRepositoryUrl(with_slash(ROOT_URL) . 'public/files');
  38      } // if
  39      
  40    // Owner company or administrator doen't exist? Let the user create them
  41    } catch(OwnerCompanyDnxError $e) {
  42      Env::executeAction('access', 'complete_installation');
  43    } catch(AdministratorDnxError $e) {
  44      Env::executeAction('access', 'complete_installation');
  45      
  46    // Other type of error? We need to break here
  47    }  catch(Exception $e) {
  48      if(Env::isDebugging()) {
  49        Env::dumpError($e);
  50      } else {
  51        Logger::log($e, Logger::FATAL);
  52        Env::executeAction('error', 'system');
  53      } // if
  54    } // if
  55  
  56  ?>


Generated: Tue Sep 25 23:40:09 2007 Cross-referenced by PHPXref 0.7