]> dev.renevier.net Git - syj.git/blobdiff - application/Bootstrap.php
change file upload label
[syj.git] / application / Bootstrap.php
index 08816c00be5d778f194331ce775dd4431f7b1691..60e06279a2e25c2bae5437813e626b84191a63a6 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-/*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+/*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
     and is published under the AGPL license. */
 
 class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
@@ -14,12 +14,8 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
         parent::_bootstrap($resource);
     }
 
-    public function run()
-    {
-        $sessionConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/session.ini', APPLICATION_ENV);
-        Zend_Session::setOptions($sessionConfig->toArray());
+    public function run() {
         Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer')->initView(APPLICATION_PATH . '/views/', 'Syj_View');
-
         parent::run();
     }
 
@@ -38,7 +34,16 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
                 return;
             }
 
-            $dirpath = implode('/', array_map('strtolower', array_slice($segments, 1, -1)));
+            $isinterface = false;
+            if (strtolower(end($segments)) == "interface") {
+                $isinterface = true;
+                array_pop($segments);
+            }
+
+            $dirpath = implode(DIRECTORY_SEPARATOR, array_map('strtolower', array_slice($segments, 1, -1)));
+            if ($isinterface) {
+                $dirpath = "interface" . DIRECTORY_SEPARATOR . $dirpath;
+            }
             $filename = APPLICATION_PATH . '/' . ($dirpath ? $dirpath . '/' : '') . end($segments) . '.php';
             if (Zend_Loader::isReadable($filename)) {
                 include_once $filename;
@@ -47,4 +52,3 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
     }
 
 }
-