PHP - Should I Continue To Learn Zend Framework
I have spent the last few days going over Zend framework 2, and I am finding it extremely complex. Not saying it shouldn't be, but it seems to solve problems I never have come across (so to speak) .
For instance:
Routing is super complex. I usually use torophp - which is simple & gets the job done.
Dependency injection - example of problem I have never come across.
My motivations for learning zend, are -
1. To write modular reuseable code.
2. Learn advanced / modern PHP , as far as frameworks are concerned I just know codeigniter.
3. A framework with good long term support.
Is there some other framework that is easier to learn ? and that would satisfy my requirements ?
I have been programming in PHP for the last 2-3 years btw, so I know my way around
Thanks
Edited by nik_jain, 31 August 2014 - 09:56 AM. Similar TutorialsThis topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=347122.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=328743.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=324009.0 I can't figure out how to optimize my Zend framework performance. My query executes in 200ms but my page is taking almost 60 seconds to load. While checking the zend toolbar it shows that my page size is 14mb and I don't know why. The routes and options size is really large but I don't know what is causing this. Any ideas?
To see the full breakdown:
http://awesomescreen....com/0c73vewycc
This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=319964.0 I don't think php is installed/enabled?! Should one learn object oriented programming first, before getting to learn a framework?
I have been interested in CakePHP.
hello i need someone to take a look on this , General comments on the code process and how should i continue !!! [attachment deleted by admin] hi i am stuck in a loop please can someone check what is miss. I wants to quit from loop and go to next title if that tile is found but cant figure out how should i go. my code: $feed_url = "http://www.myfeed.com/feed/"; $xml = simplexml_load_file($feed_url); foreach ($xml->channel->item as $item) { $ns_content = $item->children('http://purl.org/rss/1.0/modules/content/'); $title = $item->title; // opening file which contain titles already $content = file('file.txt'); foreach ($content as $aline) { if (strstr($title, $aline)) { $found = true; } } // i dont wants to print that $title which is already in file.txt so loop continue. if($found) { continue; } echo $title . "<br>" ; } Problem is with that continue statement if a title is matched from file.txt it will display me nothing, i only wants to skip that title and echo other titles. thanks for any help Help...I almost had this but I included the password field in my form now it is not working. What was happening before I had all the tested members added to the Welcome page at once. When I put in the password field it is not welcoming anyone so sessions is not operating. // Get the user session id variable into a local php variable for easier use in scripting $id = $_SESSION['id']; // Now let's initialize vars to be printed to page in the HTML section so our script does not return errors // they must be initialized in some server environments $firstname = ''; $lastname = ''; $country = ''; $email = ''; //Formulate Query //This is the best way to perform an SQL query $query = "SELECT id, firstname FROM `Members` WHERE id='$id'"; $result = mysql_query($query); //Check result //This shows the actual query sent to MySQL and the error. Useful for debugging. if(!$result){ $message = 'Invalid query:' . mysql_error() . "\n"; $message .= 'Whole query:' . $query; die($message); } //Use result //Attempting to print $result won't allow access to information in the resource //One of the mysql result functions must be used //See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc. while($row=mysql_fetch_assoc($result)){ echo "Welcome, {$row[firstname]}"; } //Free the resources associated with the result set mysql_free_result($result); At one point it when it was including everyone all at once it was able to view the private pages but the new update password takes me back to square one. It was showing a error message with SQL " after the WHERE clause where I had the id={$_SESSION['id']} so I just tested to see how the codes id='$id' would work and it does not have the echo Welcome, firstname. these codes are very tricky. By calling function two will it break the loop?; or do i have to echo what is returned? Code: [Select] functione one() { $getids = mysql_query("SELECT * FROM table"); while($row=mysql_fetch_assoc($getids); { $this->two(); } } function two() { return 'break;'; } im building a form in php and is their away to have a submit or continue button on the same page so if ya want to fill in more it will go to the next page if not it will e-mail the info This topic has been remastered in brilliant HD quality in JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=356870.0 i'm need to retrieve a session after i've collected the data and went to PayPal (...urk...) i think i'm starting off correctly... but how the hell do i get the session name on the other side? Code: [Select] $uuid = uniqid(); session_name = $uuid; session_start(); // do some stuff // go to PayPal // come back from PayPal ....um... now i'm lost! how do i get the $uuid here?? once i come back from PayPal... this is where i get lost. how do i load a UUID-based session if i can't get the $uuid? and if there's a better way, by all means let me know! someone said i could pass the $uuid through PayPal, but i'm not seeing how yet... TIA gang! WR! This topic has been moved to Application Frameworks. http://www.phpfreaks.com/forums/index.php?topic=354544.0 Hi all I wonder if people can help me out here. It's a "bespoke" vs "framework" question, so not sure its belongs in here, but I didn't want to post it in the ZEND group, as it may have many more "pro ZEND fans" who read it, and I wanted a general thought. This is all based on the fact that I have a big project coming up and I want to know if I should be sticking with a custom job, or if something like ZEND is the way to go. Basically I have been developing PHP for about 2 years now and I have always thought a custom site written from scratch was the best way to go, not only does it allow you to have the minimal code needed to run the site, therefore reducing load, space and bandwidth, but it also allows you to know exactly how the system works, I guess the downside is that you have to spend more time doing the coding. But I have a few friends who use frameworks, ZEND has been coming up more and more, it's not really my ideal system to use as I prefer coding from scratch (not sure why), but they swear by it, and always tell me its great, its winning awards and none of them code from scratch, one of them even quoted that it "will become the standard for development" - is this true? Apart from being massively bulky and containing tons of files with scripts and functions that you might never ever use, what do people see as a downside to ZEND, If any? Is it best to code from scratch, and if so, why? Or does using something like ZEND much better? I guess if you always use ZEND, then you never really enhance your skill as a coder and never really learn anything new, plus I always think it's kind of cheeky using a pre-built system. Is there a good argument that would say using ZEND is not really a good idea? Or is the general feeling toward ZEND being a good thing? Surely if people know ZEND, they know how to play the security of the site to there advantage and therefore can break the security of other ZEND systems, or at least cause some hacks to a site. Any thoughts would be great Thanks everyone Here is my hierarchy: data -logs folder-debug.log htdocs -index.php include -Contollers,Smarty,Templater,Zend templates Now when I launch index.php from htdocs, I get this un-seeming error: "Fatal error: Uncaught exception 'Zend_Log_Exception' with message '"/var/htdocs/Books/practical_Web2.0/data/logs/debug.log" cannot be opened with mode "a"' in C:\xampp\php\PEAR\Zend\Log\Writer\Stream.php:69 Stack trace: #0 C:\xampp\htdocs\Books\practical_Web2.0\chapter-02\htdocs\index.php(11): Zend_Log_Writer_Stream->__construct('/var/htdocs/Boo...') #1 {main} thrown in C:\xampp\php\PEAR\Zend\Log\Writer\Stream.php on line 69 " I went to the zend folder in xampp, php, pear, zend, log, writer.php dir and I found this: /** * Class Constructor * * @param streamOrUrl Stream or URL to open as a stream * @param mode Mode, only applicable if a URL is given */ public function __construct($streamOrUrl, $mode = 'a') { if (is_resource($streamOrUrl)) { if (get_resource_type($streamOrUrl) != 'stream') { require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception('Resource is not a stream'); } if ($mode != 'a') { require_once 'Zend/Log/Exception.php'; throw new Zend_Log_Exception('Mode cannot be changed on existing streams'); } $this->_stream = $streamOrUrl; } else { if (! $this->_stream = @fopen($streamOrUrl, $mode, false)) { require_once 'Zend/Log/Exception.php'; $msg = "\"$streamOrUrl\" cannot be opened with mode \"$mode\""; throw new Zend_Log_Exception($msg); } } $this->_formatter = new Zend_Log_Formatter_Simple(); } line 69 is =>throw new Zend_Log_Exception($msg); What could be wrong? Hint: settings.conf [development] database.type = pdo_mysql database.hostname = localhost database.username = root database.password = database.database = phpweb20 paths.base = /var/htdocs/Books/practical_Web2.0 paths.data = /var/htdocs/Books/practical_Web2.0/data paths.templates = /var/htdocs/Books/practical_Web2.0/templates logging.file = /var/htdocs/Books/practical_Web2.0/data/logs/debug.log Any pointer as to why there is a fatal error? I try to modify a twitter application, but I have no idea what I'm doing, this is my code so far: require 'Zend/Oauth/Consumer.php'; $token = unserialize($usersClass->twitterToken()); if(!empty($token)) { $client = $token->getHttpClient($config); $client->setUri('http://twitter.com/users/profile_image/twitter.json'); $client->setParameterGet('screen_name', $screen_name); $client->setMethod(Zend_Http_Client::GET); $response = $client->request(); } I want to get the twitter profile image, but I think it's too difficult for me... I am a beginner in the ZEND framework. I am passing a variable through ajax query like this Code: [Select] $.ajax({ method: "GET", url: "/filename/fetch-client-data.php", dataType: 'json', // and so onI need to get the variable passed by the form. I dont know how to use the $_GET['varaible name'] from the form. Here is what I am trying in the controller function Code: [Select] public function fetchClientDataAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(TRUE); $this->get('variablename')=$variable_name; } Can someone point me in the correct direction I currently have a file management system using Zend framework. Everything has been working great with .pdf files in the 2-4 MB range (both on upload and download).
There was a .pdf file that was about 7MB in size, which uploaded fine. When selecting the file to download, it completes in about 2 seconds and only downloads about 300KB. I checked on the server and the file actually did upload fine and was not corrupted BUT I cannot get beyond this file download issue.
All other files (in 2-4 MB range) seem to download fine.
Would it be a memory size issue? Would anyone know the issue or how I can correct?
Thanks so much in advance
|