zend-framework

Issue activating a php extension using PHP Farm

核能气质少年 提交于 2019-12-30 11:42:06
问题 I am implementing a software (Getsy) that requires PHP 5.4 and ZendGuard 6 (ZendGuard). For the occasion I am using an AWS Instance of Ubuntu 14.04. As Ubuntu 14.04 comes with PHP 5.5+ by default, I needed to install PHP 5.4. To do that I installed PHP Farm. To change PHP versions among sites I have this cgi-bin script: #!/bin/sh PHP_FCGI_CHILDREN=3 export PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=5000 export PHP_FCGI_MAX_REQUESTS exec /opt/phpfarm/inst/bin/php-cgi-5.4.30 For my specific site

Mysql Query with mysql variable not working in Zend Framework 1

落花浮王杯 提交于 2019-12-30 11:38:06
问题 Zend config is : resources.db.adapter = "pdo_mysql" the query that gets Message: SQLSTATE[HY000]: General error $db = Zend_Db_Table::getDefaultAdapter(); $db->setFetchMode(Zend_Db::FETCH_ASSOC); $qry = $db->fetchAll(" SET @rank = 0 ; SELECT @rank := @rank +1 AS rank, SUM(user_scoring_data.user_points) AS user_points, league_team.user_id FROM league_team RIGHT JOIN user_scoring_data ON league_team.league_team_id = user_scoring_data.league_team_id WHERE league_id = '$league_id' GROUP BY user

Zend_Auth setCredentialTreatment

邮差的信 提交于 2019-12-30 08:29:09
问题 I'm using Zend_Auth with setCredentialTreatment to set the hash method and salt. I see all examples doing something like this, where the salt seems to be inserted as a text. ->setCredentialTreatment('SHA1(CONCAT(?,salt))' but my salt is stored in the database. I could retrieve it first then use it in setCredentialTreatment but is there a way I could define it directly as a field name, so setCredentialTreatment would know to get it from that field? sort of like the way we define the field name

How to destroy a specific PHP session

风流意气都作罢 提交于 2019-12-30 07:24:11
问题 I am looking for insights into how to destroy a specific session in PHP. Through a partner website a user logs into the main website using a token and obtains a full session. It is also possible for the partner website to call a destroy function if the user logouts from the partner website. We should then also log out our own user. What is the best approach to this? The Zend_Session destroy method does not accept a parameter, similarly the PHP function session_destroy does neither. I am

Zend framework's getRequest()->getQuery() won't bring query string on localhost

十年热恋 提交于 2019-12-30 06:47:48
问题 I have the following code, which works fine on live site, but not on localhost. $status = $this->getRequest()->getQuery('status'); I have a URL like this: http://localhost:888//questions/ask?status=10 I printed the value of status, which is always nil. I am new to Zend framework and could not find a solution to this on net, looks strange to me. Any thoughts? Thanks. [FIXED] I had wrong RewriteRule that caused the problem. There was an unwanted '?' after index.php in RewriteRule line. It was

ZEND, rendering different view with data

六眼飞鱼酱① 提交于 2019-12-30 06:26:09
问题 I have a problem as I want to render view from different controller and pass there datas. Do You know how to do it? I was trying: $this->renderScript('index/index.phtml')->entries = $result; But my if: if (count($this->entries) <= 0) return 0 Do You know how to do it? THANKS! 回答1: Do you mean you just want to render a different controller action's view script? $this->view->entries = $result; $this->_helper->viewRenderer('index/index', null, true); Check out the manual page for the

ZEND, rendering different view with data

匆匆过客 提交于 2019-12-30 06:26:07
问题 I have a problem as I want to render view from different controller and pass there datas. Do You know how to do it? I was trying: $this->renderScript('index/index.phtml')->entries = $result; But my if: if (count($this->entries) <= 0) return 0 Do You know how to do it? THANKS! 回答1: Do you mean you just want to render a different controller action's view script? $this->view->entries = $result; $this->_helper->viewRenderer('index/index', null, true); Check out the manual page for the

Zend Framework: Getting request object in bootstrap

社会主义新天地 提交于 2019-12-30 05:57:55
问题 How do I get the request object from inside the bootstrap file? I can try this methods but not work. $request= new Zend_Controller_Request_Http(); $request = Zend_Controller_FrontController::getInstance()->getRequest(); 回答1: If you really want to, you may achieve this calling: public function _initRequest() { $this->bootstrap('frontController'); $front = $this->getResource('frontController'); $front->setRequest(new Zend_Controller_Request_Http()); $request = $front->getRequest(); } However,

How to change Zend_Db_Table name within a Model to insert in multiple tables

江枫思渺然 提交于 2019-12-30 05:26:34
问题 Using Zend Framework, I've created a Model to insert a record into a database. My question is, after $this->insert($data) how can I switch the active table so that I can insert a record into another table? Here's my code so far: class Model_DbTable_Foo extends Zend_Db_Table_Abstract { protected $_name = 'foo'; public function addFoo($params) { $data = array( 'foo' => $params['foo'], ); $this->insert($data); $foo_id = $this->getAdapter()->lastInsertId(); $data2 = array( 'bar' => $params['bar']

Why return $this in setter methods?

若如初见. 提交于 2019-12-30 03:49:10
问题 Examining Zend Framework, I found that all setter methods (of those I’ve examined) return the instance of the class it lives in. It doesn't only set a value but also returns $this . For example: /* Zend_Controller_Router */ public function setGlobalParam($name, $value) { $this->_globalParams[$name] = $value; return $this; } /* Zend_Controller_Request */ public function setBaseUrl($baseUrl = null) { // ... some code here ... $this->_baseUrl = rtrim($baseUrl, '/'); return $this; } /* Zend