Changeset 930

Show
Ignore:
Timestamp:
09/20/07 21:48:24 (1 year ago)
Author:
mikey
Message:

moved page configuration files into their own "root" directory
added stubConfig::getPagePath()
Memphis view engine example now works again (but requires a version of patTemplate and patError in lib directory)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/stubbles/build.xml

    r878 r930  
    5757    <copy file="${project.basedir}/../../config/xml/variantmanager.xml" tofile="${build.src.dir}/config/xml/variantmanager-dist.xml" /> 
    5858 
    59     <mkdir dir="${build.src.dir}/config/xml/pages" /> 
    60     <mkdir dir="${build.src.dir}/config/xml/pages/conf" /> 
    61     <mkdir dir="${build.src.dir}/config/xml/pages/skin" /> 
    62     <copy file="${project.basedir}/../../config/xml/pages/skin/default.xml" tofile="${build.src.dir}/config/xml/pages/skin/default-dist.xml" /> 
    63     <mkdir dir="${build.src.dir}/config/xml/pages/txt" /> 
     59    <mkdir dir="${build.src.dir}/pages" /> 
     60    <mkdir dir="${build.src.dir}/pages/conf" /> 
     61    <mkdir dir="${build.src.dir}/pages/skin" /> 
     62    <copy file="${project.basedir}/../../pages/skin/default.xml" tofile="${build.src.dir}/pages/skin/default-dist.xml" /> 
     63    <mkdir dir="${build.src.dir}/pages/txt" /> 
    6464 
    6565    <mkdir dir="${build.src.dir}/docroot" /> 
  • trunk/config/php/config-dist.php

    r628 r930  
    3535     */ 
    3636    private static $configPath = null; 
     37    /** 
     38     * path to page files 
     39     * 
     40     * @var  string 
     41     */ 
     42    private static $pagePath   = null; 
    3743 
    3844    /** 
     
    117123 
    118124    /** 
     125     * this method should return the path to the pages directory 
     126     * 
     127     * By default its /path/to/stubbles/pages. 
     128     * 
     129     * @return  string 
     130     */ 
     131    public static function getPagePath() 
     132    { 
     133        if (null == self::$pagePath) { 
     134            self::$pagePath = realpath(dirname(__FILE__) . '/../../pages'); 
     135        } 
     136         
     137        return self::$pagePath; 
     138    } 
     139 
     140    /** 
    119141     * switch to use star files or not 
    120142     * 
  • trunk/config/php/config.php

    r613 r930  
    3535     */ 
    3636    private static $configPath = null; 
     37    /** 
     38     * path to page files 
     39     * 
     40     * @var  string 
     41     */ 
     42    private static $pagePath   = null; 
    3743 
    3844    /** 
     
    105111     * By default its /path/to/stubbles/config. 
    106112     * 
    107      * @return unknown 
     113     * @return string 
    108114     */ 
    109115    public static function getConfigPath() 
     
    114120         
    115121        return self::$configPath; 
     122    } 
     123 
     124    /** 
     125     * this method should return the path to the pages directory 
     126     * 
     127     * By default its /path/to/stubbles/pages. 
     128     * 
     129     * @return  string 
     130     */ 
     131    public static function getPagePath() 
     132    { 
     133        if (null == self::$pagePath) { 
     134            self::$pagePath = realpath(dirname(__FILE__) . '/../../pages'); 
     135        } 
     136         
     137        return self::$pagePath; 
    116138    } 
    117139 
  • trunk/examples/config/php/config-dist.php

    r836 r930  
    3636     */ 
    3737    private static $configPath = null; 
     38    /** 
     39     * path to page files 
     40     * 
     41     * @var  string 
     42     */ 
     43    private static $pagePath   = null; 
    3844 
    3945    /** 
     
    106112     * By default its /path/to/stubbles/config. 
    107113     * 
    108      * @return unknown 
     114     * @return string 
    109115     */ 
    110116    public static function getConfigPath() 
     
    115121 
    116122        return self::$configPath; 
     123    } 
     124 
     125    /** 
     126     * this method should return the path to the pages directory 
     127     * 
     128     * By default its /path/to/stubbles/pages. 
     129     * 
     130     * @return  string 
     131     */ 
     132    public static function getPagePath() 
     133    { 
     134        if (null == self::$pagePath) { 
     135            self::$pagePath = realpath(dirname(__FILE__) . '/../../pages'); 
     136        } 
     137         
     138        return self::$pagePath; 
    117139    } 
    118140 
  • trunk/examples/config/php/config.php

    r709 r930  
    3636     */ 
    3737    private static $configPath = null; 
     38    /** 
     39     * path to page files 
     40     * 
     41     * @var  string 
     42     */ 
     43    private static $pagePath   = null; 
    3844 
    3945    /** 
     
    106112     * By default its /path/to/stubbles/config. 
    107113     * 
    108      * @return unknown 
     114     * @return string 
    109115     */ 
    110116    public static function getConfigPath() 
     
    115121 
    116122        return self::$configPath; 
     123    } 
     124 
     125    /** 
     126     * this method should return the path to the pages directory 
     127     * 
     128     * By default its /path/to/stubbles/pages. 
     129     * 
     130     * @return  string 
     131     */ 
     132    public static function getPagePath() 
     133    { 
     134        if (null == self::$pagePath) { 
     135            self::$pagePath = realpath(dirname(__FILE__) . '/../../pages'); 
     136        } 
     137         
     138        return self::$pagePath; 
    117139    } 
    118140 
  • trunk/examples/pages/memphis/index.xml

    r803 r930  
    44    xmlns="http://stubbles.net/websites"> 
    55  <page> 
    6     <includeFile source="static/index.html" parts="content" /> 
     6    <includeFile source="index.html" parts="content" /> 
    77  </page> 
    88</xj:configuration> 
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisIncludeFilePageElement.php

    r888 r930  
    3737    public static function __static() 
    3838    { 
    39         self::$baseDir = stubRegistry::getConfig('net.stubbles.websites.memphis.templateDir', stubConfig::getLibPath() . '/../templates'); 
     39        self::$baseDir = stubRegistry::getConfig('net.stubbles.websites.memphis.templateDir', stubConfig::getPagePath() . '/../templates'); 
    4040    } 
    4141 
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisProcessor.php

    r924 r930  
    7171    protected function createTemplate() 
    7272    { 
    73         $template =  new stubMemphisTemplate(stubRegistry::getConfig('net.stubbles.websites.memphis.templateDir', stubConfig::getLibPath() . '/../templates')); 
     73        $template =  new stubMemphisTemplate(stubRegistry::getConfig('net.stubbles.websites.memphis.templateDir', stubConfig::getPagePath() . '/../templates')); 
    7474        if (stubRegistry::hasConfig('net.stubbles.mode') == true && stubRegistry::getConfig('net.stubbles.mode') != 'test') { 
    7575            $template->enableCache(); 
  • trunk/src/main/php/net/stubbles/websites/stubPageXJConfFactory.php

    r782 r930  
    4747    { 
    4848        $this->cachePath  = ((null == $cachePath) ? (stubConfig::getCachePath() . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'pages' . DIRECTORY_SEPARATOR) : ($cachePath)); 
    49         $this->configPath = ((null == $configPath) ? (stubConfig::getConfigPath() . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'pages' . DIRECTORY_SEPARATOR) : ($configPath)); 
     49        $this->configPath = ((null == $configPath) ? (stubConfig::getPagePath() . DIRECTORY_SEPARATOR) : ($configPath)); 
    5050    } 
    5151 
  • trunk/src/main/php/net/stubbles/websites/xml/stubXMLPostInterceptor.php

    r887 r930  
    3939    { 
    4040        stubXMLXIncludeStreamWrapper::register(); 
    41         stubXMLXIncludeStreamWrapper::setIncludePath(stubConfig::getConfigPath() . '/xml/pages/txt'); 
     41        stubXMLXIncludeStreamWrapper::setIncludePath(stubConfig::getPagePath() . '/txt'); 
    4242        stubXMLXIncludeStreamWrapper::setCachePath(stubConfig::getCachePath()); 
    4343    } 
     
    156156    protected function createXMLSkinDocument($skin) 
    157157    { 
    158         return DOMDocument::load(stubConfig::getConfigPath() . '/xml/pages/skin/' . $skin . '.xml'); 
     158        return DOMDocument::load(stubConfig::getPagePath() . '/skin/' . $skin . '.xml'); 
    159159    } 
    160160}