Issue Details (XML | Word | Printable)

Key: ZF-7161
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Stanislav Malyshev
Reporter: Gaurav Priyadarshi
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Class does not load with Zend framework 1.8.4

Created: 30/Jun/09 02:15 AM   Updated: 31/Jul/09 09:10 PM   Resolved: 30/Jun/09 05:00 PM
Component/s: Zend_Amf
Affects Version/s: 1.8.4
Fix Version/s: 1.8.4

Time Tracking:
Not Specified

File Attachments: 1. File amf_config.ini (0.2 kB)
2. File EmployeeService.php (4 kB)



 Description  « Hide

We use the following gateway to handle the amf requests:

<?php
ini_set("display_errors", 1);
$dir = dirname(__FILE__);
$webroot = $_SERVER['DOCUMENT_ROOT'];
$configfile = "$dir/amf_config.ini";

//default zend install directory
$zenddir = $webroot. '/ZendFramework/library';

//Load ini file and locate zend directory
if(file_exists($configfile)) {
	$arr=parse_ini_file($configfile,true);
	if(isset($arr['zend']['zend_path'])){
		$zenddir = $arr['zend']['zend_path'];
	}
}


// Setup include path
	//add zend directory to include path
set_include_path(get_include_path().PATH_SEPARATOR.$zenddir);
// Initialize Zend Framework loader
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
// Load configuration
$default_config = new Zend_Config(array("production" => false), true);
$default_config->merge(new Zend_Config_Ini($configfile, 'zendamf'));
$default_config->setReadOnly();
$amf = $default_config->amf;

// Store configuration in the registry
Zend_Registry::set("amf-config", $amf);
// Initialize AMF Server
$server = new Zend_Amf_Server();
$server->setProduction($amf->production);
if(isset($amf->directories)) {
	$dirs = $amf->directories->toArray();
	foreach($dirs as $dir) {
		$server->addDirectory($dir);
	}
}

// Initialize introspector for non-production
if(!$amf->production) {
	$server->setClass('Zend_Amf_Adobe_Introspector', '', array("config" => $default_config, "server" => $server));
	$server->setClass('Zend_Amf_Adobe_DbInspector', '', array("config" => $default_config, "server" => $server));
}
// Handle request
echo $server->handle();

With Zend framework 1.8.3 this works fine, but with Zend Framework 1.8.4, we receive the following error:

Server error Class "EmployeeService" does not exist 
#0 C:\wamp\www\ZendFramework\library\Zend\Amf\Server.php(540): Zend_Amf_Server->_dispatch('count', Array, 'EmployeeService') 
#1 C:\wamp\www\ZendFramework\library\Zend\Amf\Server.php(616): Zend_Amf_Server->_handle(Object(Zend_Amf_Request_Http)) 
#2 C:\wamp\www\TestZend184-debug\gateway.php(49): Zend_Amf_Server->handle() 
#3 {main}


Stanislav Malyshev added a comment - 30/Jun/09 09:49 AM

Please attach config file and describe where EmployeeService class is.


Gaurav Priyadarshi added a comment - 30/Jun/09 11:13 AM

the amf_config.ini file


Gaurav Priyadarshi added a comment - 30/Jun/09 11:15 AM

Find the attached files.
amf_config_ini file resides in the same dir as the gateway file.
EmployeeService.php resides under services folder under this directory.


Stanislav Malyshev added a comment - 30/Jun/09 04:56 PM

I think I know what the problem is. For some reason in 1.8.4 package there's an old version of Zend/Loader/PluginLoader.php. Take the new one here:

http://framework.zend.com/svn/framework/standard/branches/release-1.8/library/Zend/Loader/PluginLoader.php

It should work with it.


Satoru Yoshida added a comment - 31/Jul/09 09:10 PM

It seems to be solved at 1.8.4PL