cvs: pear /XML_CSSML CSSML.php package.xml /XML_CSSML/CSSML libxslt.php xslt.php /XML_CSSML/XML_CSSML CSSML.php /XML_CSSML/docs example.php
| From: | bertrand GUGGER | Date: | Wed, 12 Oct 2005 12:38:14 +0000 |
| Subject: | cvs: pear /XML_CSSML CSSML.php package.xml /XML_CSSML/CSSML libxslt.php xslt.php /XML_CSSML/XML_CSSML CSSML.php /XML_CSSML/docs example.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35442@lists.php.net to get a copy of this message | ||
toggg Wed Oct 12 08:38:14 2005 EDT
Added files:
/pear/XML_CSSML/XML_CSSML CSSML.php
Modified files:
/pear/XML_CSSML CSSML.php package.xml
/pear/XML_CSSML/CSSML libxslt.php xslt.php
/pear/XML_CSSML/docs example.php
Log:
Corrected package.xml and added a dependency to php4
Created XML_CSSML/CSSML.php redirecting to the correct path
Check for extension existence at run-time
Refactored the example to give the right usage
http://cvs.php.net/diff.php/pear/XML_CSSML/CSSML.php?r1=1.7&r2=1.8&ty=u
Index: pear/XML_CSSML/CSSML.php
diff -u pear/XML_CSSML/CSSML.php:1.7 pear/XML_CSSML/CSSML.php:1.8
--- pear/XML_CSSML/CSSML.php:1.7 Fri Sep 30 04:43:22 2005
+++ pear/XML_CSSML/CSSML.php Wed Oct 12 08:38:12 2005
@@ -17,7 +17,7 @@
// | Authors: Dan Allen <dan@mojavelinux.com> |
// +----------------------------------------------------------------------+
-// $Id: CSSML.php,v 1.7 2005/09/30 08:43:22 dufuz Exp $
+// $Id: CSSML.php,v 1.8 2005/10/12 12:38:12 toggg Exp $
// }}}
// {{{ description
@@ -51,7 +51,7 @@
* @package PHP_Compat
* @link http://php.net/function.is_a
* @author Aidan Lister <aidan@php.net>
- * @version $Revision: 1.7 $
+ * @version $Revision: 1.8 $
* @since PHP 4.2.0
* @require PHP 4.0.0 (user_error) (is_subclass_of)
*/
@@ -145,12 +145,7 @@
*/
function XML_CSSML($in_driver, $in_CSSML = null, $in_type = 'string', $in_params =
null)
{
- if (version_compare(phpversion(), '5.0.0') == -1) {
- $this = $this->factory($in_driver, $in_CSSML, $in_type, $in_params);
- } else {
- // error handling for PHP5
- return PEAR::raiseError(null, XML_CSSML_ERROR, null, E_USER_WARNING, 'This does
not work on PHP 5 anymore, use the factory method instead', 'XML_CSSML_Error', true);
- }
+ $this = $this->factory($in_driver, $in_CSSML, $in_type, $in_params);
}
// }}}
http://cvs.php.net/diff.php/pear/XML_CSSML/package.xml?r1=1.9&r2=1.10&ty=u
Index: pear/XML_CSSML/package.xml
diff -u pear/XML_CSSML/package.xml:1.9 pear/XML_CSSML/package.xml:1.10
--- pear/XML_CSSML/package.xml:1.9 Tue Oct 11 01:40:12 2005
+++ pear/XML_CSSML/package.xml Wed Oct 12 08:38:12 2005
@@ -18,11 +18,14 @@
<license>PHP License</license>
<version>1.1.1</version>
<state>stable</state>
- <date>2005-12-31</date>
+ <date>2005-10-12</date>
<notes>
-Fixed Bug #830 Assignment to $this
+Fixed Bug #830 Assignment to $this, won't work in php5 so dependency added (toggg)
Fixed Bug #902 PEAR QA: improvement for get_class()-usage
Corrected package.xml (toggg)
+Created XML_CSSML/CSSML.php redirecting to the correct path (toggg)
+Check for extension existence at run-time (toggg)
+Refactored the example to give the right usage (toggg)
</notes>
</release>
<filelist>
@@ -40,7 +43,17 @@
<file role="php">example.php</file>
</dir>
</dir>
+ <dir name="/" baseinstalldir="/">
+ <dir name="XML_CSSML">
+ <file role="php">CSSML.php</file>
+ </dir>
+ </dir>
</filelist>
+
+ <deps>
+ <dep type="php" rel="lt" version="5.0.0" />
+ </deps>
+
<changelog>
<release>
<license>PHP License</license>
http://cvs.php.net/diff.php/pear/XML_CSSML/CSSML/libxslt.php?r1=1.5&r2=1.6&ty=u
Index: pear/XML_CSSML/CSSML/libxslt.php
diff -u pear/XML_CSSML/CSSML/libxslt.php:1.5 pear/XML_CSSML/CSSML/libxslt.php:1.6
--- pear/XML_CSSML/CSSML/libxslt.php:1.5 Fri Sep 30 04:48:53 2005
+++ pear/XML_CSSML/CSSML/libxslt.php Wed Oct 12 08:38:13 2005
@@ -17,7 +17,7 @@
// | Authors: Dan Allen <dan@mojavelinux.com> |
// +----------------------------------------------------------------------+
-// $Id: libxslt.php,v 1.5 2005/09/30 08:48:53 dufuz Exp $
+// $Id: libxslt.php,v 1.6 2005/10/12 12:38:13 toggg Exp $
// }}}
// {{{ description
@@ -47,6 +47,11 @@
function XML_CSSML_libxslt($in_CSSML = null, $in_type = 'string', $in_params = null)
{
+ if (!function_exists('domxml_version')) {
+ $this = PEAR::raiseError(null, XML_CSSML_ERROR, null, E_USER_ERROR,
+ 'This driver needs the domxml extension to run',
'XML_CSSML_Error', true);
+ return;
+ }
$this->loaded = false;
if (!is_null($in_CSSML)) {
$this->load($in_CSSML, $in_type);
http://cvs.php.net/diff.php/pear/XML_CSSML/CSSML/xslt.php?r1=1.3&r2=1.4&ty=u
Index: pear/XML_CSSML/CSSML/xslt.php
diff -u pear/XML_CSSML/CSSML/xslt.php:1.3 pear/XML_CSSML/CSSML/xslt.php:1.4
--- pear/XML_CSSML/CSSML/xslt.php:1.3 Fri Sep 30 04:43:26 2005
+++ pear/XML_CSSML/CSSML/xslt.php Wed Oct 12 08:38:13 2005
@@ -17,7 +17,7 @@
// | Authors: Dan Allen <dan@mojavelinux.com> |
// +----------------------------------------------------------------------+
-// $Id: xslt.php,v 1.3 2005/09/30 08:43:26 dufuz Exp $
+// $Id: xslt.php,v 1.4 2005/10/12 12:38:13 toggg Exp $
// }}}
// {{{ description
@@ -58,6 +58,11 @@
function XML_CSSML_xslt($in_CSSML = null, $in_type = 'string', $in_params = null)
{
+ if (!function_exists('xslt_create')) {
+ $this = PEAR::raiseError(null, XML_CSSML_ERROR, null, E_USER_ERROR,
+ 'This driver needs the xslt extension to run', 'XML_CSSML_Error',
true);
+ return;
+ }
$this->loaded = false;
if (!is_null($in_CSSML)) {
$this->load($in_CSSML, $in_type);
http://cvs.php.net/diff.php/pear/XML_CSSML/docs/example.php?r1=1.2&r2=1.3&ty=u
Index: pear/XML_CSSML/docs/example.php
diff -u pear/XML_CSSML/docs/example.php:1.2 pear/XML_CSSML/docs/example.php:1.3
--- pear/XML_CSSML/docs/example.php:1.2 Mon May 20 16:27:19 2002
+++ pear/XML_CSSML/docs/example.php Wed Oct 12 08:38:13 2005
@@ -1,14 +1,18 @@
<?php
-require_once '../CSSML.php';
+// CVS: $Id: example.php,v 1.3 2005/10/12 12:38:13 toggg Exp $
+require_once 'XML/CSSML.php';
error_reporting(E_ALL);
$cssml = '<cssml:CSSML xmlns:cssml="http://pear.php.net/cssml/1.0">
<style browserInclude="not(gecko)" filterInclude="admin">
<selector>p</selector>
- <declaration property="color">text</declaration>
+ <declaration property="color">blue</declaration>
</style>
</cssml:CSSML>';
-$cssml = new XML_CSSML('libxslt', $cssml, 'string', array('browser'
=> 'ns4', 'filter' => 'admin', 'comment' =>
'hello there!', 'output' => 'foo.css'));
-//print_r($cssml);
-//echo $cssml->process();
-$cssml->process();
+$cssml = & XML_CSSML::factory('libxslt', $cssml, 'string',
array('browser' => 'ns4', 'filter' => 'admin',
'comment' => 'hello there!', 'output' => 'foo.css'));
+if (PEAR::isError($cssml)) {
+ die($cssml->getMessage().' / '.$cssml->getUserInfo()."\n");
+}
+//var_dump($cssml);
+$OK = $cssml->process();
+//var_dump($OK);
?>
http://cvs.php.net/co.php/pear/XML_CSSML/XML_CSSML/CSSML.php?r=1.1&p=1
Index: pear/XML_CSSML/XML_CSSML/CSSML.php
+++ pear/XML_CSSML/XML_CSSML/CSSML.php
<?php
// vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
/**
* XML_CSSML: compatibility work around the wrong previous install dir
*
* PHP versions 4
*
* @category XML
* @package XML_CSSML
* @author Bertrand Gugger <bertrand@toggg.com>
* @copyright 2005 bertrand Gugger
* @license http://www.php.net/license/2_02.txt
* @version CVS: $Id: CSSML.php,v 1.1 2005/10/12 12:38:13 toggg Exp $
* @link http://pear.php.net/package/XML_CSSML
*/
/**
* include the right location
*/
require_once 'XML/CSSML.php';
?>