예제 #1
0
파일: trax.php 프로젝트: phpontrax/trax
 function initialize()
 {
     self::register_autoload();
     self::$version = self::version();
     if (substr(PHP_OS, 0, 3) == 'WIN') {
         # Windows
         self::$path_seperator = ";";
     }
     # Set include paths
     self::$models_path = TRAX_ROOT . "/app/models";
     self::$views_path = TRAX_ROOT . "/app/views";
     self::$controllers_path = TRAX_ROOT . "/app/controllers";
     self::$helpers_path = TRAX_ROOT . "/app/helpers";
     self::$layouts_path = TRAX_ROOT . "/app/views/layouts";
     self::$assets_path = TRAX_ROOT . "/app/assets";
     self::$config_path = TRAX_ROOT . "/config";
     self::$environments_path = TRAX_ROOT . "/config/environments";
     self::$lib_path = TRAX_ROOT . "/lib";
     self::$app_path = TRAX_ROOT . "/app";
     self::$log_path = TRAX_ROOT . "/log";
     self::$vendor_path = TRAX_ROOT . "/vendor";
     self::$plugins_path = TRAX_ROOT . "/vendor/plugins";
     self::$public_path = TRAX_ROOT . "/public";
     self::$tmp_path = TRAX_ROOT . "/tmp";
     # Set which file to log php errors to for this application
     # As well in your application you can do error_log("whatever") and it will go to this log file.
     ini_set("log_errors", "On");
     ini_set("error_log", self::$log_path . "/" . TRAX_ENV . ".log");
     if (TRAX_ENV == "development") {
         # Display errors to browser if in development mode for debugging
         ini_set("display_errors", "On");
     } else {
         # Hide errors from browser if not in development mode
         ini_set("display_errors", "Off");
     }
     # Get the include_path so we know what the original path was
     self::$server_default_include_path = ini_get("include_path");
     # Set the include_paths
     self::set_default_include_paths();
     # Include Trax library files.
     include_once TRAX_LIB_ROOT . "/session.php";
     include_once TRAX_LIB_ROOT . "/input_filter.php";
     include_once TRAX_LIB_ROOT . "/trax_exceptions.php";
     include_once TRAX_LIB_ROOT . "/inflector.php";
     include_once TRAX_LIB_ROOT . "/active_record.php";
     include_once TRAX_LIB_ROOT . "/action_controller.php";
     include_once TRAX_LIB_ROOT . "/action_view.php";
     include_once TRAX_LIB_ROOT . "/action_mailer.php";
     include_once TRAX_LIB_ROOT . "/dispatcher.php";
     include_once TRAX_LIB_ROOT . "/router.php";
     self::load_active_record_connections_config();
     ViewHandlers::register_extension('html');
     # legancy phtml extension
     ViewHandlers::register_extension('phtml');
 }
예제 #2
0
 * @version $Id$
 * @author Walt Haas <*****@*****.**>
 */
echo "testing AssetTagHelper\n";
// Call AssetTagHelperTest::main() if this source file is executed directly.
if (!defined("PHPUnit2_MAIN_METHOD")) {
    define("PHPUnit2_MAIN_METHOD", "AssetTagHelperTest::main");
}
require_once "PHPUnit2/Framework/TestCase.php";
require_once "PHPUnit2/Framework/TestSuite.php";
// You may remove the following line when all tests have been implemented.
require_once "PHPUnit2/Framework/IncompleteTestError.php";
//  root Trax files in the test directory
define("TRAX_ROOT", dirname(__FILE__) . "/");
require_once 'testenv.php';
Trax::$public_path = dirname(__FILE__) . "/public";
Trax::$url_prefix = "/testprefix";
require_once "action_view/helpers.php";
require_once "inflector.php";
require_once "action_view/helpers/url_helper.php";
require_once "action_view/helpers/asset_tag_helper.php";
require_once "trax_exceptions.php";
//  parameters need by UrlHelper
$_SERVER['HTTP_HOST'] = 'www.example.com';
$_SERVER['SERVER_PORT'] = '80';
//  referenced by the AssetTagHelper constructor
$GLOBALS['JAVASCRIPT_DEFAULT_SOURCES'] = array('this', 'that');
/**
 * Test class for AssetTagHelper.
 * Generated by PHPUnit2_Util_Skeleton on 2006-03-01 at 13:17:32.
 */