zend-framework

Zend -> Warning: is_readable() [function.is-readable]: open_basedir restriction in effect

♀尐吖头ヾ 提交于 2019-12-09 18:32:06
问题 I am getting the following warning in my code: Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/share/php/./views/helpers/Doctype.php) is not within the allowed path(s): (/var/www/virtual/example.com/:/usr/share/pear/) in /var/www/virtual/example.com/htdocs/rockhopper-v2/library/Zend/Loader.php on line 198 or Warning: is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/share/php//var/www/virtual/example.com/htdocs

Zend response application/json utf-8

自古美人都是妖i 提交于 2019-12-09 18:29:32
问题 usually in a xhr action I use this code $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $response = $this->getResponse(); $response->setHeader('Content-type', 'application/json', true); return $response->setBody(Zend_Json::encode($data)); I'm wondering if it need utf-8 encoding like this $response->setHeader('Content-type', 'application/json;charset=UTF-8', true); 回答1: It would be good practice to do so. You may not see any problems if you don't. It

odd Zend_Form_Element_File behavior

…衆ロ難τιáo~ 提交于 2019-12-09 17:21:18
问题 I have the following element in my form: $attachment = new Zend_Form_Element_File('attachment'); $attachment->setLabel('Attach File (2MB Max)'); $attachment->addValidator('Count', false, 1); $attachment->addValidator('Size', false, 2048000); If I print the entire form in the view, this field works fine. However I have some very custom HTML that I'm using for display, so I am echoing out each form element like this in my view: <?=$this->form->attachment?> This works fine for other fields.

Automatically joining tables without breaking default behaviour in Zend Framework

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-09 17:17:45
问题 The situation is as follows: I've got 2 models: 'Action' and 'User'. These models refer to the tables 'actions' and 'users', respectively. My action table contains a column user_id . At this moment, I need an overview of all actions, and the users to which they are assigned to. When i use $action->fetchAll() , I only have the user ID, so I want to be able to join the data from the user model, preferably without making a call to findDependentRowset() . I thought about creating custom fetchAll(

Router_Route with optional parameters

孤者浪人 提交于 2019-12-09 16:35:51
问题 I have the following route: $gridRoute = new Zend_Controller_Router_Route( ':module/:controller/list/:order/:dir/:page', array ( 'module' => 'default', 'controller' => 'index', 'order' => '', 'dir' => 'asc', 'page' => 1, 'action' => 'list' ), array ( 'page' => '\d+' ) ); $router->addRoute('grid', $mainRoute->chain($gridRoute)); I would like to be able to add an optional parameter 'filter' to this route. So I could use the following url: http://example.org/default/list/filter/all/lname/asc/1

How to do MySQL IN clauses using Zend DB?

試著忘記壹切 提交于 2019-12-09 16:28:33
问题 I'm trying to fetch rows that are in an array of integers that I have using Zend Framework 1.11. $this->dbSelect ->from($table_prefix . 'product_link') ->joinLeft($table_prefix . 'product_link_name', $table_prefix . 'product_link.product_link_name_ref_id = ' . $table_prefix . 'product_link_name.product_link_name_id') ->where('product_ref_id IN (?)', implode(', ', $product_ids)); When I use the __toString() method of $this->dbSelect , I get SELECT `phc_distrib_product_link`.*, `phc_distrib

Customize zend_form Captcha output?

感情迁移 提交于 2019-12-09 15:42:26
问题 I'm using captcha in my zend_form. $captcha_element = new Zend_Form_Element_Captcha( 'captcha', array('label' => 'Write the chars to the field', 'captcha' => array( 'captcha' => 'Image', 'wordLen' => 6, 'timeout' => 300, 'font' => DOC_ROOT . '/data/fonts/Vera.ttf', 'imgDir' => $imagedir, 'imgUrl' => $umageurl ) ) ); This generates: <dt id="captcha-input-label"> <label for="captcha-input" class="required">Write the chars to the field</label> </dt> <dd id="captcha-element"> <img width="200"

How to retrieve parameters from Zend application.ini file during the session? [duplicate]

你离开我真会死。 提交于 2019-12-09 15:18:10
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How could read application.ini on controller using zend framework application.ini is a configuration file in ZF. I have there some more settings than just those defaults that ZF manual writes about. But how may I retrieve those parameters from it from my action controllers for example? And where is it better to store this config during the session? The Bootstrap_Abstract class has getOptions() method which

How Can I Write Zend Framework URLs That Have Anchor Tags In The Body?

拜拜、爱过 提交于 2019-12-09 14:59:55
问题 Using the standard MVC set up in Zend Framework, I want to be able to display pages that have anchors throughout. Right now I'm just adding a meaningless parameter with the '#anchor' that I want inside the .phtml file. <?= $this->url(array( 'controller'=>'my.controller', 'action'=>'my.action', 'anchor'=>'#myanchor' )); This sets the URL to look like /my.controller/my.action/anchor/#myanchor Is there a better way to accomplish this? After navigation to the anchor link, the extra item parameter

How to limit file upload speed in php or apache?

对着背影说爱祢 提交于 2019-12-09 14:57:01
问题 I'm doing some form in Zend Framework for file upload on "Apache friends - xampp" server 1.7.1 on Ubuntu 9.10. My problem is that I what to add progress bar for this upload and since xampp server is on my localhost, file uploads are very fast. As a result, I have no time to check or observer if progress bar works as it should. Is there an easy way (some option in PHP, Zend Framework or Apache) to reduce the file upload speed to e.g. 20kB/s. I tried to use mod_bw for Apache but it seems that