芝麻web文件管理V1.00
编辑当前文件:/home/prismawe/www/resupres/application/bootstrap.php
" */ if (isset($_SERVER['KOHANA_ENV'])) { Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV'])); } /** * Initialize Kohana, setting the default options. * * The following options are available: * * - string base_url path, and optionally domain, of your application NULL * - string index_file name of your index file, usually "index.php" index.php * - string charset internal character set used for input and output utf-8 * - string cache_dir set the internal cache directory APPPATH/cache * - boolean errors enable or disable error handling TRUE * - boolean profile enable or disable internal profiling TRUE * - boolean caching enable or disable internal caching FALSE */ if($_SERVER['HTTP_HOST']=='localhost' OR $_SERVER['HTTP_HOST']=='localhost:81'){ $string = 'resupres/'; }else{ $string = ''; } Kohana::init(array( 'base_url' => '/'.$string, 'index_file' => false, // 'errors' => FALSE )); /** * Attach the file write to logging. Multiple writers are supported. */ Kohana::$log->attach(new Log_File(APPPATH.'logs')); /** * Attach a file reader to config. Multiple readers are supported. */ Kohana::$config->attach(new Config_File); /** * Enable modules. Modules are referenced by a relative or absolute path. */ Kohana::modules(array( // 'auth' => MODPATH.'auth', // Basic authentication 'cache' => MODPATH.'cache', // Caching with multiple backends // 'codebench' => MODPATH.'codebench', // Benchmarking tool 'database' => MODPATH.'database', // Database access // 'image' => MODPATH.'image', // Image manipulation 'orm' => MODPATH.'orm', // Object Relationship Mapping // 'unittest' => MODPATH.'unittest', // Unit testing //'userguide' => MODPATH.'userguide', // User guide and API documentation )); /** * Set the routes. Each route must have a minimum of a name, a URI and a set of * defaults for the URI. */ Route::set('fbappli', '
(/
(/
(/
)))', array( 'directory' => 'fbappli', // On oblige à utiliser ce controlleur pour cette route 'id' => '[0-9]+' )) ->defaults(array( 'controller' => 'accueil', 'action' => 'index' )); Route::set('mobile', '
(/
(/
(/
)))', array( 'directory' => 'mobile', // On oblige à utiliser ce controlleur pour cette route 'id' => '[0-9]+' )) ->defaults(array( 'controller' => 'accueil', 'action' => 'index' )); Route::set('admin', '
(/
(/
(/
(/
(/
)))))', array( 'directory' => 'admin', // On oblige à utiliser ce controlleur pour cette route 'id' => '[0-9]+', 'iddep' => '[0-9]+', 'idville' => '[0-9]+' )) ->defaults(array( 'controller' => 'duels', 'action' => 'index' )); //Route pour les résultats par segmentation géographique /* Route::set('segmentation', '
/
/
(/
(/
(/
)))', array( 'directory' => 'admin', 'controller' => 'premiertour', 'idregion' => '[0-9]+', 'iddep' => '[0-9]+', 'idville' => '[0-9]+' )) ->defaults(array( 'action' => 'geo', )); */ Route::set('orientation', '
/
-
', array( 'controller' => 'orientation', // On oblige à utiliser ce controlleur pour cette route 'id' => '[0-9]+', 'orientation' => '[a-zA-Z_]+' )) ->defaults(array( 'action' => 'index' )); Route::set('duel', '
/
(/
-
-
-contre-
-
)', array( 'controller' => 'duel', // On oblige à utiliser ce controlleur pour cette route 'id' => '[0-9]+', 'c1Nom' => '[a-zA-Z0-9_]+', 'c1Prenom' => '[a-zA-Z0-9_]+', 'c2Nom' => '[a-zA-Z0-9_]+', 'c2Prenom' => '[a-zA-Z0-9_]+' )) ->defaults(array( 'action' => 'index' )); Route::set('stats', '
/
-
', array( 'controller' => 'stats', // On oblige à utiliser ce controlleur pour cette route 'libelle' => '[a-zA-Z_]+' )) ->defaults(array( 'action' => 'index', 'libelle' => 'resultats-duels-precedents' )); Route::set('recherche', '
/
(/
)', array( 'controller' => 'recherche', // On oblige à utiliser ce controlleur pour cette route 'texteRecherche'=> '[a-zA-Z_ ]+' )) ->defaults(array( 'action' => 'index' )); //Route pour les résultats par region Route::set('resultat_region', '
/
(/
(-
))', array( 'controller' => 'region', 'action' => 'resultat_election', 'id' => '[0-9]*', 'region' => '[A-Za-z_]*' )) ->defaults(array( 'action' => 'index' )); //Route pour les résultats par département Route::set('resultat_dept', '
/
(/
(-
))', array( 'controller' => 'departement', //'action' => 'resultat_election', 'id' => '[0-9]*', 'dept' => '[A-Za-z_]*' )) ->defaults(array( 'action' => 'resultat_election' )); //Route pour les résultats par ville Route::set('resultat_ville', '
/
(/
(-
))', array( 'controller' => 'ville', 'action' => 'resultat_election', 'id' => '[0-9AB]*', 'ville' => '[A-Za-z_]*' )) ->defaults(array( 'action' => 'index' )); Route::set('parti', '
/
/
-
', array( 'controller' => 'parti', // On oblige à utiliser ce controlleur pour cette route 'id' => '[0-9]+', 'parti' => '[a-zA-Z_]+' )) ->defaults(array( 'action' => 'index' )); /* * textUnique pour les pages : être citoyen, contact et mentions légales */ Route::set('textUnique', '
/
(/
)', array( 'controller' => 'elections2012', // On oblige à utiliser ce controlleur pour cette route )) ->defaults(array( 'action' => 'index' )); Route::set('candidat', '
/
/
-
-
-
', array( 'controller' => 'candidat', // On oblige à utiliser ce controlleur pour cette route 'id' => '[0-9]+', 'nom' => '[a-zA-Z_]+', 'prenom' => '[a-zA-Z_]+', 'parti' => '[a-zA-Z_]+' )) ->defaults(array( 'action' => 'index' )); Route::set('default', '(
/)(
(/
(/
)))', array ( 'directory' => '[a-zA-Z]' )) ->defaults(array( 'controller' => 'accueil', 'action' => 'index', 'id' => '[0-9]+' ));