Changeset 219

Show
Ignore:
Timestamp:
02/06/07 10:22:08 (2 years ago)
Author:
mikey
Message:

net.stubbles.stubFactory now works within star version of stubbles

Files:

Legend:

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

    r214 r219  
    1111                   '/_test/', 
    1212                   '/stubClassLoader/', 
    13                    '/website/', 
    1413                   '/todo/' 
    1514             ); 
     
    4140     
    4241    $pos = strpos($file->getPathname(), $srcDir) + strlen($srcDir); 
    43     $id  = substr($file->getPathname(), $pos); 
     42    $id  = str_replace(DIRECTORY_SEPARATOR, '/', substr($file->getPathname(), $pos)); 
    4443    echo 'Adding ' . $id . "\n"; 
    4544    $starArchive->add(new StarFile($file->getPathname()), $id); 
  • trunk/docroot/logging.php

    r147 r219  
    11<?php 
    22require '../config/php/config.php'; 
    3 require '../lib/starReader.php'; 
    4 require '../src/main/php/net/stubbles/stubClassLoader.php'; 
     3require '../lib/stubbles.php'; 
    54stubClassLoader::load('net.stubbles.util.log.stubLoggerXJConfFactory'); 
    65class Bootstrap 
  • trunk/src/main/php/net/stubbles/ipo/request/stubXmlRequestValueErrorFactory.php

    r150 r219  
    5050    { 
    5151        if (null == $source) { 
    52             $source = stubFactory::getResourcePath() . '/ipo/request.xml'
     52            $source = stubFactory::getResourceURI('ipo/request.xml')
    5353        } 
    5454         
     
    7070        if (count($this->initDone) == 0) { 
    7171            $tagParser = new DefinitionParser(); 
    72             $defs      = $tagParser->parse(stubFactory::getResourcePath() . '/xjconf/request.xml'); 
     72            $defs      = $tagParser->parse(stubFactory::getResourceURI('xjconf/request.xml')); 
    7373            $this->xmlParser = new XmlParser(); 
    7474            $this->xmlParser->setTagDefinitions($defs); 
  • trunk/src/main/php/net/stubbles/stubFactory.php

    r97 r219  
    1515{ 
    1616    /** 
    17      * path to resource files 
     17     * uri to resource files 
    1818     * 
    1919     * @var  string 
    2020     */ 
    21     private static $resourcePath = null; 
     21    private static $resourceURI = null; 
    2222     
    2323    /** 
    2424     * return the path to the resource files 
    2525     * 
    26      * @return  string 
     26     * @param   string  $fileName  the resource to load 
    2727     */ 
    28     public static function getResourcePath(
     28    public static function getResourceURI($fileName
    2929    { 
    30         if (null == self::$resourcePath) { 
    31             self::$resourcePath = realpath(dirname(__FILE__) . '/../../../resources'); 
     30        if (null == self::$resourceURI) { 
     31            if (substr(__FILE__, 0, 7) == 'star://') { 
     32                self::$resourceURI = str_replace('net.stubbles.stubFactory', '', __FILE__); 
     33            } else { 
     34                self::$resourceURI = realpath(dirname(__FILE__) . '/../../../resources/'); 
     35            } 
    3236        } 
    3337         
    34         return self::$resourcePath
     38        return (self::$resourceURI . $fileName)
    3539    } 
    3640} 
  • trunk/src/main/php/net/stubbles/util/log/stubLoggerXJConfFactory.php

    r171 r219  
    3333    { 
    3434        $tagParser = new DefinitionParser(array('http://stubbles.net/util/log' => stubXJConfLoader::getInstance())); 
    35         $defs      = $tagParser->parse(stubFactory::getResourcePath() . '/xjconf/logging.xml'); 
     35        $defs      = $tagParser->parse(stubFactory::getResourceURI('xjconf/logging.xml')); 
    3636        $xmlParser = new XmlParser(); 
    3737        $configExtension = new stubConfigXJConfExtension(); 
  • trunk/src/main/php/net/stubbles/util/stubRegistryFactory.php

    r152 r219  
    2525    { 
    2626        $tagParser = new DefinitionParser(array('http://stubbles.net/util/registry' => stubXJConfLoader::getInstance())); 
    27         $defs      = $tagParser->parse(stubFactory::getResourcePath() . '/xjconf/registry.xml'); 
     27        $defs      = $tagParser->parse(stubFactory::getResourceURI('xjconf/registry.xml')); 
    2828        $xmlParser = new XmlParser(); 
    2929        $xmlParser->setTagDefinitions($defs); 
  • trunk/src/main/php/net/stubbles/websites/PageFactory.php

    r150 r219  
    3939        if (null == self::$xmlParser) { 
    4040            $tagParser = new DefinitionParser(array('http://stubbles.net/pages' => $classLoader)); 
    41             $defs      = $tagParser->parse(stubFactory::getResourcePath() . '/xjconf/pages.xml'); 
     41            $defs      = $tagParser->parse(stubFactory::getResourceURI('xjconf/pages.xml')); 
    4242             
    4343            self::$xmlParser = new XmlParser();