zend-framework

Apache stuck with working after Xdebug was installed. Ioncube loader error

六月ゝ 毕业季﹏ 提交于 2019-12-22 07:54:10
问题 I have a local installation of Ubuntu Server 12.10 via VirtualBox for my PHP programming purposes. Recently I've installed the Xdebug in this way: sudo apt-get install php5-xdebug Then added 'xdebug' path to my /etc/php5/apache2/php.ini: zend_extension=/usr/lib/php5/20100525+lfs/xdebug.so Then I restarted apache. And, it got stuck. My local sites are not loading. The 'php -v' (as well as 'php -m') says: PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini

How Zend DB Manage Database Connections

半世苍凉 提交于 2019-12-22 06:41:02
问题 I am using Zend Framework for my PHP developments and here is a small function I used to execute a query. This is not about an error. The code and everything works fine. But I want to know some concept behind this. /** * Get dataset by executing sql statement * * @param string $sql - SQL Statement to be executed * * @return bool */ public function executeQuery($sql) { $this->sqlStatement = $sql; if ($this->isDebug) { echo $sql; exit; } $objSQL = $this->objDB->getAdapter()->prepare($sql); try

Magento: Get Collection of Order Items for a product collection filtered by an attribute

大憨熊 提交于 2019-12-22 05:58:59
问题 I'm working on developing a category roll-up report for a Magento (1.6) store. To that end, I want to get an Order Item collection for a subset of products - those product whose unique category id (that's a Magento product attribute that I created) match a particular value. I can get the relevant result set by basing the collection on catalog/product. $collection = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToFilter('unique_category_id', '75') ->joinTable('sales/order

Zend_Validate_Db_RecordExists against 2 fields

為{幸葍}努か 提交于 2019-12-22 05:41:22
问题 I usualy use Zend_Validate_Db_RecordExists to update or insert a record. This works fine with one field to check against. How to do it if you have two fields to check? $validator = new Zend_Validate_Db_RecordExists( array( 'table' => $this->_name, 'field' => 'id_sector,day_of_week' ) ); if ($validator->isValid($fields_values['id_sector'],$fields_values['day_of_week'])){ //true } I tried it with an array and comma separated list, nothing works... Any help is welcome. Regards Andrea 回答1: To do

Zend_Validate_Db_RecordExists against 2 fields

那年仲夏 提交于 2019-12-22 05:41:10
问题 I usualy use Zend_Validate_Db_RecordExists to update or insert a record. This works fine with one field to check against. How to do it if you have two fields to check? $validator = new Zend_Validate_Db_RecordExists( array( 'table' => $this->_name, 'field' => 'id_sector,day_of_week' ) ); if ($validator->isValid($fields_values['id_sector'],$fields_values['day_of_week'])){ //true } I tried it with an array and comma separated list, nothing works... Any help is welcome. Regards Andrea 回答1: To do

Zend Framework: How to 301 redirect old routes to new custom routes?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 05:13:36
问题 I have a large list of old routes that I need to redirect to new routes. I am already defining my custom routes in the Bootstrap: protected function _initRoutes() { $router = Zend_Controller_Front::getInstance()->getRouter(); $oldRoute = 'old/route.html'; $newRoute = 'new/route/*'; //how do I add a 301 redirect to the new route? $router->addRoute('new_route', new Zend_Controller_Router_Route($newRoute, array('controller' =>'fancy', 'action' => 'route') )); } How can I add routes that redirect

Sending cookie with http post android

好久不见. 提交于 2019-12-22 04:58:18
问题 Hello guys I'm trying to send a cookie with http post in android here's my code webUrl = "XXXXXX"; webView = (WebView) findViewById(R.id.webview); try { CookieStore cookieStore = new BasicCookieStore(); Cookie cookie = new BasicClientCookie("session_id", "1234"); cookieStore.addCookie(cookie); DefaultHttpClient httpclient = new DefaultHttpClient(); BasicHttpContext mHttpContext = new BasicHttpContext(); mHttpContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore); HttpGet httpget = new

adding img tag in zend form

隐身守侯 提交于 2019-12-22 04:37:07
问题 I'm building a form with a class extending Zend_Form.How can I add an img tag inside the form?I also need to add a class to it and align attribute This is the final result I want to achieve: <span class="myElement"><img src="myPath" align="middle" class="myClass"/> <input type="text"></span> I didnt find much about Zend_Form_Element_Image's documentation thanks Luca 回答1: Have in library/Application/Form/Element/Img.php class Application_Form_Element_Img extends Zend_Form_Element_Xhtml {

Zend Framework HTTPS URL

旧街凉风 提交于 2019-12-22 04:17:11
问题 Is there any more or less standard way to specify a route that would create URL's with explicitly specified scheme? I've tried the solution specified here but it's not excellent for me for several reasons: It doesn't support base url request property. Actually rewrite router ignores it when URL scheme is specified explicitly. It's needed to specify separate static route for each scheme-dependent URL (it's not possible to chain module route with hostname route because of base url is ignored).

last insert id with zend db table abstract

巧了我就是萌 提交于 2019-12-22 01:40:46
问题 variable $tablemodel in an instance of a model which extends Zend_Db_Table_Abstract , if i do $tablemodel->insert($data) to insert data. Is there any method or property to get last insert id? regards 回答1: try $id = $tablemodel->insert($data); echo $id; 回答2: $last_id = $tablemodel->getAdapter()->lastInsertId(); 回答3: you can use lastInsertId Method echo 'last inserted id: ' . $db->lastInsertId(); 回答4: $insert_id = $this->db->getLastId() worked for me 回答5: user after insert query $this-