|
From: <gem...@li...> - 2012-10-02 09:54:57
|
Revision: 970
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=970&view=rev
Author: mennodekker
Date: 2012-10-02 09:54:51 +0000 (Tue, 02 Oct 2012)
Log Message:
-----------
Added project-bootstrap with common settings for projects
Added Paths:
-----------
trunk/test/library/project-bootstrap.php
Added: trunk/test/library/project-bootstrap.php
===================================================================
--- trunk/test/library/project-bootstrap.php (rev 0)
+++ trunk/test/library/project-bootstrap.php 2012-10-02 09:54:51 UTC (rev 970)
@@ -0,0 +1,40 @@
+<?php
+/*
+ * This is a helper bootstrap file so projects need only to set their project name using
+ * define('GEMS_PROJECT_NAME', 'ProjectName');
+ * and additional settings in their own bootstrap file and then can include this file for
+ * the common settings
+ */
+
+/**
+ * Setup environment
+ */
+define('GEMS_WEB_DIR', dirname(__FILE__));
+define('GEMS_ROOT_DIR', realpath(dirname(__FILE__) . '/../'));
+define('GEMS_LIBRARY_DIR', realpath(dirname(__FILE__) . '/../library/Gems'));
+define('GEMS_PROJECT_NAME_UC', ucfirst(GEMS_PROJECT_NAME));
+define('APPLICATION_ENV', 'development');
+define('APPLICATION_PATH', GEMS_ROOT_DIR . '/application');
+
+$GLOBALS['GEMS_DIRS'] = array(
+ GEMS_PROJECT_NAME_UC => APPLICATION_PATH . '/classes',
+ 'Gems' => GEMS_LIBRARY_DIR . '/classes'
+);
+
+/**
+ * Setup include path
+ */
+set_include_path(
+ GEMS_LIBRARY_DIR . '/classes' . PATH_SEPARATOR .
+ GEMS_ROOT_DIR . '/application/classes' . PATH_SEPARATOR .
+ GEMS_WEB_DIR . '/classes' . PATH_SEPARATOR . //Test folder
+ GEMS_WEB_DIR . '/library' . PATH_SEPARATOR . //Test folder
+ get_include_path());
+
+// Set up autoload.
+require_once "Zend/Loader/Autoloader.php";
+$autoloader = Zend_Loader_Autoloader::getInstance();
+$autoloader->registerNamespace('MUtil_');
+$autoloader->registerNamespace('Gems_');
+$autoloader->registerNameSpace(GEMS_PROJECT_NAME_UC . '_');
+$autoloader->registerNameSpace('ZFDebug_');
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|