zend-framework

where to save custom autoloaders in zend?

走远了吗. 提交于 2019-12-07 05:38:55
问题 I am trying to use phpThumb in my application by making a custom autoloader. class My_Loader_Autoloader_PhpThumb implements Zend_Loader_Autoloader_Interface { static protected $php_thumb_classes = array( 'PhpThumb' => 'PhpThumb.inc.php', 'ThumbBase' => 'ThumbBase.inc.php', 'PhpThumbFactory' => 'ThumbLib.inc.php', 'GdThumb' => 'GdThumb.inc.php', 'GdReflectionLib' => 'thumb_plugins/gd_reflection.inc.php', ); /** * Autoload a class * * @param string $class * @return mixed * False [if unable to

Zend: How to use a custom function from a view helper in the controller?

℡╲_俬逩灬. 提交于 2019-12-07 05:28:23
问题 Ive got a view helper in library/my/view/helper/gravatar and so in any view I can call $this->gravatar($email) . But how can I access this function in the models (or controllers)? Sorry if its already been asked but Im new and the documentation is bloody awful in parts. Thanks everyone 回答1: In your controller, you can access ViewHelpers through $this->view->gravatar($email) Your model should not call methods from the View, as it would tie the model to the presentation layer. The View may know

Zend Framework: How to handle exceptions in Ajax requests?

青春壹個敷衍的年華 提交于 2019-12-07 05:19:01
问题 Normally when an exception is thrown, Error controller takes command and displays error page with regular common header and footer. This behavior is not wanted in Ajax request. Because in case of error, whole html page is sent over. And in cases where I'm directly loading the content of http response in a div, this is even more unwanted. Instead in case of Ajax request, I just want to receive 'the actual error' thrown by exception. How can I do this? I think, one dirty way could be: set a var

Creating an index with Elasticsearch 5.0 throws a Bad Request exception

核能气质少年 提交于 2019-12-07 05:07:30
I use Elasticsearch 2.4 and I decided to test my code with Elasticsearch 5.0. So, I installed Elasticsearch 5.0, started it and then tried to use my PHP function that creates an index and populates it. But I get this error : Elasticsearch\Common\Exceptions\BadRequest400Exception No handler found for uri [/devmaestro_fr_articles] and method [POST] And this one : Guzzle\Http\Exception\ClientErrorResponseException Client error response [status code] 400 [reason phrase] Bad Request [url] http://localhost:9200/devmaestro_fr_articles If I use the same PHP function with Elasticsearch 2.4, it works

Zend Date is giving me fatal error msg

家住魔仙堡 提交于 2019-12-07 05:06:25
I just want to use a few classes Zend offers, Zend Date, Zend Mail, and a few others, but I can't get the date one to even do anything. I've included it this way: include_once '../classes/zend/library/zend/date/DateObject.php'; $date = new Zend_Date(time()); Here's the error: Fatal error: Class 'Zend_Date' not found Do I have to go through the steps to change the configuration files for apache, and php just to use this one class? Any help is appreciated. Thanks. You need Zend/Date.php, not Zend/Date/DateObject.php. Furthermore, you might need some autoloader to load other classes that Zend

Mysql adapter for Zend_Translate

流过昼夜 提交于 2019-12-07 04:56:55
问题 I'm currently in the planning phase of a rather large project that I'll develop in the Zend Framework. One of the problems I'm facing is that the customers will want to translate not only the content but also the interface. I'm currently using gettext and poedit to manage my language files but this is not an option for the customer as they, for one, wont have FTP access to the site. Hence, I'm thinking of a mysql back end with an interface in the front end for the customer to manage his own

The annotation “@Doctrine\ORM\Mapping\Entity” in class Entities\USER_User does not exist, or could not be auto-loaded

旧街凉风 提交于 2019-12-07 04:56:14
问题 I'd like to use Doctrine 2 combined with "l3pp4rd/DoctrineExtensions" in my Zend Framework-Application. But I only get the following error message: The annotation "@Doctrine\ORM\Mapping\Entity" in class Entities\USER_User does not exist, or could not be auto-loaded. application\bootstrap.php protected function _initDoctrine() { require_once('Doctrine/Common/ClassLoader.php'); $autoloader = Zend_Loader_Autoloader::getInstance(); $classLoader = array(new \Doctrine\Common\ClassLoader('Doctrine')

.htaccess throws 403 Forbidden / Zend Framework quickstart project creation (Mac OS X 10.6.5)

血红的双手。 提交于 2019-12-07 04:49:44
问题 I am trying to get Zend Framework's quickstart tutorial up and running, but i ran into .htaccess issue. It seems if i remove the .htaccess file, the project runs fine, but if i leave it in there it throws a 403 Forbidden. The .htaccess is the default file generated by Zend Framework console command. Here is the .htaccess: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*

Zend_Validate_Date just doesn't work properly

自古美人都是妖i 提交于 2019-12-07 04:16:55
问题 It appears that Zend_Validate_Date just simply doesn't work properly. For example: $validator = new Zend_Validate_Date(array('format' => 'yyyy')); This is a simple validator that should only accept a four digit year, yet $validator->isValid('1/2/3') returns true! Really, Zend? Or how about this: $otherValidator = new Zend_Validate_Date(array('format' => 'mm/dd/yyyy')); Even with the above code, $otherValidator->isValid('15/13/10/12/1222') returns true too! I'm using Zend Framework 1.11.9. Is

Intermittent 500 errors from Apache running Zend Framework with multiple virtual hosts

前提是你 提交于 2019-12-07 04:05:17
问题 We have been working on a project for several months without any problems until a set of recent updates. The server is running Amazon Linux AMI release 2010.11.1, with Apache 2.2.16 and PHP 5.3.3. The project is divided into a few separate developer branches, running as virtual hosts, each with a completely separate copy of all the code including Zend Framework 1.11.3. The project also includes Doctrine 2.0.1, but I don't think that is where the problem is. I have experimented with APC in the