你应该有这样的东西:
boostrap.php
有了这个内容:
...
protected function _initAutoload()
{
// Add autoloader empty namespace
$autoLoader = Zend_Loader_Autoloader::getInstance();
$autoLoader->suppressNotFoundWarnings(true);//http://zend-framework-community.634137.n4.nabble.com/Trouble-using-Gdata-Calendar-td675383.html
$autoLoader->registerNamespace('Gestionale_');
$resourceLoader = new Zend_Loader_Autoloader_Resource(
array(
'basePath' => APPLICATION_PATH,
'namespace' => '',
'resourceTypes' => array(
'form' =>
array(
'path' => 'forms/',
'namespace' => 'Form_',
),
'model' =>
array(
'path' => 'models/',
'namespace' => 'Model_'
),
),
));
// Return it so that it can be stored by the bootstrap
return $autoLoader;
}
...
\library\Gestionale\Exceptions\Exception.php
使用此代码
<?php
/**
* Custom exception class that logs messages
*/
class Gestionale_Exceptions_Exception extends Exception
{
...
}
然后使用
throw new Gestionale_Exceptions_Exception('Bla bla bla');