zend-framework

List all Files in a S3 Directory with Zend Framework

老子叫甜甜 提交于 2019-12-25 18:16:50
问题 How I can list all files in an Amazon S3 Directory of a Bucket in PHP (and maybe with a helper from Zend Framework)? 回答1: See example #5: http://framework.zend.com/manual/en/zend.service.amazon.s3.html getObjectsByBucket($bucket) returns the list of the object keys, contained in the bucket. $s3 = new Zend_Service_Amazon_S3($my_aws_key, $my_aws_secret_key); $list = $s3->getObjectsByBucket("my-own-bucket"); foreach($list as $name) { echo "I have $name key:\n"; $data = $s3->getObject("my-own

Why my site is always using the ErrorController for all types of errors irrespective of HTTP Status code?

拟墨画扇 提交于 2019-12-25 18:14:17
问题 We've been running a Zend Framework e-commerce site for years. It hasn't used the MVC structure 100% but we try to progress it towards a "better" coding structure as we perform new upgrades on the site and so on. Recently we made some significant changes to the site as well. As there are multiple developers this issue is a little difficult to track, but I'm writing here to get any kind of help or advice. On our previous site, our ErrorController was used to simply do a 301 redirect to a

Zend Framework Unit Test fails on assertResponseCode(200)

北慕城南 提交于 2019-12-25 16:42:48
问题 I am running some unit test on my Zend Framework application. What I cant understand is that the following test fails: public function testCreateFaqItem() { $this->LoginUser(); $this->dispatch('/faq/admin-faq/create'); var_dump($this->getResponse()); $this->assertResponseCode(200); $this->assertQueryContentContains('h1', 'Create'); $this->assertController('admin-faq'); $this->assertAction('edit'); } it fails if on assertResponseCode(200), when i remove the assertResponseCode(200), the test

Zend framework -> database table field prefix like users.us_name

你说的曾经没有我的故事 提交于 2019-12-25 14:06:43
问题 I'm dealing with database containing of many tables, with many field prefixes (two first letters of every table), so when I have users table I cannot use "name" property ($user->name) but I can use: $user->us_name. I's there a way to simplify things and set automagic prefix for every field of a table ? 回答1: You'd have to extend Zend_Db_Table_Row to accomplish this. Fortunately, ZF includes a _transformColumn() method expressly for this purpose. But I'm getting ahead of myself. First, set up

require_once missing doctrine zend framework

假如想象 提交于 2019-12-25 12:10:03
问题 I'm integrating doctrine with Zend Framework. I've hit an error thrown from cli. It seems Zend_Application_Bootstrap_Bootstrap does not have a require_once for Zend_Application_Bootstrap_BootstrapAbstract. Has anyone hit this? my cli-config.php <?php $classLoader = new \Doctrine\Common\ClassLoader('App', __DIR__ . "/../application/models"); $classLoader->register(); $classLoader = new \Doctrine\Common\ClassLoader('Cms', __DIR__ . "/../application/modules/cms-modules/models"); $classLoader-

require_once missing doctrine zend framework

倾然丶 夕夏残阳落幕 提交于 2019-12-25 12:09:40
问题 I'm integrating doctrine with Zend Framework. I've hit an error thrown from cli. It seems Zend_Application_Bootstrap_Bootstrap does not have a require_once for Zend_Application_Bootstrap_BootstrapAbstract. Has anyone hit this? my cli-config.php <?php $classLoader = new \Doctrine\Common\ClassLoader('App', __DIR__ . "/../application/models"); $classLoader->register(); $classLoader = new \Doctrine\Common\ClassLoader('Cms', __DIR__ . "/../application/modules/cms-modules/models"); $classLoader-

WHERE IN sql query using Zend_Db

好久不见. 提交于 2019-12-25 11:52:30
问题 Zend Framework beginner here. I'm trying to fetch all the Xbox titles of a video game database. One table contains games. Another table contains game types (ie. Xbox, Xbox Live Arcade, ...). I normally use the following query to get the Xbox titles. How can I execute the same query using Zend_Db? Thanks, SELECT titleGame FROM Game WHERE idGameType IN ( SELECT idGameType FROM GameType WHERE nameGameType = 'Xbox') 回答1: That could be rewritten in Zend Framework a few ways. Here is the way I

WHERE IN sql query using Zend_Db

只谈情不闲聊 提交于 2019-12-25 11:52:20
问题 Zend Framework beginner here. I'm trying to fetch all the Xbox titles of a video game database. One table contains games. Another table contains game types (ie. Xbox, Xbox Live Arcade, ...). I normally use the following query to get the Xbox titles. How can I execute the same query using Zend_Db? Thanks, SELECT titleGame FROM Game WHERE idGameType IN ( SELECT idGameType FROM GameType WHERE nameGameType = 'Xbox') 回答1: That could be rewritten in Zend Framework a few ways. Here is the way I

How to set different layouts for different modules in Zend Framework 3

℡╲_俬逩灬. 提交于 2019-12-25 09:18:44
问题 How can I set different layouts for different modules in Zend Framework 3 instead of using single one same layout template all around the site? 回答1: 

Zend Framework - Issue 
> You may want to alter the layout based on the current module. This requires (a) detecting if the controller matched in routing belongs to this module, and then (b) changing the template of the View Model. 

 The place to do these actions is in a listener. It should listen either to the “route” event at low (negative)

Joining-Table with Metadata Impairs Getters/Setters - Doctrine 2

我的梦境 提交于 2019-12-25 09:00:24
问题 I'm writing a feature which calls for the records of my joining table to carry extra metadata ( Joining-Table with Metadata ). I've attempted to implement this in accordance with this section of the Doctrine documentation. See below for example Entity definitions. The challenge now is that getGroups and setGroups do not yield/set Group entities (& the same is true from the Group instance perspective), but they yield GroupUser entities. This adds a substantial delay to process of managing this