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 #5788

New bug in Ajax Server , cant create JS stub

Details

Submitted2005-10-26 13:56 UTC
Fromspam at electroteque dot org
Assignedjeichorn
StatusClosed
PackageHTML_AJAX
PHP Version5.1.0
OSn/a
Roadmaps(Not assigned)

Comments

[2005-10-26 13:56 UTC] spam at electroteque dot org

Description:
------------
Without changing any of my code i now get this error in
the JS stub creation, there is no other indication of an
error until i goto auto_server.php?stub=classname ,
however I have firstletter uppercase, and im forced to
make the classname all lowewrcase should this matter ?

<br />
<b>Warning</b>: Invalid argument supplied for foreach()
in <b>/Volumes/DATA/www/musictrade/classes/PEAR/HTML/
AJAX/Server.php</b> on line <b>224</b><br />
<br />
<b>Notice</b>: Could find an init method for class:
musictrade_admin_releases_tracklist in <b>/Volumes/DATA/
www/musictrade/classes/PEAR/HTML/AJAX/Server.php</b> on
line <b>484</b><br />

a var dump of $this->_initLookup is empty ..

[2005-10-26 14:11 UTC] spam at electroteque dot org

I just worked out, you have to add client=all now along
with the stub

auto_server.php?
stub=musictrade_admin_releases_tracklist&client=all

however this still comes up

<br />
<b>Notice</b>: Could find an init method for class:
musictrade_admin_releases_tracklist in <b>/Volumes/DATA/
www/musictrade/classes/PEAR/HTML/AJAX/Server.php</b> on
line <b>484</b><br />

Just discovered in the constructor of Server

function HTML_AJAX_Server()
{
$this->ajax =& new HTML_AJAX();
$this->ajax->serverUrl = $_SERVER['PHP_SELF'];

$methods = get_class_methods($this);

foreach($methods as $method) {

//if (preg_match('/^init([a-zA-Z0-0]+)$/
',$method,$match)) {
if (preg_match('/^init(.*)/
',$method,$match)) {
$this->_initLookup[$match[1]] = $method;
}
}



die();
}

a classname of as crazy long as it is
initMusictrade_Admin_Releases_Tracklist is screwing with
your preg_match. This only just happened though once i
upgraded as you said ?

[2005-10-26 14:16 UTC] spam at electroteque dot org

Bloody hell, ok we have to use the exact classname for
the stub now, before it had to be lowercase

auto_server.php?
stub=Musictrade_Admin_Releases_Tracklist&client=all

still the preg_match issue though. and i suppose the
error for client all will go if you check if the array
isnt empty first :D

[2005-10-26 14:40 UTC] spam at electroteque dot org

Wrong yet again, stub wasnt being generated the only way
it worked now is

auto_server.php?stub=all&client=all

however the js function is lowercase.

[2005-10-26 14:43 UTC] spam at electroteque dot org

Ok its buggered when i tried to execute the command.

Notice: Could find an init method for class:
musictrade_admin_releases_tracklist in /Volumes/DATA/
www/musictrade/classes/PEAR/HTML/AJAX/Server.php on line
489

Warning: Cannot modify header information - headers
already sent by (output started at /Volumes/DATA/www/
musictrade/classes/PEAR/HTML/AJAX/Server.php:489) in /
Volumes/DATA/www/musictrade/classes/PEAR/HTML/AJAX.php
on line 347

Warning: Cannot modify header information - headers
already sent by (output started at /Volumes/DATA/www/
musictrade/classes/PEAR/HTML/AJAX/Server.php:489) in /
Volumes/DATA/www/musictrade/classes/PEAR/HTML/AJAX.php
on line 347

Warning: Cannot modify header information - headers
already sent by (output started at /Volumes/DATA/www/
musictrade/classes/PEAR/HTML/AJAX/Server.php:489) in /
Volumes/DATA/www/musictrade/classes/PEAR/HTML/AJAX.php
on line 347

Warning: Cannot modify header information - headers
already sent by (output started at /Volumes/DATA/www/
musictrade/classes/PEAR/HTML/AJAX/Server.php:489) in /
Volumes/DATA/www/musictrade/classes/PEAR/HTML/AJAX.php
on line 347

Warning: Cannot modify header information - headers
already sent by (output started at /Volumes/DATA/www/
musictrade/classes/PEAR/HTML/AJAX/Server.php:489) in /
Volumes/DATA/www/musictrade/classes/PEAR/HTML/AJAX.php
on line 347

Warning: Cannot modify header information - headers
already sent by (output started at /Volumes/DATA/www/
musictrade/classes/PEAR/HTML/AJAX/Server.php:489) in /
Volumes/DATA/www/musictrade/classes/PEAR/HTML/AJAX.php
on line 347

{"errNo":1024,"errStr":"Unknown class:
musictrade_admin_releases_tracklist","errFile":"\/
Volumes\/DATA\/www\/musictrade\/classes\/PEAR\/HTML\/
AJAX.php","errLine":266}

[2005-10-26 16:09 UTC] jeichorn at php dot net

I'll try to get this fixed today and do a another release

[2005-10-26 16:09 UTC] jeichorn at php dot net

On the case stuff, the comparison should be done in lower case, so your input case shouldn't matter at all.

[2005-10-27 01:02 UTC] spam at electroteque dot org

my init functions seem to be needing to be lowercase

[2005-10-27 03:17 UTC] jeichorn at php dot net

The init function needing to be lowercase should be fixed in 0.2.4

[2005-10-27 03:18 UTC] jeichorn at php dot net

I believe all this is fixed in 0.2.4 as long as have your error_reporting set to E_ALL or less.

Please test against the this version

[2005-10-27 03:25 UTC] spam at electroteque dot org

All done now cheers, case insensitive. My error
reporting is

error_reporting(E_ERROR | E_WARNING | E_PARSE &
~E_NOTICE & ~E_STRICT);

however even while trying to ignore E_STRICT u have to
still check in your customer error method LOL

[2005-10-27 03:30 UTC] jeichorn at php dot net

Ok im going to close this since the immediate bug is fixed. Error handling still needs some work, i think the long term fix is goign to be to detect php 5 and use the error_types param it offers for set_error_handler