zend-framework

Running a Zend Framework action from command line

ぐ巨炮叔叔 提交于 2019-12-17 07:01:17
问题 I would like to run a Zend Framework action to generate some files, from command line. Is this possible and how much change would I need to make to my existing Web project that is using ZF? Thanks! 回答1: It's actually much easier than you might think. The bootstrap/application components and your existing configs can be reused with CLI scripts, while avoiding the MVC stack and unnecessary weight that is invoked in a HTTP request. This is one advantage to not using wget. Start your script as

How to get client's timezone? [duplicate]

十年热恋 提交于 2019-12-17 02:31:36
问题 This question already has answers here : How to detect user's timezone? (6 answers) Closed 4 years ago . I'm writting an application using Zend_Framework (so the solution can rely on it). How to get client's timezone? For example, if someone in Moscow, Russia, I want to get 3*60*60 (because there is UTC+3). If he is in UK, I want zero. If he uses UTC-3:30 (Canada?), I want -3.5*60*60. (it's not a question about a format - I'm ok with getting 'Europe/Moscow' or 'UTC-3' for St. Petersburg,

Starting with Zend Tutorial - Zend_DB_Adapter throws Exception: “SQLSTATE[HY000] [2002] No such file or directory”

一个人想着一个人 提交于 2019-12-16 22:24:13
问题 I have started to learn Zend Framework with the Book "Zend Framework in Action" in German. Right there where it starts to get interesting, my PHP Unit Test throws this Error: "Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory" I can't find any hints through Google searches. I did everything like it is in the book. Can anyone give me a hint as to where to search for the fault? Is this a common beginner mistake? 回答1: I would say that you have a problem connecting from

jqGrid cannot inline edit

痞子三分冷 提交于 2019-12-14 03:43:19
问题 I have been searching all over internet for a solution to my simple problem (I hope) but unfortunately nothing has helped!.. I am a beginner with jqGrid and I have successfully made it to show all my sample array data in a table.. What I want is to be able to edit the "role" column inline and save it back to the array data... I am using Zend framework and have this issue: My problems I am not able to edit the data at all. I can just select and highlight as usual, no textarea is been provided.

integrating phpthumb in zend framework

回眸只為那壹抹淺笑 提交于 2019-12-14 03:34:54
问题 Is there a easy way to integrate phpthumb in zend framework ? Please help me with sample code if possible, thanks 回答1: application/Bootstrap.php protected function _initAutoload() { $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->registerNamespace('PhpThumb_'); return $autoloader; } application/configs/application.ini [production] includePaths.library = APPLICATION_PATH "/../library" put files in library --PhpThumb 回答2: My answer is based on this answer by David Weinraub as

double slash in URLs.

拥有回忆 提交于 2019-12-14 03:11:49
问题 Zend Route issue. Normally it works fine. http://www.example.com/course-details/1/Physics-Newtons-Law But if I type in an extra slash in the url, the noauthAction of my Error controller gets called. Example of URL's that are not working. http://www.example.com/course-details//1/Physics-Newtons-Law http://www.example.com/course-details/1//Physics-Newtons-Law Is there something I need to set in the route definition to allow extra slashes? Routing in application.ini resources.router.routes

Zend Framework: Get whole out output in postDispath while using Layout

旧时模样 提交于 2019-12-14 03:07:51
问题 I have a layout loader plugin which looks like this: class Controller_Action_Helper_LayoutLoader extends Zend_Controller_Action_Helper_Abstract { public function preDispatch() { $config = Zend_Registry::get("config"); $module = $this->getRequest()->getModuleName(); if (isset($config->$module->resources->layout->layout) && !$this->getRequest()->format) { $layoutScript = $config->$module->resources->layout->layout; $this->getActionController()->getHelper('layout')->setLayout($layoutScript); } }

How can I convert a Zend localization/translation array to gettext?

為{幸葍}努か 提交于 2019-12-14 02:46:03
问题 My multi-lingual site already successfully uses the "array" method of Zend translations. I want to convert from that method to the "gettext" method because I've read that gettext is superior. I've tried using http://docs.translatehouse.org/projects/translate-toolkit/en/latest/commands/php2po.html but can't get it to work. I think it's not meant to handle Zend arrays as the input. My Zend file (which works) looks like this: <?php return array( 'choose your favorite stores' => 'Choose your %1

How to debug a PHP file that is being called by AJAX?

若如初见. 提交于 2019-12-14 02:38:51
问题 I have a php file for uploading a picture (it uploads the picture, creates its thumbnail and also adds watermark to the picture). The file is being called by AJAX. It was working on on my localhost on Windows XP with WAMPSERVER 2.0. Now I have installed Windows Vista and suddenly it doesn't work properly (the picture gets uploaded but the thumbnail and watermark parts don't work). I'm using exactly the same software to test the application on my local machine (WAMPSERVER 2.0) yet it doesn't

Enable htpasswd in zend-framework project for a particular action/url or a controller

烂漫一生 提交于 2019-12-14 02:36:54
问题 I want to use password protection for a zend-framework project using .htpasswd. I am able to enable htpasswd in public/index.php i.e project entirely but what i want to achieve is enable password protection for a particular controller/action only. Say, I have a controller by name UserController and action editUserAction. And another controller by name PublicController with action listUserAction. What I want to achieve is enable password protection for usercontroller/edit-user action. i.e.