zend-framework

Query builder using Zend Framework

你说的曾经没有我的故事 提交于 2019-12-06 08:37:05
I am just beginning my journey into PHP Zend Framework World. The aim of my application is to develop query builder using Zend. This application will be used by many users in a network at same time. When a user performing search based on some conditions provided by the application, the system will fetch the relevant search results from the large database (More than 50 Million Records or even more). Note: One user can perform multiple search requests at a time. Each request creates a unique queue id. Due to more load in the search result page, it will take some time to display the results. So,

Including a javascript file outside of doc root using zend framework

馋奶兔 提交于 2019-12-06 08:36:17
I'm trying to include a javascript file in a phmtl view script file using the zend framework. Both the javascript file and the phtml file are part of a php library and located outside the doc root folder of my project. So the file structure looks like /var/www/vhosts/project/ /var/www/vhosts/libraries/my-lib/view/viewscript.phtml /var/www/vhosts/libraries/my-lib/js/javascript.js /var/www/vhosts/libraries/my-lib has been added to the PHP paths using set_include_path. In viewscript.phtml, I use the following line to include javascript.js. <?php $this->headScript()->appendFile('js/javascript.js')

Error in Draw image on PDF using Zend Framework in Magento2

给你一囗甜甜゛ 提交于 2019-12-06 08:33:52
I am working on create a catalog PDF in Magento-2 using Zend Framework. My code is here to print catalog image on PDF. foreach ($collection as $product) { $image = $product->getImage(); $path = $mediaUrl."catalog/product".$image; $imagef = Zend_Pdf_Image::imageWithPath($path); // write image to page $page->drawImage($imagef, 50, 50, 400, 400); } But it did not work for me. 来源: https://stackoverflow.com/questions/48800875/error-in-draw-image-on-pdf-using-zend-framework-in-magento2

Phpunit skeleton generator cannot find extends class

↘锁芯ラ 提交于 2019-12-06 08:29:16
I have an application based on the Zend Framework that I am trying to use phpunit to generate skeletons for the test cases. Phpunit can't seem to find the parent classes of the classes I am trying to generate for: phpunit --skeleton-test Default_Model_Person ../application/models/Person.php PHPUnit 3.5.11 by Sebastian Bergmann. PHP Fatal error: Class 'X1_Db_Table_Auditable' not found in /path/to/application/models/Person.php on line 3 Fatal error: Class 'X1_Db_Table_Auditable' not found in /path/to/application/models/Person.php on line 3 So I have for example application/models/Person.php <

date not saving in mysql database

早过忘川 提交于 2019-12-06 08:28:08
I have a problem with saving a date in my MySQL database. To test everything: I am trying to save 2010-01-01 (for example) in a MySQL database. First I set my MySQL field to date. This didn't work. But when I set the field to a string type it does save date in the database. Why doesn't it work when I want to save a date into a date field? Although I think code isn't important here I will post it since it's requested. I use zf 1.9.6 class JS_Form_EventForm extends ZendX_JQuery_Form{ public function init($options=null){ //parent::__construct($options); $this->setName("newEvent"); $this-

How to preserve application.ini paths using Zend_Config_Writer_Ini

徘徊边缘 提交于 2019-12-06 08:07:20
问题 I'm currently working on a build system in Phing that takes a Zend Framework project template and configures it according to Phing parameters. One problem that I've come across is when using Zend_Config_Writer_Ini. My Phing task takes a pre-populated file from the repo called application.default.ini and modifies this using Zend_Config_Ini to add parameters from the build file (db details, etc). It then writes it to application.ini ready for the project to use. A simplified version of the

Need Help in zend framework URL Rewrite

孤者浪人 提交于 2019-12-06 07:59:36
I need help in URL rewrite in zend framework. If I print below URL : echo $this->url(array('controller'=>'guestbook','action'=>'edit','id'=>$entry->id), null, TRUE); It will generate url like : http://localhost/guestbook/public/index.php/guestbook/edit/id/1 But How can I generate url like : http://localhost/guestbook/public/index.php/guestbook/edit/1 in zend framework? I don't want 'id' in URL. Please Help. To make it work you need to define a custom route, called e.g. guestbook, and make url helper to use it for your particular url. For example, in your application.ini you can define it as

Updating Zend_Auth_Storage after edit users profile

痞子三分冷 提交于 2019-12-06 07:39:23
问题 I have following situation: I have loged user, standard authentication with DB table $authAdapter = new Zend_Auth_Adapter_DbTable(Zend_Db_Table::getDefaultAdapter()); $authAdapter->setTableName('users'); $authAdapter->setIdentityColumn('user_name'); $authAdapter->setCredentialColumn('password'); When user edits his profile, I save it into Db, but I need to update also storage (using standard Zend_Auth_Storage_Session). Is there any easy way how to do it? Many thanks. 回答1: Your best bet would

Make Zend_Rest_Server return JSON instead of XML using ZF

给你一囗甜甜゛ 提交于 2019-12-06 07:38:38
Can Zend_Rest_Server return Json ? If not, what are the alternatives ( other lib suggestions are ok also) Zend_Rest_Server outputs XML, eventhough not clearly specified in the documentation. There are some alternatives: You could leverage the whole MVC architecture given by Zend Framework, thanks to Zend_Rest_Route and Zend_Rest_Controller . You will find a complete example here: http://techchorus.net/create-restful-applications-using-zend-framework Again, the example displays plain string, but using json_encode , or Zend_Json::encode should return json. And finally, a complete (advanced)

Php Zend Framework : Connecting to multiple databases one at a time

流过昼夜 提交于 2019-12-06 07:32:43
I have written a script that goes through my application ini. The problem I am having now is that when I get to the next database, its still selecting from the first database and not the new one. Is it possible to close a connection and then open a new connection while running a script. Remember this is just a script I have no bootstrap set. I just setup a autoload to that I can load my models. While looping through sections of the ini try { $db = Zend_Db::factory($section->database->type, $section->database->toArray()); Zend_Db_Table::setDefaultAdapter($db); Zend_Registry::set('db', $db); }