|
From: <var...@us...> - 2021-07-28 15:12:28
|
Revision: 10383
http://sourceforge.net/p/phpwiki/code/10383
Author: vargenau
Date: 2021-07-28 15:12:26 +0000 (Wed, 28 Jul 2021)
Log Message:
-----------
Use __construct
Modified Paths:
--------------
trunk/lib/XMLRPC/xmlrpc.inc
trunk/lib/XMLRPC/xmlrpc_emu.inc
trunk/lib/XMLRPC/xmlrpcs.inc
trunk/lib/XMLRPC/xmlrpcs_emu.inc
trunk/lib/XmlRpcServer.php
trunk/lib/pear/Cache/Application.php
trunk/lib/pear/Cache/Function.php
trunk/lib/pear/Cache/Graphics.php
trunk/lib/pear/Cache/HTTP_Request.php
trunk/lib/pear/Cache/OutputCompression.php
trunk/lib/pear/JSON.php
trunk/themes/blog/jscalendar/calendar.php
Modified: trunk/lib/XMLRPC/xmlrpc.inc
===================================================================
--- trunk/lib/XMLRPC/xmlrpc.inc 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/lib/XMLRPC/xmlrpc.inc 2021-07-28 15:12:26 UTC (rev 10383)
@@ -894,7 +894,7 @@
var $verifyhost = 1;
var $no_multicall = false;
- function xmlrpc_client($path, $server, $port = 0)
+ function __construct($path, $server, $port = 0)
{
$this->port = $port;
$this->server = $server;
@@ -1185,7 +1185,7 @@
var $errstr = '';
var $hdrs = array();
- function xmlrpcresp($val, $fcode = 0, $fstr = '')
+ function __construct($val, $fcode = 0, $fstr = '')
{
if ($fcode != 0) {
// error
@@ -1253,7 +1253,7 @@
var $params = array();
var $debug = 0;
- function xmlrpcmsg($meth, $pars = 0)
+ function __construct($meth, $pars = 0)
{
$this->methodname = $meth;
if (is_array($pars) && sizeof($pars) > 0) {
@@ -1532,7 +1532,7 @@
var $me = array();
var $mytype = 0;
- function xmlrpcval($val = -1, $type = '')
+ function __construct($val = -1, $type = '')
{
global $xmlrpcTypes;
$this->me = array();
Modified: trunk/lib/XMLRPC/xmlrpc_emu.inc
===================================================================
--- trunk/lib/XMLRPC/xmlrpc_emu.inc 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/lib/XMLRPC/xmlrpc_emu.inc 2021-07-28 15:12:26 UTC (rev 10383)
@@ -6,8 +6,8 @@
08/30/01 - last modified by Dan Libby <da...@li...>
This code provides API compatibility with Edd Dumbill's php xmlrpc
-library (http://phpxmlrpc.sourceforge.net/) but uses the xmlrpc-epi
-engine for the actual xml processing. It is intended to provide a
+library (http://phpxmlrpc.sourceforge.net/) but uses the xmlrpc-epi
+engine for the actual xml processing. It is intended to provide a
smooth transition path for those who would like to be able to use either
implementation.
@@ -161,8 +161,7 @@
var $username = "";
var $password = "";
- // constructor
- function xmlrpc_client($path, $server, $port = 80)
+ function __construct($path, $server, $port = 80)
{
$this->port = $port;
$this->server = $server;
@@ -229,8 +228,7 @@
var $fs;
var $hdrs;
- // constructor.
- function xmlrpcresp($val, $fcode = 0, $fstr = "")
+ function __construct($val, $fcode = 0, $fstr = "")
{
if ($fcode != 0) {
$this->fn = $fcode;
@@ -283,8 +281,7 @@
var $params = array();
var $debug = 0;
- // constructor
- function xmlrpcmsg($meth, $pars = 0)
+ function __construct($meth, $pars = 0)
{
$this->methodname = $meth;
if (is_array($pars) && sizeof($pars) > 0) {
@@ -385,8 +382,7 @@
var $me = array();
var $mytype = 0;
- // constructor
- function xmlrpcval($val = -1, $type = "")
+ function __construct($val = -1, $type = "")
{
global $xmlrpcTypes;
$this->me = array();
Modified: trunk/lib/XMLRPC/xmlrpcs.inc
===================================================================
--- trunk/lib/XMLRPC/xmlrpcs.inc 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/lib/XMLRPC/xmlrpcs.inc 2021-07-28 15:12:26 UTC (rev 10383)
@@ -225,7 +225,7 @@
{
var $dmap = array();
- function xmlrpc_server($dispMap = '', $serviceNow = 1)
+ function __construct($dispMap = '', $serviceNow = 1)
{
global $HTTP_RAW_POST_DATA;
// dispMap is a dispatch array of methods
Modified: trunk/lib/XMLRPC/xmlrpcs_emu.inc
===================================================================
--- trunk/lib/XMLRPC/xmlrpcs_emu.inc 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/lib/XMLRPC/xmlrpcs_emu.inc 2021-07-28 15:12:26 UTC (rev 10383)
@@ -6,8 +6,8 @@
08/30/01 - last modified by Dan Libby <da...@li...>
This code provides API compatibility with Edd Dumbill's php xmlrpc
-library (http://phpxmlrpc.sourceforge.net/) but uses the xmlrpc-epi
-engine for the actual xml processing. It is intended to provide a
+library (http://phpxmlrpc.sourceforge.net/) but uses the xmlrpc-epi
+engine for the actual xml processing. It is intended to provide a
smooth transition path for those who would like to be able to use either
implementation.
@@ -26,11 +26,11 @@
- xmlrpc_decode, xmlrpc_encode are present in both the xmlrpc-epi
C extension and the usefulinc implementation, and conflict.
They have been enhanced and renamed to val_to_php, php_to_val.
-
+
- the xmlrpc-epi engine uses different fault codes and strings than
the xmlrpc.inc. Application fault codes will remain unchanged
between implementations, but system codes will likely be
- different.
+ different.
See http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php
- Certain methods are not implemented and will typically return
@@ -50,7 +50,7 @@
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
@@ -126,7 +126,7 @@
var $xmlrpc_server;
// constructor. creates server and optionally services request.
- function xmlrpc_server($dispMap, $serviceNow = 1)
+ function __construct($dispMap, $serviceNow = 1)
{
global $HTTP_RAW_POST_DATA;
// dispMap is a despatch array of methods
@@ -274,4 +274,4 @@
{
global $_xmlrpc_debuginfo;
$_xmlrpc_debuginfo = $_xmlrpc_debuginfo . $m . "\n";
-}
+}
Modified: trunk/lib/XmlRpcServer.php
===================================================================
--- trunk/lib/XmlRpcServer.php 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/lib/XmlRpcServer.php 2021-07-28 15:12:26 UTC (rev 10383)
@@ -947,7 +947,7 @@
$dmap['wiki.' . $name] = $val;
}
- $this->xmlrpc_server($dmap, 0 /* delay service*/);
+ parent::__construct($dmap, 0 /* delay service*/);
}
function service()
Modified: trunk/lib/pear/Cache/Application.php
===================================================================
--- trunk/lib/pear/Cache/Application.php 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/lib/pear/Cache/Application.php 2021-07-28 15:12:26 UTC (rev 10383)
@@ -44,7 +44,7 @@
//
// $app =& new Cache_Application();
// $app->register('foo');
-// $app->register('bar', $bar);
+// $app->register('bar', $bar);
//
// $foo = 'Different data';
//
@@ -53,7 +53,7 @@
//
// As with session_register(), the contents of the variable at the *end* of the
// request is registered and not at the point of registration. Therefore in this
-// example, for the $foo variable, the string 'Different data' is stored and not
+// example, for the $foo variable, the string 'Different data' is stored and not
// 'Some data'. The exception to this rule is if you use the second argument to
// register() as in the second call to it above. This will cause the data supplied
// in the second argument to be stored and not the contents at the end of the request.
@@ -72,7 +72,6 @@
class Cache_Application extends Cache
{
-
var $data;
var $id;
var $group;
@@ -79,18 +78,16 @@
var $registered_vars;
/**
- * Constructor
- *
* @param string Name of container class
* @param array Array with container class options
*/
- function Cache_Application($container = 'file', $container_options = array('cache_dir' => '/tmp/', 'filename_prefix' => 'cache_'), $id = 'application_var', $group = 'application_cache')
+ function __construct($container = 'file', $container_options = array('cache_dir' => '/tmp/', 'filename_prefix' => 'cache_'), $id = 'application_var', $group = 'application_cache')
{
$this->id = $id;
$this->group = $group;
$this->registered_vars = array();
- $this->Cache($container, $container_options);
+ parent::__construct($container, $container_options);
$this->data = $this->isCached($this->id, $this->group) ? unserialize($this->get($this->id, $this->group)) : array();
// If register_globals on, global all registered variables
@@ -176,4 +173,4 @@
return $this->data;
}
}
-?>
\ No newline at end of file
+?>
Modified: trunk/lib/pear/Cache/Function.php
===================================================================
--- trunk/lib/pear/Cache/Function.php 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/lib/pear/Cache/Function.php 2021-07-28 15:12:26 UTC (rev 10383)
@@ -55,12 +55,12 @@
* $cache->call('foobar');
*
* Note:
-*
-* You cannot cache every function. You should only cache
+*
+* You cannot cache every function. You should only cache
* functions that only depend on their arguments and don't use
-* global or static variables, don't rely on database queries or
+* global or static variables, don't rely on database queries or
* files, and so on.
-*
+*
* @author Sebastian Bergmann <sb...@se...>
* @module Function_Cache
* @modulegroup Function_Cache
@@ -79,15 +79,14 @@
* @param array Array with container class options
* @param integer Number of seconds for which to cache
*/
- function Cache_Function($container = 'file',
- $container_options = array('cache_dir' => '.',
- 'filename_prefix' => 'cache_'
- ),
- $expires = 3600
- )
+ function __construct($container = 'file',
+ $container_options = array('cache_dir' => '.',
+ 'filename_prefix' => 'cache_'
+ ),
+ $expires = 3600)
{
- $this->Cache($container, $container_options);
- $this->expires = $expires;
+ parent::__construct($container, $container_options);
+ $this->expires = $expires;
}
/**
Modified: trunk/lib/pear/Cache/Graphics.php
===================================================================
--- trunk/lib/pear/Cache/Graphics.php 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/lib/pear/Cache/Graphics.php 2021-07-28 15:12:26 UTC (rev 10383)
@@ -21,20 +21,20 @@
/**
* Graphics disk cache.
-*
-* The usual way to create images is to pass some arguments that describe the image
-* to a script that dynamically creates an image. For every image of a page
+*
+* The usual way to create images is to pass some arguments that describe the image
+* to a script that dynamically creates an image. For every image of a page
* a new PHP interpreter gets started. This is a good way to kill your webserver.
-*
-* When dealing with dynamically generated images you should not call another script
+*
+* When dealing with dynamically generated images you should not call another script
* to generate the images but generate the images by the script that produces the page
* that contains the images. This is a major improvement but it's only half the way.
-*
+*
* There's no need to rerender an image on every request. A simple disk cache can reduce
-* the computation time dramatically. This is what the class graphics_cache is for.
-*
+* the computation time dramatically. This is what the class graphics_cache is for.
+*
* Usage:
-*
+*
* // create an instance of the graphics cache
* $cache = new graphics_cache;
*
@@ -42,16 +42,16 @@
*
* // compute an ID for your image based on typical parameters
* $id = m5d( $size, $colors, $label);
-*
+*
* // check if it's cached
* if (!($link = $cache->getImageLink($id, 'gif'))) {
-*
+*
* // hmmm, it's not cached, create it
* ...
* // cacheImageLink() and cacheImage() make the ImageGIF() call!
* // cacheImage() returns the value of ImageGIF() [etc.], cacheImageLink() returns a URL
* $link = $cache->cacheImageLink($id, $img, 'gif');
-*
+*
* }
*
* // Ok, let's build the ImageLink
@@ -60,8 +60,8 @@
*
* // for cacheImage():
* // header('Content-type: image/gif'); print $cache->cacheImage($id, $img, 'gif');
-*
*
+*
* The class requires PHP 4.0.2+ [ImageType()]. Note that cacheImage() works with
* the output buffer. Modify it if required!
*
@@ -71,15 +71,13 @@
*/
class Cache_Graphics extends Cache
{
-
-
/**
* Cache URL prefix.
- *
+ *
* Make sure that the cache URL prefix points to the $cache_dir, otherwise
- * your links will be broken. Use setCacheURL to specify the cache_url and
+ * your links will be broken. Use setCacheURL to specify the cache_url and
* setCacheDir() for the cache_dir.
- *
+ *
* @var string
* @see setCacheURL(), setCacheDir()
*/
@@ -88,10 +86,10 @@
/**
* Directory where cached files get stored.
* s
- * Make sure that the cache_dir is writable and offers enough space. Check
+ * Make sure that the cache_dir is writable and offers enough space. Check
* also if your cache_url points to the directory. Use setCacheDir() to set
* the variable.
- *
+ *
* @var string
* @see setCacheDir(), setCacheURL()
*/
@@ -99,15 +97,15 @@
/**
* Nameprefix of cached files.
- *
- * Per default the prefix "graphics_" gets used. You might use this
+ *
+ * Per default the prefix "graphics_" gets used. You might use this
* for versioning or to ease (manual) clean ups.
*
* @var string
*/
var $cache_file_prefix = 'graphics_';
-
-
+
+
/**
* Cache container group.
*
@@ -115,41 +113,38 @@
*/
var $cache_group = 'graphics';
-
+
/**
* Mapping from supported image type to a ImageType() constant.
- *
+ *
* Referr to the PHP manual for more informations on ImageType()
- *
+ *
* @var array
* @link http://www.php.net/ImageType
*/
var $imagetypes = array(
- 'gif' => IMG_GIF,
+ 'gif' => IMG_GIF,
'jpg' => IMG_JPG,
'png' => IMG_PNG,
'wbmp' => IMG_WBMP
);
-
/**
* Instantiates a cache file container.
- *
*/
- function Cache_Graphics()
+ function __construct()
{
- $this->Cache('file', array('cache_dir' => $this->cache_dir, 'filename_prefix' => $this->cache_file_prefix));
-
- } // end constructor
+ parent::__construct('file', array('cache_dir' => $this->cache_dir, 'filename_prefix' => $this->cache_file_prefix));
-
+ }
+
/**
* Returns the content of a cached image file.
- *
+ *
* This function can be used to send the image directly to the browser.
* Make sure that you send a correspondending header before sending the image itself.
*
- * Always try to get the image from the cache before you compute it. See
+ * Always try to get the image from the cache before you compute it. See
* the class docs for an example.
*
* @param string Image-ID
@@ -156,7 +151,7 @@
* @param string Image type: gif, jpg, png, wbmp
* @return string Image file contents if a cached file exists otherwise an empty string
* @see cacheImage()
- */
+ */
function getImage($id, $format = 'png')
{
$id = $this->generateID($id, $format);
@@ -163,11 +158,11 @@
return $this->get($id, $this->cache_group);
} // end func getImage
-
+
/**
* Returns an array with a link to the cached image and the image file path.
- *
- * Always try to get the image from the cache before you compute it. See
+ *
+ * Always try to get the image from the cache before you compute it. See
* the class docs for an example.
*
* @param string Image-ID
@@ -186,14 +181,14 @@
return array($this->container->getFilename($id, $this->cache_group), $file);
} // end func getImageLink
-
+
/**
* Create an image from the given image handler, cache it and return the file content.
*
* Always try to retrive the image from the cache before you compute it.
- *
- * Warning: this function uses the output buffer. If you expect collisions
+ *
+ * Warning: this function uses the output buffer. If you expect collisions
* modify the code.
*
* @param string Image-ID. Used as a part of the cache filename.
@@ -201,9 +196,9 @@
* based on characteristic values such as the color, size etc.
* @param string Image handler to create the image from.
* @param string Image type: gif, jpg, png, wbmp. Also used as filename suffix.
- * If an unsupported type is requested the functions tries to
+ * If an unsupported type is requested the functions tries to
* fallback to a supported type before throwing an exeption.
- * @return string Image content returned by ImageGIF/...
+ * @return string Image content returned by ImageGIF/...
* @throws Cache_Error
* @access public
* @see getImage()
@@ -231,10 +226,10 @@
if ($image = $this->get($id, $this->cache_group)) {
return $image;
}
- // save the image to the output buffer, write it to disk and
+ // save the image to the output buffer, write it to disk and
// return the image.
ob_end_clean();
- ob_start();
+ ob_start();
if (strtoupper($format) == 'JPG') {
$genFormat = 'JPEG';
@@ -256,8 +251,8 @@
return $image;
} // end func cacheImage
-
+
/**
* Create an image from the given image handler, cache it and return a url and the file path of the image.
*
@@ -268,7 +263,7 @@
* based on characteristic values such as the color, size etc.
* @param string Image handler to create the image from.
* @param string Image type: gif, jpg, png, wbmp. Also used as filename suffix.
- * If an unsupported type is requested the functions tries to
+ * If an unsupported type is requested the functions tries to
* fallback to a supported type before throwing an exeption.
* @return array [ full path to the image file, image url ]
* @throws Cache_Error
@@ -285,7 +280,7 @@
// Check if the requested image type is supported by the GD lib.
// If not, try a callback to the first available image type.
if (!isset($this->imagetypes[$format]) || !($types & $this->imagetypes[$format])) {
- foreach ($this->imagetypes as $supported => $bitmask)
+ foreach ($this->imagetypes as $supported => $bitmask)
if ($types & $bitmask) {
new Cache_Error("The build in GD lib does not support the image type $format. Fallback to $supported.", __FILE__, __LINE__);
} else {
@@ -314,13 +309,13 @@
return array($ffile, $url);
} // end func cacheImageLink
-
+
/**
- * Sets the URL prefix used when rendering HTML Tags.
- *
- * Make sure that the URL matches the cache directory,
+ * Sets the URL prefix used when rendering HTML Tags.
+ *
+ * Make sure that the URL matches the cache directory,
* otherwise you'll get broken links.
- *
+ *
* @param string
* @access public
* @see setCacheDir()
@@ -331,13 +326,13 @@
$cache_url .= '/';
}
$this->cache_url = $cache_url;
-
+
} // end func setCacheURL
-
+
/**
* Sets the directory where to cache generated Images
- *
+ *
* @param string
* @access public
* @see setCacheURL()
@@ -350,13 +345,13 @@
$this->cache_dir = $cache_dir;
$this->container->cache_dir = $cache_dir;
} // end func setCacheDir
-
-
+
+
function generateID($variable, $format = 'png')
{
return md5(serialize($variable)) . '.' . $format;
} // end func generateID
-
-
+
+
} // end class Cache_Graphics
?>
Modified: trunk/lib/pear/Cache/HTTP_Request.php
===================================================================
--- trunk/lib/pear/Cache/HTTP_Request.php 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/lib/pear/Cache/HTTP_Request.php 2021-07-28 15:12:26 UTC (rev 10383)
@@ -106,8 +106,6 @@
// --- Public methods ---
/**
- * Constructor
- *
* @param $url The url to access
* @param $params Associative array of parameters which can be:
* method - Method to use, GET, POST etc
@@ -128,9 +126,9 @@
* @see Cache, HTTP_Request
* @access public
*/
- function Cache_HTTP_Request($url, $params = null, $container = 'file',
- $containerOptions = null, $expires = 3600,
- $mode = CACHE_HTTP_REQUEST_KEEP_LOCAL_COPY)
+ function __construct($url, $params = null, $container = 'file',
+ $containerOptions = null, $expires = 3600,
+ $mode = CACHE_HTTP_REQUEST_KEEP_LOCAL_COPY)
{
if (!isset($params)) {
$params = array();
@@ -142,7 +140,7 @@
'filename_prefix' => 'cache_'
);
}
- $this->Cache($container, $containerOptions);
+ parent::__construct($container, $containerOptions);
$this->_request = new HTTP_Request($url, $params);
$this->_id = md5($url.serialize($params));
$this->_id2 = md5($this->_id); // we need two keys
Modified: trunk/lib/pear/Cache/OutputCompression.php
===================================================================
--- trunk/lib/pear/Cache/OutputCompression.php 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/lib/pear/Cache/OutputCompression.php 2021-07-28 15:12:26 UTC (rev 10383)
@@ -57,10 +57,10 @@
*/
class Cache_OutputCompression extends Cache_Output
{
-
+
/**
* Encoding, what the user (its browser) of your website accepts
- *
+ *
* "auto" stands for test using $_SERVER['HTTP_ACCEPT_ENCODING']($HTTP_ACCEPT_ENCODING).
*
* @var string
@@ -67,32 +67,31 @@
* @see Cache_OutputCompression(), setEncoding()
*/
var $encoding = 'auto';
-
-
+
+
/**
* Method used for compression
*
* @var string
* @see isCompressed()
- */
+ */
var $compression = '';
-
+
/**
* Sets the storage details and the content encoding used (if not autodetection)
- *
+ *
* @param string Name of container class
* @param array Array with container class options
* @param string content encoding mode - auto => test which encoding the user accepts
- */
- function Cache_OutputCompression($container, $container_options = '', $encoding = 'auto')
+ */
+ function __construct($container, $container_options = '', $encoding = 'auto')
{
$this->setEncoding($encoding);
- $this->Cache($container, $container_options);
-
- } // end constructor
+ parent::__construct($container, $container_options);
-
+ }
+
/**
* Call parent deconstructor.
*/
@@ -100,8 +99,8 @@
{
$this->_Cache();
} // end deconstructor
-
+
function generateID($variable)
{
$this->compression = $this->getEncoding();
@@ -108,11 +107,11 @@
return md5(serialize($variable) . serialize($this->compression));
} // end generateID
-
- function get($id, $group)
+
+ function get($id, $group = 'default')
{
$this->content = '';
-
+
if (!$this->caching) {
return '';
}
@@ -122,14 +121,14 @@
}
return $this->content;
} // end func get
-
-
+
+
/**
- * Stops the output buffering, saves it to the cache and returns the _compressed_ content.
+ * Stops the output buffering, saves it to the cache and returns the _compressed_ content.
*
* If you need the uncompressed content for further procession before
* it's saved in the cache use endGet(). endGet() does _not compress_.
- */
+ */
function end($expire = 0, $userdata = '')
{
$content = ob_get_contents();
@@ -138,23 +137,23 @@
// store in the cache
if ($this->caching) {
$this->extSave($this->output_id, $content, $userdata, $expire, $this->output_group);
- return $this->content;
+ return $this->content;
}
-
- return $content;
+
+ return $content;
} // end func end()
-
-
+
+
function endPrint($expire = 0, $userdata = '')
{
$this->printContent($this->end($expire, $userdata));
} // end func endPrint
-
+
/**
* Saves the given data to the cache.
- *
- */
+ *
+ */
function extSave($id, $cachedata, $userdata, $expires = 0, $group = 'default')
{
if (!$this->caching) {
@@ -162,7 +161,7 @@
}
if ($this->compression) {
- $len = strlen($cachedata);
+ $len = strlen($cachedata);
$crc = crc32($cachedata);
$cachedata = gzcompress($cachedata, 9);
$this->content = substr($cachedata, 0, strlen($cachedata) - 4) . pack('V', $crc) . pack('V', $len);
@@ -171,13 +170,13 @@
}
return $this->container->save($id, $this->content, $expires, $group, $userdata);
} // end func extSave
-
+
/**
* Sends the compressed data to the user.
- *
+ *
* @param string
* @access public
- */
+ */
function printContent($content = '')
{
$server = &$this->_importGlobalVariable("server");
@@ -199,15 +198,15 @@
header('Vary: Accept-Encoding');
print "\x1f\x8b\x08\x00\x00\x00\x00\x00";
}
-
+
}
-
+
die($content);
} // end func printContent
-
-
+
+
/**
- * Returns the encoding method of the current dataset.
+ * Returns the encoding method of the current dataset.
*
* @access public
* @return string Empty string (which evaluates to false) means no compression
@@ -219,7 +218,7 @@
/**
* Sets the encoding to be used.
- *
+ *
* @param string "auto" means autodetect for every client
* @access public
* @see $encoding
@@ -228,18 +227,18 @@
{
$this->encoding = $encoding;
} // end func setEncoding
-
-
+
+
/**
* Returns the encoding to be used for the data transmission to the client.
*
* @see setEncoding()
- */
+ */
function getEncoding()
{
$server = &$this->_importGlobalVariable("server");
- // encoding set by user
+ // encoding set by user
if ('auto' != $this->encoding) {
return $this->encoding;
}
@@ -252,7 +251,7 @@
}
// no compression
return '';
-
+
} // end func getEncoding
// {{{ _importGlobalVariable()
@@ -264,9 +263,9 @@
* @param string Type of variable (server, session, post)
* @return array
*/
- function &_importGlobalVariable($variable)
+ function &_importGlobalVariable($variable)
{
-
+
$var = null;
switch (strtolower($variable)) {
@@ -301,7 +300,7 @@
}
return $var;
- }
+ }
// }}
} // end class OutputCompression
Modified: trunk/lib/pear/JSON.php
===================================================================
--- trunk/lib/pear/JSON.php 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/lib/pear/JSON.php 2021-07-28 15:12:26 UTC (rev 10383)
@@ -134,8 +134,8 @@
* bubble up with an error, so all return values
* from encode() should be checked with isError()
* - SERVICES_JSON_USE_TO_JSON: call toJSON when serializing objects
- * It serializes the return value from the toJSON call rather
- * than the object it'self, toJSON can return associative arrays,
+ * It serializes the return value from the toJSON call rather
+ * than the object it'self, toJSON can return associative arrays,
* strings or numbers, if you return an object, make sure it does
* not have a toJSON method, otherwise an error will occur.
*/
@@ -150,7 +150,7 @@
var $_mb_strlen = false;
var $_mb_substr = false;
var $_mb_convert_encoding = false;
-
+
/**
* convert a string from one UTF-16 char to one UTF-8 char
*
@@ -274,10 +274,10 @@
$ret = $this->_encode($var);
setlocale(LC_NUMERIC, $lc);
return $ret;
-
+
}
/**
- * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format
+ * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format
*
* @param mixed $var any number, boolean, string, array, or object to be encoded.
* see argument 1 to Services_JSON() above for array-parsing behavior.
@@ -287,9 +287,9 @@
* @return mixed JSON string representation of input var or an error if a problem occurs
* @access public
*/
- function _encode($var)
+ function _encode($var)
{
-
+
switch (gettype($var)) {
case 'boolean':
return $var ? 'true' : 'false';
@@ -354,7 +354,7 @@
$ascii .= '?';
break;
}
-
+
$char = pack('C*', $ord_var_c, ord($var[$c + 1]));
$c += 1;
$utf16 = $this->utf82utf16($char);
@@ -480,27 +480,27 @@
return '[' . join(',', $elements) . ']';
case 'object':
-
+
// support toJSON methods.
if (($this->use & SERVICES_JSON_USE_TO_JSON) && method_exists($var, 'toJSON')) {
// this may end up allowing unlimited recursion
// so we check the return value to make sure it's not got the same method.
$recode = $var->toJSON();
-
+
if (method_exists($recode, 'toJSON')) {
-
+
return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
? 'null'
: new Services_JSON_Error(class_name($var).
" toJSON returned an object with a toJSON method.");
-
+
}
-
+
return $this->_encode( $recode );
- }
-
+ }
+
$vars = get_object_vars($var);
-
+
$properties = array_map(array($this, 'name_value'),
array_keys($vars),
array_values($vars));
@@ -764,7 +764,7 @@
// element in an associative array,
// for now
$parts = array();
-
+
if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:/Uis', $slice, $parts)) {
// "name":value pair
$key = $this->decode($parts[1]);
@@ -871,13 +871,13 @@
return false;
}
-
+
/**
* Calculates length of string in bytes
- * @param string
+ * @param string
* @return integer length
*/
- function strlen8( $str )
+ function strlen8( $str )
{
if ( $this->_mb_strlen ) {
return mb_strlen( $str, "8bit" );
@@ -884,15 +884,15 @@
}
return strlen( $str );
}
-
+
/**
* Returns part of a string, interpreting $start and $length as number of bytes.
- * @param string
- * @param integer start
- * @param integer length
+ * @param string
+ * @param integer start
+ * @param integer length
* @return integer length
*/
- function substr8( $string, $start, $length=false )
+ function substr8( $string, $start, $length=false )
{
if ( $length === false ) {
$length = $this->strlen8( $string ) - $start;
@@ -909,10 +909,10 @@
class Services_JSON_Error extends PEAR_Error
{
- function Services_JSON_Error($message = 'unknown error', $code = null,
- $mode = null, $options = null, $userinfo = null)
+ function __construct($message = 'unknown error', $code = null,
+ $mode = null, $options = null, $userinfo = null)
{
- parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
+ parent::__construct($message, $code, $mode, $options, $userinfo);
}
}
@@ -923,11 +923,11 @@
*/
class Services_JSON_Error
{
- function Services_JSON_Error($message = 'unknown error', $code = null,
- $mode = null, $options = null, $userinfo = null)
+ function __construct($message = 'unknown error', $code = null,
+ $mode = null, $options = null, $userinfo = null)
{
}
}
-
+
}
Modified: trunk/themes/blog/jscalendar/calendar.php
===================================================================
--- trunk/themes/blog/jscalendar/calendar.php 2021-07-28 14:52:50 UTC (rev 10382)
+++ trunk/themes/blog/jscalendar/calendar.php 2021-07-28 15:12:26 UTC (rev 10383)
@@ -21,10 +21,10 @@
var $calendar_theme_file;
var $calendar_options;
- function DHTML_Calendar($calendar_lib_path = '/calendar/',
- $lang = 'en',
- $theme = 'calendar-win2k-1',
- $stripped = true) {
+ function __construct($calendar_lib_path = '/calendar/',
+ $lang = 'en',
+ $theme = 'calendar-win2k-1',
+ $stripped = true) {
if ($stripped) {
$this->calendar_file = 'calendar_stripped.js';
$this->calendar_setup_file = 'calendar-setup_stripped.js';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|