Show
Ignore:
Timestamp:
05/25/06 02:58:10 (6 years ago)
Author:
john
Message:

Major changes to environment added boot.php and Trax class to hold framwork config

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/trax_generator.php

    r200 r201  
    136136 
    137137    /** 
    138      *  Value of the view files extension (usually '.phtml') 
    139      *  @var string 
    140      */ 
    141     public $view_file_extention = TRAX_VIEWS_EXTENTION; 
    142  
    143     /** 
    144138     *  Constructor for the TraxGenerator object 
    145139     * 
     
    147141     *  subdirectories of the Trax work area and the template files 
    148142     *  used to generate application files 
    149      *  @uses $GLOBALS['TRAX_INCLUDES'] 
    150      *  @global string[] $GLOBALS['TRAX_INCLUDES'] Array of paths to 
    151      *                                             various Trax directories 
     143     * 
    152144     *  @uses controller_path 
    153145     *  @uses controller_template_file 
     
    162154     */ 
    163155    function __construct() { 
    164         $this->view_path = 
    165                TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['views']; 
    166         $this->controller_path = 
    167                TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['controllers']; 
    168         $this->helper_path = 
    169                TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['helpers']; 
    170         $this->model_path = 
    171                TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['models']; 
    172         $this->layouts_path = 
    173                TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['layouts']; 
     156        $this->view_path = Trax::$views_path; 
     157        $this->controller_path = Trax::$controllers_path; 
     158        $this->helper_path = Trax::$helpers_path; 
     159        $this->model_path = Trax::$models_path; 
     160        $this->layouts_path = Trax::$layouts_path; 
    174161        $this->controller_template_file = 
    175162               TRAX_LIB_ROOT . "/templates/controller.php"; 
     
    573560            echo $e->getMessage()."\n"; 
    574561            echo "for database '" 
    575                 . $GLOBALS['TRAX_DB_SETTINGS'][TRAX_MODE]['database'] 
     562                . Trax::$database_settings[TRAX_ENV]['database'] 
    576563                . "' on host '" 
    577                 . $GLOBALS['TRAX_DB_SETTINGS'][TRAX_MODE]['hostspec'] 
     564                . Trax::$database_settings[TRAX_ENV]['hostspec'] 
    578565                . "' as user '" 
    579                 . $GLOBALS['TRAX_DB_SETTINGS'][TRAX_MODE]['username'] 
     566                . Trax::$database_settings[TRAX_ENV]['username'] 
    580567                . "'\nDid you configure file " 
    581                 . TRAX_ROOT . $GLOBALS['TRAX_INCLUDES']['config'] 
     568                . Trax::$config_path 
    582569                . "/database.ini correctly?\n"; 
    583570            die(); 
     
    631618                 
    632619        # Generate the index.phtml view 
    633         $view_file = "$this->view_path/index.".$this->view_file_extention; 
     620        $view_file = "$this->view_path/index.".Trax::$views_extension; 
    634621        ob_start();     
    635622        include("$this->scaffold_template_path/view_index.phtml"); 
     
    647634                
    648635        # Generate the add.phtml view 
    649         $view_file = "$this->view_path/add.".$this->view_file_extention; 
     636        $view_file = "$this->view_path/add.".Trax::$views_extension; 
    650637        ob_start();     
    651638        include("$this->scaffold_template_path/view_add.phtml"); 
     
    663650         
    664651        # Generate the edit.phtml view 
    665         $view_file = "$this->view_path/edit.".$this->view_file_extention; 
     652        $view_file = "$this->view_path/edit.".Trax::$views_extension; 
    666653        ob_start();     
    667654        include("$this->scaffold_template_path/view_edit.phtml"); 
     
    679666         
    680667        # Generate the show.phtml view 
    681         $view_file = "$this->view_path/show.".$this->view_file_extention; 
     668        $view_file = "$this->view_path/show.".Trax::$views_extension; 
    682669        ob_start();     
    683670        include("$this->scaffold_template_path/view_show.phtml"); 
     
    695682                
    696683        # Generate the partial containing the form elments from the database 
    697         $view_file = "$this->view_path/_form.".$this->view_file_extention; 
     684        $view_file = "$this->view_path/_form.".Trax::$views_extension; 
    698685        ob_start();     
    699686        require "$this->scaffold_template_path/form_scaffolding.phtml"; 
     
    711698         
    712699        # Generate the layout for the scaffolding 
    713         $layout_file = $this->layouts_path."/" 
    714             . $this->layout_filename."." 
    715             . $this->view_file_extention; 
     700        $layout_file = $this->layouts_path."/".$this->layout_filename.".".Trax::$views_extension; 
    716701        if(!file_exists($this->layouts_path)) { 
    717702            mkdir($this->layouts_path);         
     
    839824     *  @uses controller_class        Must be set before call. 
    840825     *                                Not changed during call. 
    841      *  @uses view_file_extension     Must be set before call. 
    842      *                                Not changed during call. 
    843826     *  @uses view_path               Must be set before call. 
    844827     *                                Not changed during call. 
     
    848831     */ 
    849832    function create_view($view, $controller) { 
    850         $view_file = "$this->view_path/".$view.".".$this->view_file_extention; 
     833        $view_file = "$this->view_path/".$view.".".Trax::$views_extension; 
    851834        if(!file_exists($view_file)) { 
    852835            if(file_exists($this->view_template_file)) {