Subversion Repositories Applications.papyrus

Rev

Rev 2005 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

function lancerCodeIgniter($nom_appli) {
                
        $_GET['c'] = $nom_appli ;
        $GLOBALS['retour'] = '' ;
        
        error_reporting(E_ALL);
        
        $system_folder = PAP_CHEMIN_RACINE.'papyrus/bibliotheque/system';

        $application_folder = GEN_CHEMIN_APPLICATION.$nom_appli;

        if (strpos($system_folder, '/') === FALSE) {
                if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE) {
                        $system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
                }
        } else {
                // Swap directory separators to Unix style for consistency
                $system_folder = str_replace("\\", "/", $system_folder); 
        }
        
        define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
        define('FCPATH', __FILE__);
        define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
        define('BASEPATH', $system_folder.'/');
        
        if (is_dir($application_folder)) {
                define('APPPATH', $application_folder.'/');
        } else {
                if ($application_folder == '') {
                        $application_folder = 'application';
                }
                define('APPPATH', BASEPATH.$application_folder.'/');
        }
        
        require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;
        
        return $GLOBALS['retour'] ;
 }
 
?>