PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_AJAX » Bug #7428

Add support for custom serveUrl w/ patch

Details

Request #7428Add support for custom serveUrl w/ patch
Submitted2006-04-19 21:29 UTC
Fromtacker at php dot net
Assignedjeichorn
StatusClosed
PackageHTML_AJAX
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2006-04-19 21:29 UTC] tacker at php dot net

Description:
------------
It would be nice if the server url was customizeable.

--- Server.php.orig 2006-04-19 23:21:28.000000000 +0200
+++ Server.php 2006-04-19 23:27:02.000000000 +0200
@@ -138,6 +138,11 @@
*/
var $_initLookup = array();

+ /**
+ * Server URL to use instead of $_SERVER['PHP_SELF']
+ * @var string
+ */
+ static $serverUrl;

/**
* Constructor creates the HTML_AJAX instance
@@ -158,7 +163,7 @@
}

// call the server with this query string
- $this->ajax->serverUrl = htmlentities($_SERVER['PHP_SELF']) .'?'. htmlentities($querystring);
+ $this->ajax->serverUrl = (is_null(self::$serverUrl) ? htmlentities($_SERVER['PHP_SELF']) : htmlentities(self::$serverUrl)) .'?'. htmlentities($querystring);

$methods = get_class_methods($this);
foreach($methods as $method) {

[2006-04-20 23:15 UTC] jeichorn at php dot net

This patch needs be updated to work on php4 before we can merge it

[2006-05-29 11:43 UTC] tacker at php dot net

PHP4-Version:

--- Server.php.orig 2006-04-19 23:21:28.000000000 +0200
+++ Server.php 2006-04-19 23:27:02.000000000 +0200
@@ -138,6 +138,11 @@
*/
var $_initLookup = array();

+ /**
+ * Server URL to use instead of $_SERVER['PHP_SELF']
+ * @var string
+ */
+ var $serverUrl;

/**
* Constructor creates the HTML_AJAX instance
@@ -158,7 +163,7 @@
}

// call the server with this query string
- $this->ajax->serverUrl =
htmlentities($_SERVER['PHP_SELF']) .'?'. htmlentities($querystring);
+ $this->ajax->serverUrl = (is_null($this->serverUrl) ?
htmlentities($_SERVER['PHP_SELF']) : htmlentities($this->serverUrl))
.'?'. htmlentities($querystring);

$methods = get_class_methods($this);
foreach($methods as $method) {

[2006-05-29 12:06 UTC] tacker at php dot net

Bah. Bullshit. Sorry. I forgot that the URL must already be known in the constructor. So the only way is to use a global variable like

$HTML_AJAX_serverUrl = '';

[2006-05-29 16:46 UTC] jeichorn at php dot net

Using a globals is ugly i'll try to come up with a better way of handling setting serverUrl

[2006-05-29 17:01 UTC] jeichorn at php dot net

I writing up some code using an optional parameter to the constuctor, i'll close this bug once its commited

[2006-05-29 17:11 UTC] jeichorn at php dot net

This fix will be in the next release which should happen next week

http://websvn.bluga.net/wsvn/HTML_AJAX/trunk/AJAX/Server.php?op=diff&rev=0&sc=1