zend-framework

Installing Zend Framework After Xampp

这一生的挚爱 提交于 2019-12-06 07:26:26
问题 I am running Windows 7 and am using Xampp. I would like to install the Zend framework for PHP, but I am having difficulties understanding how to install it. I have used the Zend framework before, but it was already installed on the Linux system I was working on. I am reading through the Zend documentation here: http://framework.zend.com/manual/en/learning.quickstart.create-project.html I am having trouble with updating the includes_path portion. My original include path was include_path = ".

Magento refresh cache on plugin save

瘦欲@ 提交于 2019-12-06 07:26:17
I have written a simple Magento plugin that simply lists all sub categories that are enabled from a given parent id. The user simply selects a parent category id from the admin using the plugin tab i have created. To speed things up i have added block caching to the plugin using the following code $this->addData(array( 'cache_lifetime' => 86400, 'cache_tags' => array(Mage_Catalog_Model_Category::CACHE_TAG) )); This works well so far, as if a sub category is enabled / disabled the cache invalidates and is replaced. However if i change the parent category id in the admin changes are not seen

Getting request Authorization header in ZF2 controller

前提是你 提交于 2019-12-06 07:23:08
问题 I am using ZF2 and for some reason, I can get all the headers I send EXCEPT the Authorization header - it's like its filtered out. I am trying to get all the headers in the controller like this: public function createAction($data) { $request = $this->request; print_r ($request->getHeaders()); exit(); } I send the request through cURL like this: curl -i -H "Accept: test" -H "Authorization: 123456" -H "Content-Type: qwerty" -X POST http://localhost/test All headers prints out EXCEPT

Throwing exceptions from model/view/controller in a Zend Framework application

隐身守侯 提交于 2019-12-06 07:05:06
问题 In the Zend Framework library, the current practice (circa 1.10.8) is that library components throw exceptions that extend Zend_Exception . E.g. the Zend_Layout component throws a Zend_Layout_Exception In my own ZF library, where I'm adding my own ZF components or extending existing components, I'm throwing a Mylibrary_Exception (it's not really called that of course :) I can see that they're going to change some of that in ZF 2.0 http://framework.zend.com/wiki/display/ZFDEV2/Proposal+for

Zend 1.11.11 Doctrine 2.1.2 initialising of associative proxy entities

蹲街弑〆低调 提交于 2019-12-06 06:58:06
I am having this strange issue with an associative entity being a proxy class and its methods always returning null. I hope someone can shed a little light on the subject because it's driving me insane. I am calling this code: $arrRoleResources = $em->getRepository("AJFIT\Entity\UserRoleResources")->findAll(); foreach($arrRoleResources as $roleResource) { $name = $roleResource->getRoleFk()->getName(); } The $name will always be null even though when I debug the code it initializes the proxy class and the $_identifier is with the correct primary key. UserRoleResources Entity: namespace AJFIT

zend models architecture

孤街醉人 提交于 2019-12-06 06:31:52
问题 Let's say I have two tables in a database: projects and users. I create two models, that extend Zend_Db_Table_Abstract: Model_DbTable_Users and Model_DbTable_Projects . Now, is it a good pattern to create an instance of Model_DbTable_Projects inside the Model_DbTable_Users class ? In other words: is it OK to put any logic in this model, or should I create another class, that uses Model_DbTable_Users and Model_DbTable_Projects ? I use to put all the logic in models, that extend Zend_Db_Table

How to emulate POSTing multiple checkbox form fields myField[] with Zend_Http_Client?

风格不统一 提交于 2019-12-06 06:13:29
I am using Zend_Http_Client to POST a set of data to my server running PHP. However, the server is expecting data in the form myField[] , i.e. I have a set of check boxes and the user can check more than one. My current code is: foreach ($myValues as $value) { $this->client->setParameterPost('myField[]', $value); } However, it seems that Zend_Http_Client is simply overwriting myField[] with the new value each time it goes through the loop. How can I add multiple POST fields of the same name using Zend_Http_Client? UPDATE I have actually figured out a way to do this, by hacking the Zend_Http

Why DOCUMENT_ROOT is different than realpath('.') on remote server

纵然是瞬间 提交于 2019-12-06 06:08:07
with echo realpath('.').'<br>'; echo dirname(__FILE__).'<br>'; echo realpath(dirname(__FILE__)).'<br>'; echo $_SERVER[PHP_SELF].'<br>'; echo getcwd(); I get always /services2/webpages/util/i/g/gg8375620.provider.com.br/mydomain.com/public but in phpinfo DOCUMENT_ROOT is /services/webpages/l/i/mydomain.com/public because of that I'm having hard times with .htaccess in conjunction with Zend Framework. On my local I'm able to make it work. But on the provider host I could not grasp the magic yet. EDT: I put $_SERVER['DOCUMENT_ROOT'] = realpath($_SERVER['DOCUMENT_ROOT']); on the index file but got

Zend OAuth with twitter single access tokens

北城以北 提交于 2019-12-06 05:59:01
问题 I'm developing an application where it requires users to sign in using twitter and OAuth. Everything works just fine thanks to Zend_OAuth. The problem is that the web app will also make some calls to the twitter API but these will be handled internally without the need of authenticating. Twitter Dev provides an 'access_token' and 'access_token_secret' keys for this purpose (Mentioned here http://dev.twitter.com/pages/oauth_single_token ) The problem is that I can't get Zend_OAuth to play nice

Passing an array as a value to Zend_Filter

a 夏天 提交于 2019-12-06 05:53:15
I'm trying to implode an array by using the Zend_Filter_Interface. Here's my simplified test case. class My_Filter_Implode implements Zend_Filter_Interface { public function filter($value) { return implode(',', $value); } } The input will be an array. $rawInput = array('items' => array('a', 'b', 'c')); $validators = array( 'items' => array() ) $filters = array( 'items' => 'Implode' ); $filterInput = new Zend_Filter_Input($filters, $validators, $rawInput, $options); I would like the filter to transform array('a', 'b', 'c') to a string 'a,b,c'. It is instead applying the filter to each item in