예제 #1
0
파일: Native.php 프로젝트: hayate/hayate
 protected function __construct()
 {
     $include_path = rtrim(get_include_path(), PATH_SEPARATOR) . PATH_SEPARATOR;
     $modules = Hayate_Bootstrap::modules();
     foreach ($modules as $module) {
         $viewpath = MODPATH . $module . DIRECTORY_SEPARATOR . 'views';
         if (is_dir($viewpath)) {
             $include_path .= $viewpath . PATH_SEPARATOR;
         }
     }
     set_include_path($include_path);
 }
예제 #2
0
파일: View.php 프로젝트: heromaeda/hayate
 public function __toString()
 {
     try {
         return $this->fetch();
     } catch (Exception $ex) {
         restore_error_handler();
         $msg = $ex->getMessage() . ' at line: ' . $ex->getLine();
         trigger_error($msg, E_USER_ERROR);
         set_error_handler(array(Hayate_Bootstrap::getInstance(), 'error_handler'));
         return '';
     }
 }
예제 #3
0
 public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
예제 #4
0
파일: index.php 프로젝트: hayate/hayate
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * relative or absolute path of application directory
 */
$application = '../application';
/**
 * relative or absolute path to application libraries
 */
$library = '../lib';
/**
 * relative or absolute path of modules directory
 */
$modules = $application . '/modules';
/**
 * locale directory if gettext is used
 */
// $locale = '../locale';
define('APPPATH', realpath($application) . DIRECTORY_SEPARATOR);
define('LIBPATH', realpath($library) . DIRECTORY_SEPARATOR);
define('MODPATH', realpath($modules) . DIRECTORY_SEPARATOR);
define('DOCROOT', $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR);
//define('LOCPATH', realpath($locale) . DIRECTORY_SEPARATOR);
unset($application);
unset($library);
unset($modules);
//unset($locale);
require_once LIBPATH . 'Hayate/Bootstrap.php';
Hayate_Bootstrap::getInstance()->run();