zend-framework

Can I use Facebook's hiphop with frameworks like Zend Framework, cakephp, symfony

折月煮酒 提交于 2019-12-18 03:33:17
问题 Yesterday Facebook launched HipHop, a sourcecode-converter from php to c++. The set of php functions and constructions is more limited than in standard php. Are the current popular php frameworks (ZF, CakePHP, symfony) compatible with HipHop? If not, which parts of these frameworks are not usable? 回答1: If I'm not mistaken, HipHop has not been released yet -- even the wiki page linked from the Facebook annoucement yesterday is not up yet. So, it's going to be a bit hard to answer, right now. I

Zend Framework $this->baseUrl() always returns the current page :( why

ε祈祈猫儿з 提交于 2019-12-18 02:54:25
问题 check out this website www.fltdata.com. For some reason the home link no matter what page you go on instead of pointing to the home page it points to the current page. It works fine on my localhost but online its behaving like this. The href value of the home link is just : $this->baseUrl() Whats wrong here.. === EDIT=== Well I have created a helper which is as below: class Zend_View_Helper_BaseUrl { protected $_baseUrl; function __construct() { $fc = Zend_Controller_Front::getInstance();

Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?

一世执手 提交于 2019-12-18 02:37:36
问题 I have several view Partials (like paginator partial) which I want them to be available To all view scripts in my application. Is there a directory I can put partial vies in, and they will be available to all? Or, how do I define such a directory? 回答1: You can create a folder in the views folder with any name and from your views you would call a partial using the following code and as the second argument pass an array of values which would be used within the partial. $this->partial('your

Best way to start using jQuery in a Zend Framework 1.9 application?

不羁岁月 提交于 2019-12-17 21:52:21
问题 I want to get started working with jQuery in my Zend Framework application but not sure which is the best way to get started. I know I could include the jQuery library just like any other javascript library, but what are the advantages of using ZendX_JQuery, and what are the steps necessary to start using it in my Zend Framework 1.9 application? 回答1: I was able to get jQuery working in my 1.9.4 project by following these steps: Step 1: Copy the ZendX directory to your library directory. ZendX

Zend Server Windows - Authorization header is not passed to PHP script

元气小坏坏 提交于 2019-12-17 21:32:06
问题 I have a PHP application which needs to perform HTTP Basic authentication independently of the containing Apache server. On linux machines, with php installed via apt-get php , I find that the Authorization header does not appear in $_SERVER , but is available via apache_request_headers() or getallheaders() . On a Windows development machine, with Zend Server 6.1.0 / PHP 5.4, I am unable to get the Authorization header value from inside PHP by any of the above methods. How can I get its value

Zend Studio reports warning: Assignment in condition. Is this so bad?

戏子无情 提交于 2019-12-17 20:07:22
问题 I have recently started using Zend Studio which has reported as warning the following type of code: $q = query("select * from some_table where some_condition"); while ($f = fetch($q)) { // some inner workings } To stop the warning the code needs to be written like this: $q = query("select * from some_table where some_condition"); $f = fetch($q); while ($f) { // some inner workings $f = fetch($q); } Why is this marked as a warning? Is it so bad? I understand that the warning may be designed to

pcntl_fork and the MySQL connection is gone

心已入冬 提交于 2019-12-17 19:32:50
问题 I have a foreach loop that forks within it. After the process forks, it accesses the database. I get an error: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away The thing is, I'm connecting to the database after I've forked. My question: Why would this be happening? If this happens, am I actually accessing the database before forking? Will the child inherit DB connections? (note: I can post code, but it's rather large as it's all in classes, which could be what is causing my

Change layout in the controller of Zend Framework 2.0

ぃ、小莉子 提交于 2019-12-17 19:13:08
问题 I am learning ZF2.0 beta . In ZF1 we can change layout on the fly in controller: Zend_Layout::getMvcInstance()->setLayout('layoutname'); But in ZF2.0 Zend\Layout class doesn't has method getMvcInstance(). I think that it can be made using dependency injections but not sure. 回答1: The ZF2 is heavily under development and no guarantee can be made the way it works now, will be the way it works when ZF2 reaches a stable state. However, the new view layer from Zend\Mvc is recently merged so you

Zend Mail Gmail SMTP

限于喜欢 提交于 2019-12-17 18:59:06
问题 Hi I'm trying to send some emails via gmail from the Zend_Mail module. This is my code: $config = array( 'ssl' => 'tls', 'port' => 587, 'auth' => 'login', 'username' => 'webmaster@mydomain.com', 'password' => 'password' ); $smtpConnection = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config); Error: Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in /library/Zend/Mail/Protocol/Smtp.php on line 206 Unable to connect via TLS I tried telling

Optimising the Zend Framework

天涯浪子 提交于 2019-12-17 17:46:36
问题 I'm trying to get as much performance as I can out of my application, which uses the Zend Framework. I'm considering using the Zend Server, with APC enabled. However, I need to know a few things first. Is there any benefit of using Zend Server + Zend Framework, or should I just use any ordinary system to host this? Shamil 回答1: My tips for faster ZF (try from top to bottom): Optimize include path zend path first models next rest at the end Use PHP 5.5 with OPCache enabled [NEW] I can't stress