Changeset 1444

Show
Ignore:
Timestamp:
09/23/2006 09:20:54 PM (2 years ago)
Author:
xue
Message:

Merge from 3.0 branch till 1443.

Location:
trunk
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • trunk/HISTORY

    r1438 r1444  
    1717ENH: Ticket#361 - Introduced include template tag that supports including external templates (Qiang) 
    1818ENH: Ticket#366 - white spaces are now allowed around attribute names in template (Qiang) 
    19 ENH: Added an interactive PHP shell, usage: "prado-cli.php shell" (Wei) 
     19ENH: Ticket#378 - PRADO applications can now run in command line (Qiang) 
    2020ENH: Ticket#379 - TAuthorizationRule performance enhancement (Qiang) 
    2121ENH: Easier to customize the TDatePicker using CssClass (Wei) 
     22ENH: Added an interactive PHP shell, usage: "prado-cli.php shell" (Wei) 
    2223NEW: TLiteralColumn (Qiang) 
    23 NSW: TUrlMapping (Wei) 
     24NEW: TUrlMapping (Wei) 
    2425 
    2526Version 3.0.4 September 4, 2006 
  • trunk/demos/blog/protected/application.xml

    r1436 r1444  
    1616    </module> 
    1717    <module class="System.Util.TParameterModule" ParameterFile="Application.Data.Settings" /> 
     18 
     19    <!-- use TUrlMapping to map URL patterns to particular requests --> 
    1820    <module id="friendly-url" class="System.Web.TUrlMapping"> 
    19       <url pageClass="Posts.ViewPost" pattern="post/{id}/?" parameters.id="\d+" /> 
    20       <url pageClass="Posts.ListPost" pattern="archive/{time}/?" parameters.time="\d{6}" /> 
    21       <url pageClass="Posts.ListPost" pattern="category/{cat}/?" parameters.cat="\d+" /> 
     21      <url ServiceParameter="Posts.ViewPost" pattern="post/{id}/?" parameters.id="\d+" /> 
     22      <url ServiceParameter="Posts.ListPost" pattern="archive/{time}/?" parameters.time="\d{6}" /> 
     23      <url ServiceParameter="Posts.ListPost" pattern="category/{cat}/?" parameters.cat="\d+" /> 
    2224    </module> 
    2325  </modules> 
  • trunk/demos/quickstart/protected/pages/Advanced/I18N.page

    r1398 r1444  
    4141    <translation type="XLIFF" 
    4242        source="MyApp.messages" 
     43        marker="@@" 
    4344        autosave="true" cache="true" /> 
    4445</module> 
     
    4950attribute if enabled, saves untranslated messages back into the message catalogue. 
    5051With <tt>cache</tt> enabled, translated messages are saved in the application <tt>runtime/i18n</tt> directory. 
     52The <tt>marker</tt> value is used to surround any untranslated text. 
    5153</p> 
    5254 
  • trunk/demos/quickstart/protected/pages/Configurations/UrlMapping.page

    r1436 r1444  
    2121<com:TTextHighlighter Language="xml" CssClass="source"> 
    2222<module id="friendly-url" class="System.Web.TUrlMapping"> 
    23   <url pageClass="ClassName" pattern="regexp" parameters.id="regexp" /> 
     23  <url serviceParameter="ClassName" pattern="regexp" parameters.id="regexp" /> 
    2424</module> 
    2525</com:TTextHighlighter> 
    2626</p> 
    2727 
    28 <p>The <tt>PageClass</tt> set the name of class that the matched URL will 
    29 be requested.</p> The <tt>Pattern</tt> and <tt>Parameters</tt> attribute 
     28<p>The <tt>ServiceParameter</tt> and <tt>ServiceID</tt> 
     29 (the default ID is 'page') set the service parameter and service ID respectively. 
     30 The service parameter for the <tt>TPageService</tt> service is the 
     31 Page class name, e.g., for an URL "index.php?page=Home", "page" is the service ID and the service 
     32 parameter is "Home". Other services may use the service parameter and ID differently. 
     33See <a href="?page=Fundamentals.Services">Services</a> for further details. 
     34</p> 
     35 
     36<p> 
     37The <tt>Pattern</tt> and <tt>Parameters</tt> attribute 
    3038values are regular expression patterns that 
    3139determine the mapping criteria. The <tt>Pattern</tt> property takes 
     
    3543For example, 
    3644<com:TTextHighlighter Language="xml" CssClass="source"> 
    37 <url pageClass="Pages.ShowArticles" pattern="articles/{year}/{month}/{day}" 
     45<url ServiceParameter="Pages.ShowArticles" pattern="articles/{year}/{month}/{day}" 
    3846     parameters.year="\d{4}" parameters.month="\d{2}" parameters.day="\d+" /> 
    3947</com:TTextHighlighter> 
     
    4149The example is equivalent, using regular expression only, to 
    4250<com:TTextHighlighter Language="xml" CssClass="source"> 
    43 <url pageClass="Pages.ShowArticles"> 
     51<url ServiceParmaeter="Pages.ShowArticles"> 
    4452<![CDATA[ 
    4553        articles/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d+) 
  • trunk/framework/I18N/TGlobalization.php

    r1398 r1444  
    9494        public function setDefaultCulture($culture) 
    9595        { 
    96                 $this->_defaultCharset = str_replace('-','_',$culture); 
     96                $this->_defaultCulture = str_replace('-','_',$culture); 
    9797        } 
    9898 
     
    161161         * $config['autosave'] = 'true'; //save untranslated message 
    162162         * $config['cache'] = 'true'; //cache translated message 
     163         * $config['marker'] = '@@'; // surround untranslated text with '@@' 
    163164         * </code> 
    164165         * Throws exception is source is not found. 
     
    177178                                        throw new TConfigurationException('globalization_source_path_failed', 
    178179                                                $config['source']); 
    179                                         chmod($config['source'], 0777); //make it deletable                                                                      
     180                                        chmod($config['source'], 0777); //make it deletable 
    180181                                } 
    181182                        } 
     
    193194                                        throw new TConfigurationException('globalization_cache_path_failed', 
    194195                                                $config['cache']); 
    195                                 chmod($config['cache'], 0777); //make it deletable                               
     196                                chmod($config['cache'], 0777); //make it deletable 
    196197                        } 
    197198                } 
  • trunk/framework/I18N/Translation.php

    r1398 r1444  
    5555                        self::$formatter = new MessageFormat($source, $app->getCharset()); 
    5656 
     57                        //mark untranslated text 
     58                        if($ps=$config['marker']) 
     59                                self::$formatter->setUntranslatedPS(array($ps,$ps)); 
     60 
    5761                        //save the message on end request 
    5862                        Prado::getApplication()->attachEventHandler( 
  • trunk/framework/Web/THttpRequest.php

    r1436 r1444  
    597597        } 
    598598 
     599        protected function getRequestResolved() 
     600        { 
     601                return $this->_requestResolved; 
     602        } 
     603 
    599604        /** 
    600605         * @return array IDs of the available services 
  • trunk/framework/Web/TUrlMapping.php

    • Property svn:keywords set to Id
    r1436 r1444  
    2222 * <code> 
    2323 *  <module id="friendly-url" class="System.Web.TUrlMapping"> 
    24  *    <url pageClass="Posts.ViewPost" pattern="post/{id}/?" parameters.id="\d+" /> 
    25  *    <url pageClass="Posts.ListPost" pattern="archive/{time}/?" parameters.time="\d{6}" /> 
    26  *    <url pageClass="Posts.ListPost" pattern="category/{cat}/?" parameters.cat="\d+" /> 
     24 *    <url ServiceParameter="Posts.ViewPost" pattern="post/{id}/?" parameters.id="\d+" /> 
     25 *    <url ServiceParameter="Posts.ListPost" pattern="archive/{time}/?" parameters.time="\d{6}" /> 
     26 *    <url ServiceParameter="Posts.ListPost" pattern="category/{cat}/?" parameters.cat="\d+" /> 
    2727 *  </module> 
    2828 * </code> 
     
    190190                $request = $this->getRequest(); 
    191191                $id = $pattern->getServiceID(); 
    192                 $page = $pattern->getPageClass(); 
     192                $param = $pattern->getServiceParameter(); 
    193193                $request->setServiceID($id); 
    194                 $request->setServiceParameter($page); 
    195                 $request->add($id,$page); 
     194                $request->setServiceParameter($param); 
     195                $request->add($id,$param); 
    196196        } 
    197197} 
     
    228228 * object. For example, <tt>$this->Request['year']</tt>. 
    229229 * 
    230  * The {@link setPageClass PageClass} and {@link setServiceID ServiceID} 
    231  * (the default ID is 'page') set the class and the service that will 
    232  * handle the matching URL. 
     230 * The {@link setServiceParameter ServiceParameter} and {@link setServiceID ServiceID} 
     231 * (the default ID is 'page') set the service parameter and service id respectively. 
     232 * The service parameter for the TPageService is the Page class name, other service 
     233 * may use the service parameter differently. 
    233234 * 
    234235 * For more complicated mappings, the body of the <tt>&lt;url&gt;</tt> 
     
    243244{ 
    244245        /** 
    245          * @var string page class name. 
    246          */ 
    247         private $_pageClass; 
     246         * @var string service parameter such as Page class name. 
     247         */ 
     248        private $_serviceParameter; 
    248249        /** 
    249250         * @var string service ID, default is 'page'. 
     
    278279                if(strlen($body)>0) 
    279280                        $this->setPattern($body); 
    280                 if(is_null($this->_pageClass)) 
     281                if(is_null($this->_serviceParameter)) 
    281282                { 
    282283                        throw new TConfigurationException( 
    283                                 'dispatcher_url_page_class_missing', $this->getPattern()); 
     284                                'dispatcher_url_service_parameter_missing', $this->getPattern()); 
    284285                } 
    285286                $this->initializePattern(); 
     
    311312 
    312313        /** 
    313          * @param string name of the page class to handle the request. 
    314          */ 
    315         public function setPageClass($value) 
    316         { 
    317                 $this->_pageClass=$value; 
    318         } 
    319  
    320         /** 
    321          * @return string page class name. 
    322          */ 
    323         public function getPageClass() 
    324         { 
    325                 return $this->_pageClass; 
     314         * @param string service parameter, such as page class name. 
     315         */ 
     316        public function setServiceParameter($value) 
     317        { 
     318                $this->_serviceParameter=$value; 
     319        } 
     320 
     321        /** 
     322         * @return string service parameter, such as page class name. 
     323         */ 
     324        public function getServiceParameter() 
     325        { 
     326                return $this->_serviceParameter; 
    326327        } 
    327328 
  • trunk/requirements/index.php

    r1398 r1444  
    5555                '$_SERVER["PATH_INFO"] check', 
    5656                'PATH_INFO required'), 
     57        array( 
     58                true, 
     59                class_exists('Reflection',false), 
     60                'Reflection extension check', 
     61                'Reflection extension required'), 
    5762        array( 
    5863                true, 
  • trunk/requirements/messages-bg.txt

    r1398 r1444  
    1212Zlib extension check                    = Проверка за Zlib 
    1313Zlib extension optional                 = Zlib разширението е незадължително. Ако не е заредено, състоянието на страницата няма да бъде компресирано и размера на страницата може да се увеличи. 
     14Reflection extension check                      = Проверка за Reflection разширението 
     15Reflection extension required                   = Reflection разширението е задължително за PRADO. 
    1416DOM extension check                     = Проверка за DOM разширението 
    1517DOM extension required                  = DOM разширението е задължително за PRADO. Използва се в TXmlDocument за анализ на XML-базирани конфигурации. 
  • trunk/requirements/messages-zh.txt

    r1398 r1444  
    1212Zlib extension check = Zlib模块检查 
    1313Zlib extension optional = Zlib模块是可选的。如果它不存在,页面的状态信息将无法压缩,由此可能导致您的页面传送数据量增大。 
     14Reflection extension check = Reflection模块检查 
     15Reflection extension required = Reflection模块是必须的。如果它不存在,PRADO将无法验证控件模板的正确性。 
    1416DOM extension check = DOM模块检查 
    1517DOM extension required = DOM模块是必须的。如果它不存在,基于XML的各种配置文件将无法解析。 
  • trunk/requirements/messages.txt

    r1398 r1444  
    1212Zlib extension check                            = Zlib extension check 
    1313Zlib extension optional                         = Zlib extension is optional. If it is absent, page state will not be compressed and your page size may increase. 
     14Reflection extension check                      = Reflection extension check 
     15Reflection extension required           = Reflection extension is required by PRADO. It is used in by PRADO to check the validity of page templates. 
    1416DOM extension check                                     = DOM extension check 
    1517DOM extension required                          = DOM extension is required by PRADO. It is used in TXmlDocument to parse all sorts of XML-based configurations.