zend-framework

Doctrine2 Update Caused AnnotationRegistry registerLoader Error in Zend Framework 3

时光总嘲笑我的痴心妄想 提交于 2019-12-18 14:57:07
问题 I'm working on a CMS based on Zend Framework 3.0 to manage a DB I with Doctrine. What is my problem when managing packages with composer? Recently, I updated all the packages to newest versions and sent it to server, nothing was changed in other files. After the update my site displayed the following error: Fatal error: Uncaught TypeError: Return value of Doctrine\Common\Annotations\AnnotationRegistry::registerLoader() must be an instance of Doctrine\Common\Annotations\void, none returned in

Creating a custom JSON response object with Zend Action Helper ContextSwitch

删除回忆录丶 提交于 2019-12-18 13:19:17
问题 I normally append an encoded json object to the response body, however I now have a situation that warrants using the ContextSwitch action helper. I have a Zend_Form that requires three different response contexts: html - Render the form as normal html within a layout. html-partial - An ajax "get" request that renders just the form as html. json - An ajax "post" request that returns any form valiation error messages. For each context I have 3 view scripts. Although the two html contexts could

Zend Form SetAction Using Named Routes

倾然丶 夕夏残阳落幕 提交于 2019-12-18 13:14:34
问题 I have a form that I am trying to set the action for. I want to declare the action inside my form file (which extends Zend_Form) instead of in a controller or view, using a route I have created in my bootstrap. Usually when I want to use a route I do something like $this->url(array(), 'route-name'); in the view, or $this->_helper->url(array(), 'route-name'); in the controller. How do I call a route from within Zend_Form? edit: I have given up trying to load a route into zend_form. Perhaps in

Multiple database connection in Doctrine2 and Zend framework

那年仲夏 提交于 2019-12-18 12:43:09
问题 I am currently working on an application which is built using ZF 1.11.3 - Doctrine2 is the ORM component used. I need to use multiple databases. Within the application.ini file, I have set the database connections as follows: resources.doctrine.dbal.connections.default.parameters.dbname = "db_name_one" resources.doctrine.dbal.connections.secondary.parameters.dbname = "db_name_two" How would I associate the Doctrine2 entity classes based on the second database connection with that connection:

PHP 5 and Zend MVC on Windows and IIS

六眼飞鱼酱① 提交于 2019-12-18 12:42:34
问题 Are there any major issues to be aware of running a PHP 5 / Zend MVC production application on Windows? The particular application is Magento, an ecommerce system, and the client is really not interested in having a Linux box in their datacenter. Has anyone had luck getting PHP 5 and Zend MVC working correctly on IIS? 回答1: Yes, it works. Microsoft and Zend are working together to get PHP running as it runs on linux. Zend even has a certified version of their core package (includes php, mysql

Zend Framework Select Objects And UNION()

蹲街弑〆低调 提交于 2019-12-18 12:38:57
问题 I'm pretty sure this is not possible in Zend Framework (I have searched the Web, the documentation and issue tracker) but I just want to make sure so I'm asking here. $select = $this->select(); $select->union($select1, $select2); That doesn't work of course. To explain what I need. I need to use UNION() to merge 2 tables in a SELECT query, I know I could just do: $select = "$select1 UNION $select2"; The problem is that would return a string and I need to get a select object so I can use it

php setcookie vs Zend_Http_Cookie

蓝咒 提交于 2019-12-18 12:38:49
问题 Why this code not working, and how can I make it works like setcookie('cookie_name','cookie_value'); The code that not create cookie : $cookie=new Zend_Http_Cookie('cookie_name','cookie_value','.google.com'); Or what difference between: setcookie('cookie_name','cookie_value'); vs $cookie=new Zend_Http_Cookie('cookie_name','cookie_value','.google.com'); Thanks 回答1: Zend_Http_Cookie is not for setting cookies, it is a companion class for Zend_Http_Client. Let's say you wanted to screen scape

Zend Framework Automatic Logout after inactivity

北城以北 提交于 2019-12-18 12:28:25
问题 I'm working on an application that houses several sub applications and I'd like to implement an auto logout after 30 minutes of inactivity. I have an AuthController with login and logout actions mapped to custom /login and /logout routes using the Bootstrap.php as well as a front controller plugin that looks like this: class Plugin_SessionTrack extends Zend_Controller_Plugin_Abstract { public function preDispatch(Zend_Controller_Request_Abstract $request) { $employeeSession = new Zend_Session

How to parse a Zend URL for parameters?

微笑、不失礼 提交于 2019-12-18 12:24:23
问题 I am trying to extract the GET parameters from a ZF REST URL. It's not the current request and I don't want to call the URL or execute the route, I just need the parameters. I'm looking for a utility function like parse_url(), but for the Zend REST format. Is there one, or do I have to reinvent the wheel? I've tried a few things like creating a new Zend_Controller_Request_Http but the parameters aren't being populated. It is a valid HTTP URL. Edit: Upon request, a sample Zend URL: http:/

Zend_Session / Zend_Auth randomly throws Error Message ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13)

自作多情 提交于 2019-12-18 12:08:56
问题 I'm currently working on a new Application using (among other things) Zend_Auth but, for whatever reason, this Error Message is showing up at any location totally randomly (or so it seams) Zend_Session::start() - /home/hannes/workspace/develop/library/Zend/Session.php(Line:480): Error #8 session_start() [function.session-start]: ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) Array #0 /home/hannes/workspace/develop/library/Zend/Session/Namespace.php(143): Zend