PHP 5 Power Programming
Chapter 1 sets the stage by asking "What Is New in PHP 5"? The chapter begins with a quote from John Scully: "The best way to be ready for the future is to invent it," which perfectly describes the authors: Andy Gutmans and Zeev Suraski have continued to push the PHP project to improve on the original foundation and to add cleaner programming enhancements. The leap from v.4 to v.5 is no exception, as this new version has brought singular advances: OO programming with PHP enjoys a leap forward in focus with a complete redesign of its object model, a completely re-written MySQL extension (MySQLi), support for SQLite, a new mechanism for handling errors via exceptions, a suite of re-written XML extensions based on the libxml2 library, a C-based implementation of SOAP and a new memory manager.
Following this tour of the new features of PHP 5, the reader is exposed to a brief chapter on the basic language of PHP. An experienced developer can skip this chapter, but it's a very good overview of the syntax including variables and superglobals, basic data types (integers, strings, booleans, arrays, constants), operators, control structures (conditional, loop, code) and functions.
PHP 5's OO support is the subject of Chapter 3. Object oriented programming was introduced in PHP 3 but it was in an extremely elementary form and while it was improved upon in PHP 4, it truly comes into its own in PHP 5. Covered in this chapter are the basics of the OO model, object creation and lifetime, access restriction keywords and the benefits of using class inheritance, as well as tips for exception handling.
Chapter 4 is a well written chapter on advanced OOP and design patterns (strategy, singleton, factory and observer), with some very good code examples on iterators and the reflection API, which allows the programmer to collect information about his or her script at runtime.
Chapter 5, "How to Write a Web Application with PHP," is an excellent fusion of code and best practices in developing a complete dynamic web application based on PHP. The concept of good design practices is often overlooked in "how-to" manuals. Rather, many technical books focus on overcoming code issues and avoiding pitfalls associated with poor code execution. Here, the authors take time out to detail techniques on making scripts "safe" ("trust nobody, especially not the users of your web applications"). Bugs and security holes are a fact of life, and this chapter covers some very practical techniques to avoid consequences arising from weirdness caused by users as well as from deliberate attempts by bad guys to crack a site's security.
Databases are covered in depth in Chapter 6. SQL and SQLite are discussed (each with a section on strengths and weaknesses) before examining the new database-connectivity features of PHP5 using mysqli and sqlite extensions. PEAR DB is also presented, with a section on the pros and cons of using a database abstraction layer like PEAR DB. Connections, queries, fetching modes/results and other topics are well covered. I would have liked to see some additional discussion and implementation of SMARTY in this chapter. SMARTY is a template engine with an ability to cache templates into PHP scripts which saves on overhead and contributes to speed and efficiency.
Error handling is the topic of Chapter 7. Types of errors (undefined symbol errors, portability errors, runtime errors and PHP errors), PEAR errors (PEAR_error class, handling of PEAR errors and PEAR error modes) and exceptions (exceptions explained and the specifics of using exceptions) are treated adroitly.
"XML with PHP 5" in Chapter 8 will undoubtedly become a focal point of the book for many readers. Along with the addition of support for OO programming, using the new XML extensions are some of the most exciting developments in PHP 5. The XML implementation is standardized on libxml2, compliant with W3 standards and extremely efficient. This chapter introduces XML in PHP 5 with sections on the vocabulary of XML, parsing (SAX, DOM, XPath), the SimpleXML extension (very cool, because this allows the programmer to access the XML through a data structure representation, treating the information as objects), PEAR classes that deal with XML (XML_Tree, XML_RSS), converting XML and communicating with XML (XML-RPC, SOAP). PHP 5's new SOAP extension is a welcome improvement over previous PHP versions.
Following this excellent chapter is one on other valuable mainstream extensions: files and streams (I/O streams, compression streams, URL streams, locking, renaming and removing files, temporary files), regular expressions, date handling, graphics manipulation with GD ("gif draw" to old-timers, "graphics draw" to the youngsters) and multi-byte strings and character sets. This is a solid chapter encompassing the wide range of functions that are intrinsic to the core of PHP to the many favorite and practical extensions that are outside the core of PHP.
Chapters 10 through 12 deal with PEAR: installing PEAR, commands, packages and components. Stig Bakken's extensive knowledge and experience is obviously prevalent here. It's worth noting that you won't find a better single coverage of PEAR and PHP 5 anywhere else.
For those readers experienced in PHP 4 and who are looking to move to v.5 and are wondering what to expect during the transition, Chapter 13, "Making the Move", will be of particular interest. The authors suggest that in migrating to PHP 5, "you can encounter some minor incompatibilities" and address a number of these: using compatibility mode to revert to PHP 4 behavior, recognizing script problems using OO features and learning the new names and locations of files in the PHP 5 distro, among others. Users of PHP on the Windows platform may want to spend some time over this chapter (and maybe reconsider their choice of development platform!).
Designing for performance is the subject of Chapter 14, and the authors encourage the reader to plan for optimal performance during the design phase: benchmarking, profiling with Zend Studio's Profiler, APD (Advanced PHP Debugger) and Xdebug, using APC (Advanced PHP Cache) and ZPS (Zend Performance Suite), optimizing code using micro-benchmarks, rewriting in C and writing procedural versus OO code. This extensive chapter offers the reader a fairly complete set of tools and sage advice for more efficient design.
Chapter 15 is titled "An Introduction to Writing PHP Extensions," and introduces the extension API that allows developers to write custom PHP extensions. This isn't a chapter for everyone, since there are already a large number of available extensions and, as the authors note, unless you need to wrap an existing C library to give it an interface from PHP then you can easily skim or skip this chapter entirely. Note, though, that memory management has a section here and it's worth a read because of PHP 5's support for multi-threaded environments.
The final chapter of the book is called "PHP Shell Scripting," and explores the CLI SAPI (command line interface Server API). There is an introduction to PHP CLI shell scripts (how CLI differs from CGI, the shell scripting environment, parsing CL options, good practice) with some nice examples.
Appendices on PEAR and PECL (PHP Extension Community Library) Package Index, phpDocumenter format Reference and Zend Studio Quick Start Guide complete the volume.
The authors succeed in providing an excellent manual for "power programming" in PHP 5. There is terrific guidance here for many PHP developers and experienced Java, C++ and C# coders who are looking to either migrate to PHP 5 from v.4 or who are looking to gain experience in PHP programming. The experience the authors bring to the table is indisputable and their style of writing and the ease with which they bring new language and tools to their audience is admirable.
You can purchase PHP 5 Power Programming from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Out of curiousity how many people are using PHP5? My hosting still only supports 4.3.something. And I'm still doing my testing strictly on 4.x to match current hosting options.
Does he explain how to make the PHP interpreter work on Windows? Mine PHP 5 interpreter installed using the recommended procedure craps out at a paltry 250-300 visitors. My grandmother has more visitors than that.
But 5 will come eventually. In the "Me TOO" world of web hosts, once one goes over , they'll all have to.
That or they'll just when cpanel/plesk or what ever the contol panel of the day supports it..
Wonder why they took a perfectly good language and decided to crud it up with OOP.
I've had enough abrasive sigs. Kittens are cute and fuzzy.
HTML Power Programming
BASIC Operating System Design
Enterprise AppleScript Applications
Kernal Programming With Javascript
Cool, where do I go to download my free copy?
http://people.debian.org/~dexter/dists/php5/woody/
Works great.
The man who trades freedom for security does not deserve nor will he ever receive either. - Benjamin Franklin
This has been the most in-depth PHP book I've found to date. It covers alot of advanced web development techniques as well as good software design practices. "Advanced" PHP literature is hard to find, but this book does a solid job of providing it.
The new features have made php5 become aggressively adopted around here. We're cutting the line on php4 development and porting active projects to php5 to take advantage of some of the new OO features.
A lot of our old code is terminally broken, but we're adopting php5 with open arms.
I'm really glad the php team didn't decide to maintain 100% compatibility.
does the world really need another php book? what does this one cover that others don't? how many times can you rehash the real manual? i work in a place where 99% of development is in php, and you won't believe the idiots who read books like this one and are suddenly a "programmer".
"The best way to be ready for the future is to invent it"
So by PHP's reckoning.....
1) Establish PHP
2) "Invent the future"
3) ????
4) Profit!/Use your hovercar for daily commute
one of the the primary reasons that things like PHP and Perl constantly change is so that guys like this can keep writing books and running training classes?
"I'd rather be a lightning rod than a seismometer." -Ken Kesey
Use short variable names because it makes the interpretter run faster. I wish I was joking.
Can anybody point me to a single, succinct document describing the difference between php 4 and 5? Something I can read while I eat this lovely cheese sandwich would be super.
--
the strongest word is still the word "free"
Seems to be really good, I think that fact that one of the authors (Zeev), who invented/develops the Zend engine speaks for itself.
Covers lots of things even the basics, has some really good advice on form security and session security and explains how the hackers actually attempt to exploit loopholes in your forms and session data and how to get around this.
Has a guide to generating bar charts/graphs which I found really usefull. Has good info on XML and SOAP, SQLi and multiple queries.
It tends to have quite a beginners approach, but I'm not discrediting the book and dont let this put you off, the subject matter and topics covered make it more than worthwhile for php professionals and there is a wealth of information for migrators looking to use the new php5 (eg OOP) features.
It's not as elegant as real namespaces, but one can create abstract classes with public static functions to create a poor man's namespacing mechanism.
s .php');
Combine this with the magic __autoload() built-in PHP function and you can get rid of the mess of include()'s and require()'s. There is not much of a performance hit doing this, as a bonus.
so instead of:
include('common/functions.php');
myFunc(...);
you can just do:
Functions::myFunc(...)
and not worry where myFunc() comes from.
This comes in handy when you have a complex directory heirarchy and use google-friendly URL's (e.g.: script.php/arg1/value1/arg2/value2) and have to do a lot of require(dirname(__FILE__).'/../../common/function
Just my $0.02
...bravo for using the word "adroitly". Don't see that one too often. :)
I'm not good in groups. It's difficult to work in a group when you're omnipotent. - Q
ASP.NET might be faster but it only runs on 1 platform and its not even close to as widley deplpoyed as PHP nor is there that many free applications available written in ASP.NET to push adoption. For your own personal stuff or internal applications, sure ASP.NET is nice but if you want to write a web app for the masses, PHP is basically the only way to go.
Also, In the last 6 months I've made close to $30,000 porting Access applications to the LAMP platform. Almost enough for a Mercedes!! Npting like telling a customer they don't have to buy any new servers or software. They usually end up spending more money adding features to the application.
jesus christ stop wasting your time pretending to use perl and just it.
John Scully: "The best way to be ready for the future is to invent it,"
Yeah, the sugar water king would ever have been that witty. Not only did John nearly butcher Apple, he didn't do much justice to the quote either.
Conception credit for this particular inventive remark is usually attributed to Alan Kay, leader of the software group at Xerox PARC that gave us Smalltalk and so many pieces of the modern GUI.
I hadn't ever done any web programming before purchasing this book (about 2 months ago), but had plenty of experience with C++ and OO design. This book was perfect for me; it showed me how to do all the OO stuff I wanted to in PHP, and gave enough information about using sessions, post and get data etc to get started. After a week of tinkering I was off to the races!
That said, I don't think this book would really do a good job showing someone how to use the OO features effectively who had never been exposed to it before, and that's probably fine. Just don't expect its half ass coverage of design patterns to give you a whole lot if you haven't scene them before.
-K
it fixes the bugs introduced in PHP5.
-- Tigger warning: This post may contain tiggers! --
PHP5 really is a nice step forward from PHP4. It's improved object support and exception handling make it easier to sell as a "real language" with management and clients. And PDO looks quite promising as well. Unfortunately, it is hard to find hosts that support PHP5.
I've put together a set of componenets that I developed under a loose framework for PHP5, called phacade , that provide some of the conveniences of ASP.NET and JavaServer Faces, without all the headeaches those two technologies seem to include. phacade aims to provide components that can be used simply for simple projects, and as simply as possible for complex projects. Much like PHP itself, phacade is intended to work equally well for both procedural and Object Oriented scripts.
If you're a PHP5 developer, please check it out and feel free to send feedback.
Anyone else have any interesting PHP5 projects?
Litmus Test @ Monster.com
I try to apply that Test when I feel dumb for putting stuff on my resume'.
Generally, a full re-design should be rare. The English language has had three total re-designs in the past one and a half thousand years, and there are those who would argue that some of those were unnecessary. (The "Campaign for Real English" argue that standardized spelling, for example, was a bad idea.) All other changes have been incremental.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
Prentice Hall PTR publishes each book under an Open Source book license and provides free electronic versions several months after each book's publication.
Does anyone know where to obtain these free electronic versions of older books? I skimmed a couple Prentice Hall sites but couldn't find anything. Thanks!
Yeah, the sugar water king would ever have been that witty. Not only did John nearly butcher Apple, he didn't do much justice to the quote either.
The Newton was Scully's. It turned a profit when the rest of Apple was tanking.
I am no longer wasting my time with slashdot
Thanks for playing the role of "Angry, Anti-social, Elitist Perl Snob." The Slahsdot user known as hyperstation alone determines who is a programmer and who is not in this world, and goddammit, if you've read a PHP book, you're still not a programmer! You're not supposed to learn anything by reading about it in a book. Instead, you must know it through Slashdot discussions and online tutorials, or you're just not a "real" programmer. For instance, I learned Perl through osmosis by sleeping on an O'Reilly book. Brothers and sisters, I have arrived.
What exactly is a PHP Engineer?
You remind me of this crazy religious fundamentalist who used to live next door to me. He was always ranting on and on about the people at his church, and how they weren't REAL Christians just because they read the Bible one day at Church. That guy's worldview really scared me, and so does yours.
Yet another person who should just come out and be honest about being a Perl whore.
"Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
congratulations! You make $60,000 a year.
But since we're on the subject of PHP5, does anybody knows about PHP5 packages for Debian Sarge? Please don't tell me about dotdeb.org, I'd like something that works. I don't mean to troll here, but I'd love to start using PHP5 for our new webapps and our preferred development and deployment platform IS Debian Sarge.
I had an email exchange with Ad Conrad, Debian's PHP Mantainer and he told me that as soon as Sarge is released as stable, he'd be uploading PHP5 to Debian. But it still seems to be far away.
Regards,
Articulos para gente geek: Poleras, linux, libros y mas
PHP5 sounds really great. I'd like to use it, really I would. But I am so spoiled by ColdFusion, especially the excellent database support.
I was *shocked* when I found out PHP projects are coded for a specific database. In Coldfusion I can change database vendors merely by making a change on an admin page. All the Coldfusion code remains the same. Of course of you have to avoid non-standard SQL inside your queries.
Is PHP database support anywhere near Coldfusion's?
Not trolling, just would like to know.
- For the complete works of Shakespeare: cat
Say what you want, I've been getting job offers and phonecalls from recruiters looking for contractors to do LAMP projects, specifically in PHP. Most people are attracted to the virtually ZERO cost and crapload of free tools.
For instance, I was actually asked to do an application for a client where scripting language and platform hadn't been decided. the mini-app had to generate images on the fly, include a search-engine style capability, etc. In ASP-land, I'd have to use an external DLL for the images and buy a searching script. In PHP-land, I used the built-in graphics library and phpdig. Although I think ASP.NET has its own built in graphics libraries, its simply much much harder to find free code for it. I know that might be an anathema to some, but why re-write barcode generating scripts or search functionality when a good alternative has already been written?
Reason, free market capitalism, and individualism
Ruby on Rails is where it's at now. There's a quote on that page that compares php to programming in assembly compared to using RoR.
Would one of the "power programmers" please create a PHP calendar script that compares to Matt Kruse's Perl calendar? I've no talent in PHP (or any language for that matter), or I'd do it myself. After looking at dozens of PHP calendars, I've not seen one that compares to what Matt wrote.
I haven't read the book, and I don't intend to, but I do think the review gives a rather good assessment of what the shift to PHP 5 means in practice.
I am personally of the conviction that OO is among those things that are absolute necessities to keep the work of mediocre (sloppy) programmers like myself moderately sane and structured, as soon as the number of lines exceeds throwaway level, say, 10,000 lines or more. I can't read my own code, let alone that of somebody else, if it's more than 10,000 lines and doesn't have a good class diagram as its basis, unless some other methodology was used, and those other methodologies are more problem specific than OO.
Now I've seen (and luckily enough, managed to largely stay out of participating in) a project that was done in PHP4. Honest attempts were made (I swear) to separate user interface from business logic and to implement the latter in terms of an OO class design, but PHP wouldn't even let us *pass references as function arguments* without complaining. Which meant the OO support that was there was little more than shallow imitation. Which basically meant we couldn't implement the class design because the language wouldn't let us.
As you may have guessed by now I'm also a fervent advocate of strong, static typing so I wouldn't trust myself with PHP 5 anyway, but it's good to know that they have at least managed to pass the hurdle of knowing what a reference is. It is (truly!) remarkable to see the power of open source in PHP, which has grown from a dirty hack of a Perl script to improve upon the even worse hack of Apache SSI, into a full-blown programming language, and I'd regard it as past its adolescence. The reviewer rightly points out XML support as a particular area in which previous versions of PHP lacked maturity. So it's getting there, but if you ask me: where exactly, I'll reply: where Java, NET and possibly some other languages are today.
We just switched over from php4 to php5. The result was that a few things broke, but it wasn't anything that couldn't be corrected.
The major odvantages of PHP5 lay in it's new bundled features such as the improved object model, integrated simplexml (anyone who has had to deal with the other XML parsers will really appreciate this!), and sqlite. There is of course more, but I'll leave that for you to discover ;)
Unfortunatly, it's not as easy for the newbies to install. Particularly where mysql is concerned because of the issues surrounding (the lack of) bundled client libraries for mysql. This has made it a little frustrating for us at #php/freenode, since we have to walk a lot of the new people through it.
On a down-note, I sort of wish they had taken the plunge and broken backwards compatibility to fix some of the more perennial issues with php, like it's lack of consistant naming conventions, and lack of key OOP functionality. We still don't have proper namespacing, or argument overloading, or multiple inheritance.
This book is probably a great idea for experienced programmers thinking of making the switch. Other good reading material: PHP5 OOP and Migrating from PHP4 to PHP5
BeauHD. Worst editor since kdawson.
The only annoyance I see is what some people tend to call "the language evolution". Nowadays OOP seem to be the way to go even if the language has 1 or 2 purposes. If the cost for being similar to java (god knows why) is dropping simplicity, which in-lots-of-people-humble-opinion was (until 4) THE greatest feature of PHP, then the dev team deserves to burn in hell. Or better, as mentioned before in Slashdot (too lazy to look for the link), Zend is the reason for that.
I've had no trouble with using this source on my sarge boxes, which are all running PHP5 and MySQL 4.1 with Apache 2 on the 2.6.8-10-amd64-k8-smp kernel. Actually they've been configured like that for quite a while now and have performed really well without incident.
deb http://people.debian.org/~dexter php5 sid-old
In my experience it is difficult to support an PHP-App on both versions 4/5
U have to switch compat-mode (zend..comp) on in php5.
Why?
in php4:
function test(&$var) is callbyreference
and
function test($var) is callbyvalue
in php5 without compat-mode you have to decide as the caller, since function-args are byreference
test($var) byreference
test($var.clone()) byvalue
There are only 10 types of people in the world: Those who understand binary and those who don't.
Why is the parent modded flamebait. S/he is telling the truth about PHP on IIS/Windows. It does have terrible performance compared to Linux/Apache. And it is not because of IIS or windows either. PHP, runs as an cgi on Windows, because of stability issues with the PHP ISAPI plugin.
I started looking into Ruby on Rails late last night and from first impressions, I think you might be right.
I've been working on a time tracking system for keeping track on work I do for clients etc. It took me over two hours to get the basics up and running with PHP (I've been a PHP developer for six years, four commercially).
It took me ten minutes to do essentially the same thing in Ruby on Rails with no prior Rails experience and minimal Ruby experience.
It's just a toy application at the moment, but Rails has sold me on Ruby as a rapid prototyping language for the web. With a little more prodding around to make sure it's this powerful for larger projects, it may very well become my language of choice.
I was bugging my host to switch to PHP5, and then I recently discovered Ruby (and Rails), and am now bugging him to do that, since it is way more über than PHP, but there's even less of a chance of him going there anytime soon. =(
I prefer the most recent, stable version of PHP4 (currently 4.3.10). Lots of apps I use, including phpBB, are much better off with PHP4. I'll wait a year or two before converting to PHP5.
Debugging? Klingons do not debug. Bugs are good for building character in the user.
There's one thing thats been bugging me with PHP5; It doesn't seem possible to write a singleton that works with subclasses (self will return the parent class if you call it from a child). Anyone have a solution? (If not, I'd consider this proof that the php designers have no idea what they are doing).
Heh, there's a lot of sentences I've uttered that go like this:
"PHP's $FEATURE isn't as elegant/powerful/usable/readable as real $FEATURE, but since I've been forced to maintain this project, it'll have to do."
Which of course raises the question, why on earth don't we use a language that has the real $FEATURE to begin with?
But there would be no (or much less) overhead, and no slowdown if you didn't use Smarty
(Otherwise, nice review
When software stops changing and improving it is most likely dead.
I can see how a language like C can be solid for a very long time. But the only time things don't change is when people stop using them.
In software we keep inventing new things and it is very prudent to document this newness. Hence we have new releases after a time so that the creators of these languages can give us better tools to use.
It isn't a bad thing.
And they need to make money so they write books.
I like this model of technical development.
Guess we have a lot to be thankful for when we live in an age that we can get free books in our house by typing wget in a command line.
Count your blessings and write a book of your own.
Come on, no one expects design patterns to be interesting. They are like an ABC book for a kidergarden student.
Hook the developers, and they start peddling it in the corporations. Soon, the corporations can't give it up. Then they sell us their wives!
It does look very sweet... I'd like to know, how robust/scaleable it is compared to PHP? What are the major applications / web sites developed in Ruby on Rails?
:)
And is there anything remotely like PHP on Rails?
This is why I use Perl. http://cpan.uwinnipeg.ca/dist/GD-Barcode But it looks like it is not that hard to find PHP stuff either.. http://www.hotscripts.com/PHP/Scripts_and_Programs /E-Commerce/Barcode_Generation/
So I guess you didn't search very hard. This took me a solid 5 minutes. Barcodes are blindly simple, but if they are messed up, you can't do much about it with a closed source app, send it back, get a refund. Yeah, great. With these simple examples you can have full control and not have to be the victim of a bug you can't fix yourself.
So harder must mean you can't use google and never heard of CPAN. And of course you can use Perl from PHP and as a result you have an outstanding collection of tools free and at your fingertips.
I realized as I posted my last message that I just totaly misunderstood you. My deepest apologies.
Thats just weekends, not counting my day job.
On the subject of power programming, does anyone know any refactoring tools for PHP? I inherited a god awful script to maintain the other day. It has some functions over 300 lines long, short and obscure naming of variables and functions, almost everything crammed in one file, etc..
If it were in Java I'd be joyfully extracting methods and auto renaming stuff up the wazoo, but I can't find any refactoring tools for PHP. It's actually easier to just rewrite the damn thing than slog through by hand and unintelligent find/replaces.
I checked PHPEclipse already, the only refactoring they have enabled is file renaming and that's broken (breaks all your include statements, etc.) so there's little hope there.
Thank you for saying that. I browsed through the comments shaking my head, but finally someone said what was on my mind:
It amazes me that people try to write big projects in PHP. It must be absolute hell. OO in PHP is just a joke. To me it seems like an afterthought, "hey, that OO thing seems popular, let's add some syntax sugar to emulate it in PHP". Because it's just that, syntax sugar.
PHP works nicely for small sites, doing some quick and dirty hacks (but without having that nice quick-and-dirty-enabling syntax of Perl), and some simple database querying. It works, but just that.
But try to implement Model 2 in PHP, the horror! (not to mention Model 2X...), it's simply not up to it.
I've written small sites in PHP, works fine because I can do things quickly and without much thought. I've written medium-sized database-driven sites in PHP, and that gives me a headache. Trying to layer the application, abstract away the database and the subsystems, it's a pain. I do web programming for a living, and PHP is not even an option in most cases.
Theo Hultberg / Iconara
-- Hey, I've already got bad karma, so what can you do?
Not sure about scalabity and such, but RoR people like to go on about how small and elegant it is... If it's half as small and elegant as they claim, I guess it's scalable then =)
Basecamp is the slick pro site that was done in RoR. The Rails web site has a lot of other examples.
There are MVC frameworks for PHP (a random example I just googled), though I'm fairly certain they're nowhere near as elegant as RoR. phpMVC sure doesn't seem so elegant...
Ok,
So when is zeev going to get on the stick and start pushing developers to make their libraries threadsafe so PHP can run in a multithreaded web server?
I really wish the php people would stop blaming apache for their own failure to cooperate with the developers of the libraries they use and either make them thread capable themselves, or convince the authors (money?) of the libraries to make them threadsafe.
Til that happens, or php folks start developing thread safe versions of the libraries they build php interfaces for, PHP isn't quite there yet. Instead of focusing on adding features to PHP, they should do what they have to to make PHP a thread safe hypertext processor when used with the external libraries.
l8,
AC
Which is why the site you link to, use WordPress, a PHP weblog application. And it doesn't even work, I get a "can't connect to the database" error ;)
Any technology distinguishable from magic, is insufficiently advanced.
To me, Ruby on Rails doesn't look any better than PHP. I know Ruby's of all the rage overseas, but I truthfully believe that PHP's now in its prime and is ready to start maturing as an object oriented language. Now if the developers can get off their asses and speed it up, it'll be ready for perl-like situations.
Let's face it kiddos. Perl's a great language, but is so write-only it makes my head spin. PHP is read/write, but is still very verbose, but just enough to the point where it's codeable. Ruby's alright, but just doesn't seem to be as rich or as fulfilling to code in. Parrot and Python are both great, but are really not suited for scripting on the web. Applications however..
"Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
I had a lot of trouble trying to use any homebrew PHP5 package with Sarge; they all seemed to want Apache 1. I ended up just compiling from source. I wrote a description of the issues I had doing this; it may or may not help.
Never attribute to malice that which can be adequately explained by stupidity. -- Hanlon