Changeset 1632

Show
Ignore:
Timestamp:
06/19/08 11:00:48 (3 months ago)
Author:
mikey
Message:

make multi-project structure default

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/projects/dist/config/php/config-dist.php

    r930 r1632  
    4141     */ 
    4242    private static $pagePath   = null; 
     43    /** 
     44     * path to common files 
     45     * 
     46     * @var  string 
     47     */ 
     48    private static $commonPath = null; 
    4349 
    4450    /** 
     
    5258    { 
    5359        if (null == self::$libPath) { 
    54             self::$libPath = realpath(dirname(__FILE__) . '/../../lib'); 
     60            self::$libPath = realpath(dirname(__FILE__) . '/../../../../lib'); 
    5561        } 
    5662         
     
    6874    { 
    6975        if (null == self::$sourcePath) { 
    70             self::$sourcePath = realpath(dirname(__FILE__) . '/../../src/main'); 
     76            self::$sourcePath = realpath(dirname(__FILE__) . '/../../../../src/main'); 
    7177        } 
    7278         
     
    139145 
    140146    /** 
     147     * this method should return the path to the common directory 
     148     * 
     149     * @return  string 
     150     */ 
     151    public static function getCommonPath() 
     152    { 
     153        if (null == self::$commonPath) { 
     154            self::$commonPath = realpath(dirname(__FILE__) . '/../../projects/common'); 
     155        } 
     156         
     157        return self::$commonPath; 
     158    } 
     159 
     160    /** 
    141161     * switch to use star files or not 
    142162     * 
  • trunk/projects/dist/config/php/config.php

    r930 r1632  
    4141     */ 
    4242    private static $pagePath   = null; 
     43    /** 
     44     * path to common files 
     45     * 
     46     * @var  string 
     47     */ 
     48    private static $commonPath = null; 
    4349 
    4450    /** 
     
    5258    { 
    5359        if (null == self::$libPath) { 
    54             self::$libPath = realpath(dirname(__FILE__) . '/../../lib'); 
     60            self::$libPath = realpath(dirname(__FILE__) . '/../../../../lib'); 
    5561        } 
    5662         
     
    6874    { 
    6975        if (null == self::$sourcePath) { 
    70             self::$sourcePath = realpath(dirname(__FILE__) . '/../../src/main'); 
     76            self::$sourcePath = realpath(dirname(__FILE__) . '/../../../../src/main'); 
    7177        } 
    7278         
     
    139145 
    140146    /** 
     147     * this method should return the path to the common directory 
     148     * 
     149     * @return  string 
     150     */ 
     151    public static function getCommonPath() 
     152    { 
     153        if (null == self::$commonPath) { 
     154            self::$commonPath = realpath(dirname(__FILE__) . '/../../projects/common'); 
     155        } 
     156         
     157        return self::$commonPath; 
     158    } 
     159 
     160    /** 
    141161     * switch to use star files or not 
    142162     * 
  • trunk/projects/examples/config/php/config.php

    r930 r1632  
    4242     */ 
    4343    private static $pagePath   = null; 
     44    /** 
     45     * path to common files 
     46     * 
     47     * @var  string 
     48     */ 
     49    private static $commonPath = null; 
    4450 
    4551    /** 
     
    5359    { 
    5460        if (null == self::$libPath) { 
    55             self::$libPath = realpath(dirname(__FILE__) . '/../../../lib'); 
     61            self::$libPath = realpath(dirname(__FILE__) . '/../../../../lib'); 
    5662        } 
    5763 
     
    6975    { 
    7076        if (null == self::$sourcePath) { 
    71             self::$sourcePath = realpath(dirname(__FILE__) . '/../../../src/main'); 
     77            self::$sourcePath = realpath(dirname(__FILE__) . '/../../../../src/main'); 
    7278        } 
    7379 
     
    140146 
    141147    /** 
     148     * this method should return the path to the common directory 
     149     * 
     150     * @return  string 
     151     */ 
     152    public static function getCommonPath() 
     153    { 
     154        if (null == self::$commonPath) { 
     155            self::$commonPath = realpath(dirname(__FILE__) . '/../../projects/common'); 
     156        } 
     157         
     158        return self::$commonPath; 
     159    } 
     160 
     161    /** 
    142162     * switch to use star files or not 
    143163     * 
  • trunk/src/main/php/net/stubbles/websites/processors/stubAbstractProcessorResolver.php

    r1447 r1632  
    4646         
    4747        $this->configure($processor); 
    48         $this->handlePageBasedProcessor($processor); 
    4948        return $processor; 
    5049    } 
     
    6867 
    6968    /** 
    70      * helper method to handle page based processors 
     69     * method to handle page based processors 
    7170     * 
    7271     * @param   stubProcessor  $processor 
     
    7473     * @throws  stubRuntimeException 
    7574     */ 
    76     protected function handlePageBasedProcessor(stubProcessor $processor) 
     75    public function selectPage(stubProcessor $processor) 
    7776    { 
    7877        if (($processor instanceof stubPageBasedProcessor) === false) { 
  • trunk/src/main/php/net/stubbles/websites/processors/stubProcessorResolver.php

    r1445 r1632  
    2929     */ 
    3030    public function resolve(stubRequest $request, stubSession $session, stubResponse $response); 
     31 
     32    /** 
     33     * method to handle page based processors 
     34     * 
     35     * @param   stubProcessor  $processor 
     36     * @throws  stubConfigurationException 
     37     * @throws  stubRuntimeException 
     38     */ 
     39    public function selectPage(stubProcessor $processor); 
    3140} 
    3241?> 
  • trunk/src/main/php/net/stubbles/websites/stubFrontController.php

    r1534 r1632  
    123123        $processorResolverFactory = $this->websiteInitializer->getProcessorResolverFactory(); 
    124124        $processorResolverFactory->init(); 
    125         $processor = $processorResolverFactory->getResolver()->resolve($this->request, $this->session, $this->response); 
    126         if ($processor->forceSSL() === true && $processor->isSSL() === false) { 
    127             $this->response->addHeader('Location', 'https://' . $this->request->getURI()); 
    128             $this->request->cancel(); 
    129             $this->response->send(); 
    130             return; 
    131         } 
    132          
     125        $resolver  = $processorResolverFactory->getResolver(); 
     126        $processor = $resolver->resolve($this->request, $this->session, $this->response); 
    133127        $interceptorInitializer = $this->websiteInitializer->getInterceptorInitializer(); 
    134128        $interceptorInitializer->setDescriptor($processor->getInterceptorDescriptor()); 
     
    140134                return; 
    141135            } 
     136        } 
     137         
     138        $resolver->selectPage($processor); 
     139        if ($processor->forceSSL() === true && $processor->isSSL() === false) { 
     140            $this->response->addHeader('Location', 'https://' . $this->request->getURI()); 
     141            $this->request->cancel(); 
     142            $this->response->send(); 
     143            return; 
    142144        } 
    143145