<?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 {
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();
}
if (strpos ($class, "Syj_") === 0) {
$segments = explode ('_', $class);
+ if (count($segments) < 2) {
+ return;
+ }
+
+ if (count($segments) == 2) {
+ $filename = APPLICATION_PATH . '/' . end($segments) . '.php';
+ if (Zend_Loader::isReadable($filename)) {
+ include_once $filename;
+ }
+ return;
+ }
+
if (count($segments) < 3) {
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;