From: <var...@us...> - 2008-10-15 08:07:54
|
Revision: 6302 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6302&view=rev Author: vargenau Date: 2008-10-15 08:07:42 +0000 (Wed, 15 Oct 2008) Log Message: ----------- Added asString function to avoid warning notice about cast from object to string Modified Paths: -------------- trunk/lib/XmlElement.php Modified: trunk/lib/XmlElement.php =================================================================== --- trunk/lib/XmlElement.php 2008-10-14 16:12:00 UTC (rev 6301) +++ trunk/lib/XmlElement.php 2008-10-15 08:07:42 UTC (rev 6302) @@ -455,6 +455,10 @@ function asXML () { return $this->_xml; } + + function asString () { + return $this->_xml; + } function isEmpty () { return empty($this->_xml); @@ -633,7 +637,6 @@ return (string) $val; } - function fmt ($fs /* , ... */) { $s = new FormattedText(false); @@ -643,55 +646,6 @@ return $s; } -// $Log: not supported by cvs2svn $ -// Revision 1.44 2008/03/17 19:40:18 rurban -// print printXML(array) deprecation warnings -// -// Revision 1.43 2007/07/14 17:55:30 rurban -// SemanticWeb.php -// -// Revision 1.42 2007/01/20 11:41:30 rurban -// Add php-5.2.0 note -// -// Revision 1.41 2007/01/13 23:34:49 rurban -// More php-5.2.0 fixes __toString -// -// Revision 1.40 2007/01/13 23:28:56 rurban -// php-5.2.0 fix for string fallback: Provide the magic method __toString -// -// Revision 1.39 2006/08/15 13:36:23 rurban -// support iso-8859-2 -// -// Revision 1.38 2005/10/10 19:36:09 rurban -// fix comment -// -// Revision 1.37 2005/01/25 07:04:27 rurban -// case-sensitive for php5 -// -// Revision 1.36 2004/12/06 19:49:56 rurban -// enable action=remove which is undoable and seeable in RecentChanges: ADODB ony for now. -// renamed delete_page to purge_page. -// enable action=edit&version=-1 to force creation of a new version. -// added BABYCART_PATH config -// fixed magiqc in adodb.inc.php -// and some more docs -// -// Revision 1.35 2004/11/21 11:59:18 rurban -// remove final \n to be ob_cache independent -// -// Revision 1.34 2004/10/12 13:13:19 rurban -// php5 compatibility (5.0.1 ok) -// -// Revision 1.33 2004/07/02 09:55:58 rurban -// more stability fixes: new DISABLE_GETIMAGESIZE if your php crashes when loading LinkIcons: failing getimagesize in old phps; blockparser stabilized -// -// Revision 1.32 2004/06/20 15:30:05 rurban -// get_class case-sensitivity issues -// -// Revision 1.31 2004/06/20 14:42:54 rurban -// various php5 fixes (still broken at blockparser) -// - // (c-file-style: "gnu") // Local Variables: // mode: php This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2009-08-24 12:29:54
|
Revision: 7085 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7085&view=rev Author: rurban Date: 2009-08-24 12:29:44 +0000 (Mon, 24 Aug 2009) Log Message: ----------- easy debugging Modified Paths: -------------- trunk/lib/XmlElement.php Modified: trunk/lib/XmlElement.php =================================================================== --- trunk/lib/XmlElement.php 2009-08-24 12:29:06 UTC (rev 7084) +++ trunk/lib/XmlElement.php 2009-08-24 12:29:44 UTC (rev 7085) @@ -191,10 +191,11 @@ function _quote ($string) { if (!$string) return $string; - if (check_php_version(4,1) and isset($GLOBALS['charset'])) + if (check_php_version(4,1) and isset($GLOBALS['charset'])) { return htmlspecialchars($string, ENT_COMPAT, $GLOBALS['charset']); - else + } else { return htmlspecialchars($string); + } } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2010-01-22 13:53:53
|
Revision: 7284 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7284&view=rev Author: vargenau Date: 2010-01-22 13:52:52 +0000 (Fri, 22 Jan 2010) Log Message: ----------- Verify that a parameter is an object before attempting to get his class (for PHP 5 migration) Modified Paths: -------------- trunk/lib/XmlElement.php Modified: trunk/lib/XmlElement.php =================================================================== --- trunk/lib/XmlElement.php 2010-01-18 19:13:06 UTC (rev 7283) +++ trunk/lib/XmlElement.php 2010-01-22 13:52:52 UTC (rev 7284) @@ -40,7 +40,7 @@ } function _pushContent ($item) { - if (strtolower(get_class($item)) == 'xmlcontent') + if (is_object($item) && strtolower(get_class($item)) == 'xmlcontent') array_splice($this->_content, count($this->_content), 0, $item->_content); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ru...@us...> - 2010-06-07 12:11:19
|
Revision: 7478 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=7478&view=rev Author: rurban Date: 2010-06-07 12:11:13 +0000 (Mon, 07 Jun 2010) Log Message: ----------- we force 4.2 Modified Paths: -------------- trunk/lib/XmlElement.php Modified: trunk/lib/XmlElement.php =================================================================== --- trunk/lib/XmlElement.php 2010-06-07 12:10:14 UTC (rev 7477) +++ trunk/lib/XmlElement.php 2010-06-07 12:11:13 UTC (rev 7478) @@ -191,11 +191,7 @@ function _quote ($string) { if (!$string) return $string; - if (check_php_version(4,1) and isset($GLOBALS['charset'])) { - return htmlspecialchars($string, ENT_COMPAT, $GLOBALS['charset']); - } else { - return htmlspecialchars($string); - } + return htmlspecialchars($string, ENT_COMPAT, $GLOBALS['charset']); } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2012-12-06 18:02:32
|
Revision: 8615 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8615&view=rev Author: vargenau Date: 2012-12-06 17:51:18 +0000 (Thu, 06 Dec 2012) Log Message: ----------- Revert smart quotes Modified Paths: -------------- trunk/lib/XmlElement.php Modified: trunk/lib/XmlElement.php =================================================================== --- trunk/lib/XmlElement.php 2012-12-06 16:34:05 UTC (rev 8614) +++ trunk/lib/XmlElement.php 2012-12-06 17:51:18 UTC (rev 8615) @@ -514,7 +514,7 @@ // literal variable name substitution only to keep locale // strings uncluttered trigger_error(sprintf(_("Can't mix “%s” with “%s” type format strings"), - '%1\$s', “%s”), E_USER_WARNING); + '%1\$s', '%s'), E_USER_WARNING); $this->_fs = preg_replace('/(?<!%)%\d+\$/x', '%', $this->_fs); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2014-11-10 19:57:43
|
Revision: 9303 http://sourceforge.net/p/phpwiki/code/9303 Author: vargenau Date: 2014-11-10 19:57:33 +0000 (Mon, 10 Nov 2014) Log Message: ----------- Add class variables; PHP Doc Modified Paths: -------------- trunk/lib/XmlElement.php Modified: trunk/lib/XmlElement.php =================================================================== --- trunk/lib/XmlElement.php 2014-11-10 19:46:50 UTC (rev 9302) +++ trunk/lib/XmlElement.php 2014-11-10 19:57:33 UTC (rev 9303) @@ -16,7 +16,7 @@ */ class XmlContent { - function XmlContent( /* ... */) + function __construct( /* ... */) { $this->_content = array(); $this->_pushContent_array(func_get_args()); @@ -192,7 +192,7 @@ return true; } - function _quote($string) + static function _quote($string) { if (!$string) return $string; return htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); @@ -206,6 +206,11 @@ */ class XmlElement extends XmlContent { + public $_children; + public $_attr; + public $_tag; + public $_classes; + function __construct($tagname /* , $attr_or_content , ...*/) { parent::__construct(); @@ -490,6 +495,9 @@ class FormattedText { + public $_fs; + public $_args; + function FormattedText($fs /* , ... */) { if ($fs !== false) { @@ -561,10 +569,10 @@ } /** - * PHP5 compatibility - * Error[2048]: Non-static method XmlContent::_quote() should not be called statically * Note: There's lot of room for performance increase if the right charset variant can * be created on load-time. + * @param string $string + * @return string */ function XmlContent_quote($string) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2016-01-07 09:32:31
|
Revision: 9757 http://sourceforge.net/p/phpwiki/code/9757 Author: vargenau Date: 2016-01-07 09:32:29 +0000 (Thu, 07 Jan 2016) Log Message: ----------- Use __construct Modified Paths: -------------- trunk/lib/XmlElement.php Modified: trunk/lib/XmlElement.php =================================================================== --- trunk/lib/XmlElement.php 2016-01-07 09:26:41 UTC (rev 9756) +++ trunk/lib/XmlElement.php 2016-01-07 09:32:29 UTC (rev 9757) @@ -461,7 +461,7 @@ class RawXml { - function RawXml($xml_text) + function __construct($xml_text) { $this->_xml = $xml_text; } @@ -498,7 +498,7 @@ public $_fs; public $_args; - function FormattedText($fs /* , ... */) + function __construct($fs /* , ... */) { if ($fs !== false) { $this->_init(func_get_args()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2022-01-07 14:37:33
|
Revision: 10860 http://sourceforge.net/p/phpwiki/code/10860 Author: vargenau Date: 2022-01-07 14:37:32 +0000 (Fri, 07 Jan 2022) Log Message: ----------- Indent code Modified Paths: -------------- trunk/lib/XmlElement.php Modified: trunk/lib/XmlElement.php =================================================================== --- trunk/lib/XmlElement.php 2022-01-06 17:29:02 UTC (rev 10859) +++ trunk/lib/XmlElement.php 2022-01-07 14:37:32 UTC (rev 10860) @@ -53,7 +53,8 @@ if (func_num_args() > 1) $this->_pushContent_array(func_get_args()); elseif (is_array($arg)) - $this->_pushContent_array($arg); else + $this->_pushContent_array($arg); + else $this->_pushContent($arg); } @@ -81,7 +82,8 @@ if (func_num_args() > 1) $this->_unshiftContent_array(func_get_args()); elseif (is_array($arg)) - $this->_unshiftContent_array($arg); else + $this->_unshiftContent_array($arg); + else $this->_unshiftContent($arg); } @@ -121,8 +123,10 @@ if (method_exists($item, 'printXML')) $item->printXML(); elseif (method_exists($item, 'asXML')) - echo $item->asXML(); elseif (method_exists($item, 'asString')) - echo $this->_quote($item->asString()); else + echo $item->asXML(); + elseif (method_exists($item, 'asString')) + echo $this->_quote($item->asString()); + else printf("==Object(%s)==", get_class($item)); } elseif (is_array($item)) { // DEPRECATED: @@ -144,7 +148,8 @@ if (method_exists($item, 'asXML')) $xml .= $item->asXML(); elseif (method_exists($item, 'asString')) - $xml .= $this->_quote($item->asString()); else + $xml .= $this->_quote($item->asString()); + else $xml .= sprintf("==Object(%s)==", get_class($item)); } elseif (is_array($item)) { trigger_error("Passing arrays to ->asXML() is deprecated: (" . AsXML($item, true) . ")"); @@ -164,7 +169,8 @@ if (method_exists($item, 'asPDF')) $pdf .= $item->asPDF(); elseif (method_exists($item, 'asString')) - $pdf .= $this->_quote($item->asString()); else + $pdf .= $this->_quote($item->asString()); + else $pdf .= sprintf("==Object(%s)==", get_class($item)); } else $pdf .= $this->_quote((string)$item); @@ -615,7 +621,8 @@ elseif (method_exists($val, 'asXML')) { echo $val->asXML(); } elseif (method_exists($val, 'asString')) - echo XmlContent_quote($val->asString()); else + echo XmlContent_quote($val->asString()); + else printf("==Object(%s)==", get_class($val)); } elseif (is_array($val)) { // DEPRECATED: @@ -640,7 +647,8 @@ if (method_exists($val, 'asXML')) return $val->asXML(); elseif (method_exists($val, 'asString')) - return XmlContent_quote($val->asString()); else + return XmlContent_quote($val->asString()); + else return sprintf("==Object(%s)==", get_class($val)); } elseif (is_array($val)) { // DEPRECATED: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |