Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 971
  • Last Modified:

Zend model file "class not found" when not in the default application path

I have moved the model files and they are getting a: Class "Authacl_Model_UserService" not found (Zend Studio Alerts me to this fact) but the error message at the bottom also indicates this.  The controller files work fine, but the model and form directories do not work.

The program dies in the session.php.  I'll add the error message following all the text description.

I thought the following application.ini entry is all I should have to do:
;; RESOURCE MODULES and it's Path
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""

class name
from:  Application_Model_UserService  
to:   Authacl_Model_UserService

file name
from:  UserService.php  
to:   UserService.php

dir structure:
from:  application/models
to:     application/modules/authacl/models

Fatal error: 
Uncaught exception 'Zend_Session_Exception' with message 'Zend_Session::start() - 
C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Loader.php(Line:146): 

Error #2 include_once() [<a href='function.include'>function.include</a>]: 
Failed opening [b]'Authacl\Model\CurrentUser.php[/b]' for inclusion 
(include_path='C:\www\std_template\application/../library;C:\www\std_template\library;.;
C:\Program Files (x86)\ZendServer\share\ZendFramework\library') 
Array' in C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Session.php:493 

Stack trace: 
#0 C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Session\Namespace.php(143): 
	Zend_Session::start(true) 
#1 C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Auth\Storage\Session.php(87): 
	Zend_Session_Namespace->__construct('Zend_Auth') 
#2 C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Auth.php(91): 
	Zend_Auth_Storage_Session->__construct() 
#3 C:\Program Files (x86)\ZendServer\share\ZendFramework\libr in 
  C:\Program Files (x86)\ZendServer\share\ZendFramework\library\Zend\Session.php on line 493

Open in new window

0
MTTDev
Asked:
MTTDev
  • 3
1 Solution
 
mjangidCommented:
make sure you have included all files or include path in initialization or application file
0
 
MTTDevAuthor Commented:
If the controller files in my module are being picked up shouldn't the model files be picked up?  They are both subdirs of the same module
0
 
MTTDevAuthor Commented:
I added this to my bootstrap of the default module:  Seems to have solved the path issues problems.
      

protected function _initResourceLoader ()
	{
	
		$resourceLoader = new Zend_Loader_Autoloader_Resource(
			array('basePath'      => APPLICATION_PATH . 'modules/',
			    'namespace'     => 'Authacl',
				    'resourceTypes' => array(
						'controller' => array(
				            'path'      => 'controllers/',
				            'namespace' => '',
				        ),						
				    	'form' => array(
				            'path'      => 'forms/',
				            'namespace' => 'Form',
				        ),
				        'model' => array(
				            'path'      => 'models/',
				            'namespace' => 'Model',
				        ),
				 ),
			)
		);
	}

Open in new window

0
 
MTTDevAuthor Commented:
Comments from the expert were correct in that during boot strapping something needed to to happen.  More direction and/or followup questions were required to be helpful in solving the problem.

The code above was the answer to the problem.  No points were awarded.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now