zend-framework

Possible to use Zend_Http_Client() and Zend_Rest_Client() together

好久不见. 提交于 2019-12-11 03:23:41
问题 I'm currently working on a REST client in PHP using Zend Framework and ran into a problem. I currently have two dummy services that I'm testing with; one is 'noauth' which requires no authentication and just returns some JSON, the other is 'auth' which required authentication and returns more specific JSON. Accessing both directly from the web works without a problem, for example navigating to 'https://example.org/example/dummy/noauth' displays the JSON on the webpage and 'https://example.org

Converting a Brownfield PHP Webapp to Zend Framework

落爺英雄遲暮 提交于 2019-12-11 03:12:14
问题 We're thinking of converting our PHP Webapp from using no framework (which is killing us) to use Zend Framework. Because of the size of the application I don't think starting from scratch is going to be a viable option for management so I wanted to start researching how to slowly convert from the current site structure to one using Zend Framework but there isn't a lot of information on this process. So far my plan is to dump the current code base into the public/ directory of the Zend

php design question - will a Helper help here?

[亡魂溺海] 提交于 2019-12-11 03:03:52
问题 I have to list several elements that are coming from a database source A and they are: team_id, team_name and team_score (translated for explanation sake). I need to loop over them, and display that information. So, I have, on the DAO side: public function listOfTeams() { $select = $this->select() ->from(array('t'=>'teams'), array('cod_team','name','score')); return $this->fetchAll($select); } On my team controller: public function listAction() { $teamsDao = new TeamsDao(); $this->view-

A 404 error occurred Page not found Zend skeleton application

自古美人都是妖i 提交于 2019-12-11 02:59:07
问题 I have installed the skeleton application on my system. Its working development server. But when I run the code localhost I am receiving error following type error: A 404 error occurred Page not found. The requested URL could not be matched by routing. No Exception available © 2005 - 2015 by Zend Technologies Ltd. All rights reserved. 回答1: You must also ensure that Apache is configured to support .htaccess files. This is usually done by changing the setting: 1 AllowOverride None to 1

Zend vs Symfony learning time

 ̄綄美尐妖づ 提交于 2019-12-11 02:49:14
问题 Is faster to learn Zend Framework or Symfony? Which framework has more and clear documentation? 回答1: I think both frameworks take some time to learn properly but you can't beat Symfony's documentation. 回答2: I think the documentation for both is clear enough. But somehow it seems to be, that ZF is simplier to learn because it constist of many loosely coupled classes. Symfony is more consistent to me and it's fundamental terms like "bundle" are a little bit more difficult to learn than those of

Failed to load Zend/Loader.php. Trying to work out why?

Deadly 提交于 2019-12-11 02:42:29
问题 I have inherited a client site which crashes every 3 or 4 days. It is built using the zend-framework with which I have no knowledge. The following code: <?php // Make sure classes are in the include path. ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . 'lib' . PATH_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'classes'); // Use autoload so include or require statements are not needed. require_once 'Zend/Loader.php'; Zend_Loader::registerAutoload(); // Run the application. App

Zend_Form_Element different render on different action

本秂侑毒 提交于 2019-12-11 02:38:31
问题 I created my own form element in Zend Framework. The only thing i would like to do is add a different functionality to the element when it's first created (so it's requested by the 'new' action), and other functionality when the element is rendered to be edited (requested by the 'edit' action). How do i do that? I couldn't find it in the documentation. This is my code: <?php class Cms_Form_Element_Location extends Zend_Form_Element { public function init() { App_Javascript::addFile('/static

Do I set my zend baseUrl manually?

早过忘川 提交于 2019-12-11 02:37:53
问题 I understand that baseUrls are mostly automatically set in zend projects, and they come in handy when running an app from a subfolder, But I'm running my app from the root public folder, with server-name myzend.loc . So when I do an echo $this->baseUrl() or var_dump($this->baseUrl()) , I get an empty string '' . Is this normal and a result of not running the app from a subfolder? or do I set baseUrl manually; eg $request->getHelper('baseUrl')->setBaseUrl($_SERVER['SERVER_NAME']); 回答1: The

ZF Autoloader to load ancestor and requested class

痴心易碎 提交于 2019-12-11 02:34:26
问题 I am integrating Zend Framework into an existing application. I want to switch the application over to Zend's autoloading mechanism to replace dozens of include() statements. I have a specific requirement for the autoloading mechanism, though. Allow me to elaborate. The existing application uses a core library (independent from ZF), for example: /Core/Library/authentication.php /Core/Library/translation.php /Core/Library/messages.php this core library is to remain untouched at all times and

phpunit test class not found error while class is there?

人盡茶涼 提交于 2019-12-11 02:34:08
问题 This is my directory Structure application ---modules ------admin ---------models -----------User.php This is my user Model class class admin_Model_User { //User.php } This is my UserTest Class with simple AssertType class admin_Model_UserTest extends PHPUnit_Framework_TestCase { public function testUserModel() { $testUser = new admin_Model_User(); $this->assertType("admin_Model_User",$testUser); } } When I run this. I am getting following Errors [tests]# phpunit PHPUnit 3.5.13 by Sebastian