Re: cvs: pear /XML_Transformer package.xml /XML_Transformer/Transformer/Namespace PHP.php

From: Date: Mon, 29 Sep 2003 03:43:14 +0000
Subject: Re: cvs: pear /XML_Transformer package.xml /XML_Transformer/Transformer/Namespace PHP.php
References: 1  Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-13162@lists.php.net to get a copy of this message
Hi, Be forewarned that breaking BC casually will get you in big trouble - you'll first of all immediately need to bump the major version number of XML_Transformer to 3.0. Why not provide wrappers like so: function start_getparameter($attributes) {
    trigger_error("<php:getparameter/> is deprecated in favor of <php:get/>", E_USER_WARNING);
    return $this->start_get($attributes);
} Then you can break BC after users have had time to update things. HTML_QuickForm used this method quite successfully. Greg Kristian KöHntopp wrote:
kk Sun Sep 28 12:46:02 2003 EDT
  Modified files:                  /pear/XML_Transformer	package.xml     /pear/XML_Transformer/Transformer/Namespace	PHP.php   Log:
    Tags renamed within the php namespace. Happily breaking compat, right now.
      Index: pear/XML_Transformer/package.xml
diff -u pear/XML_Transformer/package.xml:1.73 pear/XML_Transformer/package.xml:1.74 --- pear/XML_Transformer/package.xml:1.73 Sun Sep 28 11:54:20 2003 +++ pear/XML_Transformer/package.xml Sun Sep 28 12:46:01 2003 @@ -29,6 +29,16 @@
     <date>200Y-MM-DD</date>
     <notes>
<![CDATA[ +* Variable access tags in the php namespace have been + renamed. Tag names such as <php:getparameter/> are + hard to type, and have been used inconsistently + as weel (<php:getparameter/>, but <php:cookievariable/>). + + We break compatibility NOW and provide NO backward + compatibility interface (you can trivially write your + own, if you absolutely need it) in order to encourage + to use the new names and speed up migration. + * XML fragments are now handled more gracefully. It is now possible, for instance, to return Index: pear/XML_Transformer/Transformer/Namespace/PHP.php diff -u pear/XML_Transformer/Transformer/Namespace/PHP.php:1.11 pear/XML_Transformer/Transformer/Namespace/PHP.php:1.12 --- pear/XML_Transformer/Transformer/Namespace/PHP.php:1.11 Sat Jan 18 13:01:24 2003 +++ pear/XML_Transformer/Transformer/Namespace/PHP.php Sun Sep 28 12:46:02 2003 @@ -13,7 +13,7 @@
 // | license@php.net so we can mail you a copy immediately.                    |
// +---------------------------------------------------------------------------+ // -// $Id: PHP.php,v 1.11 2003/01/18 18:01:24 sebastian Exp $ +// $Id: PHP.php,v 1.12 2003/09/28 16:46:02 kk Exp $ // require_once 'XML/Transformer/Namespace.php'; @@ -56,7 +56,7 @@ * * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @author Kristian Köhntopp <kris@koehntopp.de> -* @version $Revision: 1.11 $ +* @version $Revision: 1.12 $ * @access public */ class XML_Transformer_Namespace_PHP extends XML_Transformer_Namespace { @@ -258,103 +258,125 @@
     }
      // }}}
-    // {{{ function start_getparameter($attributes)
+    // {{{ function start_get($attributes)
      /**
     * @param  array
     * @return string
     * @access public
     */
-    function start_getparameter($attributes) {
+    function start_get($attributes) {
         return isset($_GET[$attributes['name']]) ? $_GET[$attributes['name']] : '';
     }
      // }}}
-    // {{{ function end_getparameter($cdata)
+    // {{{ function end_get($cdata)
      /**
     * @param  string
     * @return string
     * @access public
     */
-    function end_getparameter($cdata) {
+    function end_get($cdata) {
         return $cdata;
     }
      // }}}
-    // {{{ function start_postparameter($attributes)
+    // {{{ function start_post($attributes)
      /**
     * @param  array
     * @return string
     * @access public
     */
-    function start_postparameter($attributes) {
+    function start_post($attributes) {
         return isset($_POST[$attributes['name']]) ? $_POST[$attributes['name']] : '';
     }
      // }}}
-    // {{{ function end_postparameter($cdata)
+    // {{{ function end_post($cdata)
      /**
     * @param  string
     * @return string
     * @access public
     */
-    function end_postparameter($cdata) {
+    function end_post($cdata) {
         return $cdata;
     }
      // }}}
-    // {{{ function start_cookievariable($attributes)
+    // {{{ function start_cookie($attributes)
      /**
     * @param  array
     * @return string
     * @access public
     */
-    function start_cookievariable($attributes) {
+    function start_cookie($attributes) {
         return isset($_COOKIE[$attributes['name']]) ? $_COOKIE[$attributes['name']] : '';
     }
      // }}}
-    // {{{ function end_cookievariable($cdata)
+    // {{{ function end_cookie($cdata)
      /**
     * @param  string
     * @return string
     * @access public
     */
-    function end_cookievariable($cdata) {
+    function end_cookie($cdata) {
         return $cdata;
     }
      // }}}
-    // {{{ function start_servervariable($attributes)
+    // {{{ function start_request($attributes)
      /**
     * @param  array
     * @return string
     * @access public
     */
-    function start_servervariable($attributes) {
+    function start_request($attributes) {
+        return isset($_REQUEST[$attributes['name']]) ? $_REQUEST[$attributes['name']] : '';
+    }
+
+    // }}}
+    // {{{ function end_request($cdata)
+
+    /**
+    * @param  string
+    * @return string
+    * @access public
+    */
+    function end_request($cdata) {
+        return $cdata;
+    }
+    // {{{ function start_server($attributes)
+
+    /**
+    * @param  array
+    * @return string
+    * @access public
+    */
+    function start_server($attributes) {
         return isset($_SERVER[$attributes['name']]) ? $_SERVER[$attributes['name']] : '';
     }
      // }}}
-    // {{{ function end_servervariable($cdata)
+    // {{{ function end_server($cdata)
      /**
     * @param  string
     * @return string
     * @access public
     */
-    function end_servervariable($cdata) {
+    function end_server($cdata) {
         return $cdata;
     }
      // }}}
-    // {{{ function start_sessionvariable($attributes)
+    // {{{ function start_session($attributes)
      /**
     * @param  array
@@ -373,31 +395,31 @@
     * @return string
     * @access public
     */
-    function end_sessionvariable($cdata) {
+    function end_session($cdata) {
         return $cdata;
     }
      // }}}
-    // {{{ function start_getvariable($attributes)
+    // {{{ function start_variable($attributes)
      /**
     * @param  array
     * @return string
     * @access public
     */
-    function start_getvariable($attributes) {
+    function start_variable($attributes) {
         return isset($GLOBALS[$attributes['name']]) ? $GLOBALS[$attributes['name']] : '';
     }
      // }}}
-    // {{{ function end_getvariable($cdata)
+    // {{{ function end_variable($cdata)
      /**
     * @param  string
     * @return string
     * @access public
     */
-    function end_getvariable($cdata) {
+    function end_variable($cdata) {
         return $cdata;
     }
 


« previous php.pear.cvs (#13162) next »