Issue Type: Bug Created: 2009-03-26T02:18:20.000+0000 Last Updated: 2009-04-22T11:04:14.000+0000 Status: Resolved Fix version(s): - 1.7.8 (30/Mar/09)
Reporter: Gaurav Priyadarshi (gauravp) Assignee: Wade Arnold (wadearnold) Tags: - Zend_Amf
Related issues: Attachments:
We are facing an issue with the gateway.php that we use as endpoint for Remoting Calls from Flash player. In order to use a php file as a service we need to include it in the gateway.php file. Now if you have two php files exposed as services the gateway.php file has a code snippet similar to:
require_once 'a.php'; require_once 'b.php';
$server = new Zend_Amf_Server(); echo $server->handle();
where a.php & b.php are service php files.
Now if a.php is invalid (syntactical errors etc.) the user is not allowed to invoke the functions of even b.php, since the gateway.php file could not include the invalid a.php file and hence throws an error. This is a concern as the user will now have to make sure that all the files exposed as services need to be valid all the time.
Is there any other better way of exposing the service php files so that the above limitations don't show up.
Posted by Stanislav Malyshev (stas) on 2009-04-03T15:26:21.000+0000
I don't think there's something specific to AMF - if you load bad file, PHP stops execution and produces an error. There's little that can be done about it. However, in this particular case you could use autoloading and then when you run service from a.php you would not need to include b.php. Thus, only service using b.php would be broken when b.php is broken.
Posted by Gaurav Priyadarshi (gauravp) on 2009-04-06T06:14:11.000+0000
The problem is in cases where the files are located in separate directories, say, 'dir1/a.php' and 'dir2/b.php' Now to expose these services we will have to write a code which will include $server->setClass('a') & $server->setClass('b'). If we use __autoload function, firstly how will we resolve the complete path to the php files and secondly, it will still result in errors as soon as we call setClass()
Posted by Stanislav Malyshev (stas) on 2009-04-14T10:28:37.000+0000
I'm not sure I understand - could you provide complete code example (maybe by mail to firstname.lastname@example.org) that describes what problems you get with autoloading?
Posted by Wade Arnold (wadearnold) on 2009-04-14T16:56:04.000+0000
This looks like an issue that has been resolved. Are you having the issue with Zend Framework 1.7.8?
Posted by Stanislav Malyshev (stas) on 2009-04-22T11:04:12.000+0000
Have you found an issue?
See the Overview section for more details.