Zend Framework

Class does not load with Zend framework 1.8.4

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.8.4
  • Fix Version/s: 1.8.4
  • Component/s: Zend_Amf
  • Labels:
    None

Description

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}
  1. amf_config.ini
    30/Jun/09 11:13 AM
    0.2 kB
    Gaurav Priyadarshi
  2. EmployeeService.php
    30/Jun/09 11:14 AM
    4 kB
    Gaurav Priyadarshi

Activity

Hide
Stanislav Malyshev added a comment -

Please attach config file and describe where EmployeeService class is.

Show
Stanislav Malyshev added a comment - Please attach config file and describe where EmployeeService class is.
Hide
Gaurav Priyadarshi added a comment -

the amf_config.ini file

Show
Gaurav Priyadarshi added a comment - the amf_config.ini file
Hide
Gaurav Priyadarshi added a comment -

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.

Show
Gaurav Priyadarshi added a comment - 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.
Hide
Stanislav Malyshev added a comment -

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.

Show
Stanislav Malyshev added a comment - 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.
Hide
Satoru Yoshida added a comment -

It seems to be solved at 1.8.4PL

Show
Satoru Yoshida added a comment - It seems to be solved at 1.8.4PL

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: