Taking the Sting Out of PHP 5 Programming 159
bfioca writes "Where are the all-in-one PHP frameworks that make building well-factored and maintainable applications as easy as building simple sites? O'Reilly ONLamp's recent article Simplify PHP Development with WASP shows how to make a simple database-backed site with WASP in just a few lines of code. Other PHP 5 frameworks such as symfony and PRADO have been getting a lot of recent attention as well."
Drupal? (Score:4, Informative)
Re:Drupal? (Score:4, Interesting)
That's not to say stuff like PRADO is any good either - I used it for a commercial site, and it's a pain to maintain. It's an ASP-style component system, and doesn't fit the web model - if you want to do 'Ajax', for example, you're screwed.
symfony looks interesting, though, and much more lightweight.
Re:Drupal? (Score:3, Insightful)
Re:Drupal? (Score:1)
Re:Drupal? (Score:2)
Mixing program code with HTML is retarded, no matter what the language. Even JavaScript should be kept compartmentalized.
Re:Drupal? (Score:4, Informative)
Re:Drupal? (Score:5, Informative)
Nope.
Drupal has multi site out of the box, and has been like that for years. For some 18 months, I ran 4 different domain out of the same code base and the same database even (with database prefixes).
Drupal boasts "clean URLs" out of the box as well. This means that urls do not have to be www.example.com?q=node/123 but rather www.example.com/node/123 (this requires mod_rewrite).
Moreover, Drupal has out of the box the path module which allows you to alias any page to any URL you like. There is also a contributed module (pathauto) that makes this totally automated.
Check my web site for examples (all URLs are aliased).
Re:Drupal? (Score:2)
My only experience with Drupa
Re:Drupal? (Score:2)
Re:Drupal? (Score:1)
In my humble opinion, www.example.com/node/123 isn't a "clean" URL. Or rather, it's a tad bit too clean. It's cleaner than the querystring one, but in my opinion a numeric ID isn't good as an identifier of anything. URLs should be recognizable on sight. If you see an URL and have to ask "Hmm, was that the article about kernel
Re:Drupal? (Score:3, Informative)
Re:Drupal? (Score:2)
Both types of approach have their advantages and disadvantages. Drupal's
Re:Drupal? (Score:2, Informative)
Attempts != Problem (Score:3, Insightful)
Re:Drupal? (Score:3, Informative)
This was a third party library that we incorporated in Drupal a while back to do some remote stuff (e.g. remote blogging,
If you do not use third party client apps to post, you can delete the file xmplrpc.php altogether if you wish.
When it was discovered that it has security flaws, we replaced it completely.
Newer versions are as secure as they can be.
Re:Drupal? (Score:3, Interesting)
Re:Drupal? (Score:3, Interesting)
Re:Drupal? (Score:1)
Drupal is a lot of things, but it isn't exactly a web framework. It does a great job of supplying a basic toolset for building a certain kind of web applications, but it doesn't make it ANY easier for you to do things that are outside its scope. Great for a blog, pretty good for a BBS, not so good for any kind of sophisticated reporting.
More generic frameworks, however, just let you take a dataset and turn it to a table, or quickly bind a database row to an object and a submit form for that object.
Re:Drupal? (Score:3, Interesting)
In the long run, I would rather write my own CMS than use someone elses. When I first learned PHP, I wrote my own system. Now that I'm older and less stupid, I realize how many security holes where in the application, but in the 3 years I used it, not one hiccup because it wasn't documented anywhere.
I messed around with Mambo (sorta, kinda, like Drupal) and really didn't like it. I hacked it a little to do what I wanted, but found it wasn't for me.
At the same time, I'm a little at a loss
Bogus (Score:4, Insightful)
If you want a quality product, there are no shortcuts. There is no such thing as a free lunch.
A big thumbsdown on this kind of crap. "Sting" to PHP 5 programming? Get real.
Re:Bogus (Score:4, Insightful)
Either way, I can tell you that, from my personal experience, learning and adopting a framework in your work can have a lot of benefits, for me, as a small custom business solutions provider.
Re:Bogus (Score:1)
Re:Bogus (Score:1)
And I'm sure Chinese is better than English, too. All of us english-speaking people are so limited with only 26 letters to play with.
Oh puhleeze, both are programming languages! , and they can coexist together if you do it right. True hackers don't care what language they program in, they adapt. If the-other-side in the Php-or-Perl issue offends you tha
What about PHP using HOOD? (Score:1, Troll)
I don't see the magic words MVC... (Score:4, Insightful)
If you are looking for quick app development and you aren't joe home user making a website you are going to need something thats based off a model -> view -> controller architecture. Symphony does this, so does the cake [cakephp.org] framework.
Re:I don't see the magic words MVC... (Score:2, Informative)
Re:I don't see the magic words MVC... (Score:2)
your mama doesn't see the magic words (Score:1)
And I don't see the magic numbers for Cake or Sympfony...which is 1.0, at least.
Besides, from the front page of the WASP sourceforge site [sourceforge.net]:
Re:your mama doesn't see the magic words (Score:1)
I thought "BETA" was supposed to be what Web 2.0 was all about?
Come on, for example Rails got popular when it was hyped like "It's a dream to develop for! And version 0.12 is out!"
=)
Also check out (Score:1)
I need PHP (Score:1)
Well check this Troll Tech VBA thingy (Score:2)
Re:I need PHP (Score:5, Insightful)
Seems like a fools errand to me. I predict you will fail miserably and your web site will be hacked within 24 hours of you putting it up.
You really should learn the language that you are trying to build web sites in.
Re:I need PHP (Score:2, Informative)
Re:I need PHP (Score:3, Funny)
Re:I need PHP (Score:2, Informative)
Also, your understanding of databases and interfaces needs to be more sophisticated than building a contact manager in MS Access...
Re:I need PHP (Score:1)
Re:I need PHP (Score:1)
Re:I need PHP (Score:1)
Re:I need PHP (Score:1)
Re:I need PHP (Score:2)
If you know some programming already (even BASIC will suffice), then you can pick up PHP. If you know C++, even better. If you don't know programming, step away from the PHP and go learn something that won't let people hack your websites (and even if you don't get hacked, will allow your website to keep running in the meanwhile).
If you don't know HTML...uh...make sure you're comfortable with it before starting, because it's almost impossible to make a useful webpage if you can progra
Re:I need PHP (Score:1)
Sting? (Score:1)
Facetious (Score:1, Insightful)
Using a Framework for YOUR applications!? (Score:1)
If you want to create anything else (like a corporate site with support system [ticketbased], shop [enduser and reseller], productinfo,... or a browserbased) do it yourself or have a company done it
And if you really want to stick to a framework - create your own framework
Sebastian (using his very own framework Ad
Never ever use PHPNuke (Score:3, Informative)
Read here. [google.com]
Re:Never ever use PHPNuke (Score:1)
I only know that some friends of mine use it for their MMORPG-Guildsite, I'll ask them if they have their PHP Nuke patched.
But it seems like you can get Patches on this site [nukefixes.com].
And there are other Content Managment Systems out there, too.
Try searching Sourceforge for "CMS" [sourceforge.net] and you'll find many open source systems, not only PHP based (Perl is nice, too...)
Or use a google to search for free CMS [google.com]...
I should think so too. (Score:3, Funny)
Modern web programmers have moved elsewhere (Score:1, Offtopic)
Re:Modern web programmers have moved elsewhere (Score:1)
Like I am gonna learn some new language because a bunch of trolls spam post to every PHP article.
Re:Modern web programmers have moved elsewhere (Score:1)
i'm sure you've seen the video - reminds me of a console version of every single vba demonstration i've ever seen.
Re:Modern web programmers have moved elsewhere (Score:1)
Re:Modern web programmers have moved elsewhere (Score:1, Interesting)
I have read the tutorials for Ruby on Rails and some of the PHP frameworks that rip it off. It seems like a hell of a lot of work just to avoid writing a few lines of code.
We are developing a CRUD-only framework at work, sort of in homage to this current fad, but ours won't be OO, and it won't keep you from having to write code either. It sure as hell won't use XML for anything. We might release it as free software after we see how well it works out.
I don't know why all these framework sit
Re:Modern web programmers have moved elsewhere (Score:1)
Re:Modern web programmers have moved elsewhere (Score:1, Troll)
No, they haven't [tiobe.com]
You are buying into the hype. Apparently a miniscule but vocal minority of people have even heard of Ruby on Rails. Most of them seem to read this site.
Missing the point! (Score:1, Insightful)
Complicated? I didn't realize that complicated frameworks were the pinnacle of modern software development. Here's a newsflash: PHP is popular not because of its rigid structure, nor the availability of misguided "frameworks", but because it allows people to solve problems in a flexible way with little overhead. Yes, a lot of people take it t
Like Zope? Does anybody use this stuff? (Score:2)
I get the feeling these php frameworks might be even more obscure.
Now, compare that to a product like ColdFusion.
I don't use any of those products. But, I've got to wonder.
I also rolled my own farmework and... (Score:1)
a framework is NOT a shortcut (or a CMS!) (Score:4, Insightful)
Re:a framework is NOT a shortcut (or a CMS!) (Score:1)
Stupid article, obfuscated and biased examples. (Score:1, Interesting)
<li flexy:foreach="arTasks,key,task">{task[Name]} - <i>{task[Due]}</i></li>
is better than this:
<?php
$arTasks = array();
foreach ($arTasks as $key => $task)
{
?>
<li><?php echo $task['Name']; ?> - <i
Re:Stupid article, obfuscated and biased examples. (Score:2)
actually, the "sting" of php5 is... (Score:3, Insightful)
this is hitting me hard as i'm trying to put together an xml-intensive app and am stuck using home-grown open-source XML parsing and generating packages, mostly unfinished, that won't be finished because they've been superseeded by the php5 libraries that i can't use yet.
Re:actually, the "sting" of php5 is... (Score:1)
Our 15,000 line app went from PHP4 to PHP5 with very few changes.
Unless you are relying on very legacy things that have been depricated throughout the PHP4 tree, you should have nearly no problems.
Re:actually, the "sting" of php5 is... (Score:2)
Re:actually, the "sting" of php5 is... (Score:2)
Re:actually, the "sting" of php5 is... (Score:2)
this is hitting me hard as i'm trying to put together an xml-intensive app and am stuck using home-grown open-source XML parsing and generating packages, mostly unfinished, that won't be finished because they've been superseeded by the php5 libraries that i can't use yet.
This is exactly why I'm switching to Ruby and Ruby on Rails. If I have to rewrite the whole applicatin, I'm going to switch to something better.
Re:actually, the "sting" of php5 is... (Score:2, Troll)
and go back and read my post: even if i wanted to switch, i might not be able to because my webhost company may not support the language (though with mine, i could probably talk them into it if i felt like it), and that doesn't solve the REAL problem of
What About Molins... (Score:1)
What's problem? (Score:1, Flamebait)
Livepipe! (Score:1)
It's a PHP5 framework for web developers that was recently released and looks promising.
http://livepipe.net/ [livepipe.net]
Framework Soup (Score:2)
For example, here is a simple set of functions to format a typical data entry form with title on the left side and input box/item on the right. If you want to code HTML directly instead of use the he
Re:Framework Soup (Score:2)
The big advantage of frameworks is they make the things the designer wanted to make easy, easy. The problem with frameworks is they make things the designer never thought of or never wanted either harder than it would be to do it directly, harder than it should be, or, in the worst cases, flat out impossible.
I've found that for larger projects, the
What the hell is wrong with you? (Score:2)
You have a low-enough UID to supposedly be somewhat knowledgeable, yet you advocate writing frameworks and not marrying the code to the framework..?
Then why the hell are you mixing the View in with the Model (and most likely Controller too?)
Honestly, it's people like you who give PHP a really bad name.
Any sane person would AT LEAST be using a templating system like Smarty [php.net].
Re:What the hell is wrong with you? (Score:1)
Beurocratic interfaces are not change-friendly. There are no "immutables". Everything is game. Generally one should make
Re:What the hell is wrong with you? (Score:1)
Taking the sting out? (Score:2)
I realize that programming languages are supposed to be painful, but for me, PHP 3 made programming fun again. As a sysadmin sort it was remarkable to be coding and enjoying it. This seemed to be true no matter whether it was a 10-line hack to get something done on a website, or a top-down structured project.
And you know when then turnaround happened? When PHP stopped being fun? I have an opinion. I think it coincided with the
Re:Taking the sting out? (Score:2)
Are you KIDDING?!?!?
15 years ago, I took some college classes on programming. Then, the "thing to do" for intro programming was Pascal - with all the super-strict data types, memory allocation, linked lists, and compiling crap. I hated it - somebody would type a number 3, I'd add 5 to it, and get 56. It was painful to get an input form that somebody could type some stuff in.
Yes, I know about the ASCII char table, and it seems just
Re:Taking the sting out? (Score:2)
<?
$a=$b;
if (isset($a))
echo 'good';
?>
PHP Notice: Undefined variable: b in
and at best displays a warning if you've enabled the corresponding non-default option?
This is default behavior that I see on my CentOS 4.2 linux server.
With such a huge standard library, where's some decent database abstraction?
Ever heard of PEAR?
Why the hell does the . operator go again
Re:Taking the sting out? (Score:2)
Global variables are not harmful at all. The misuse of global variables is. This is a very common misconception shared by most new PHP programmers who read the wrong material on the web, or listen to other inexperienced PHP programmers for security advice.
Now, I'm going to take a leap here, and assume you're actually talking about the register_globals directive, and not global variables in general. From the site: [..]This page will explain how one can write insecure code with this directive but keep in [php.net]
Simple example (Score:1)
Re:Simple example (Score:2)
Most frameworks are built from some sort of ideology without any real need; they are solutions in search of a problem.
Frameworks, stygma, and rolling (Score:2, Insightful)
To the point: I see a lot of people bashing the concept of frameworks and stating that you shouldn't use frameworks because it's just being lazy or that frameworks are a bad thing. I believe this negativity comes from inexperience and ignorance.
I agree, these are biting words, but consider the fact that the arguments used to suppo
Slashdot for Self-Promotion?! (Score:2, Insightful)
And I wonder why I'm always so surprised that people complain about bias in the media...
PRADO bad. CakePHP + PHPTAL is my PHP ticket. (Score:2)
Luckily there are neat tools that make professional PHP project work very easy and fun:
PHPTAL (http://phptal.motion-twin.com/ [motion-twin.com]) is a PHP based redoo of Zopes TAL (Template Attribute Language) - the best Templating concept ever. M
i'd like to know (Score:1)
almost EVERY host supports php4. only ha handle full have php5.
"we support the latest technologies... this include php4, even though php 5 had been production stable for 2 years"
i know that has nothing to do with the article, but i had to rant
Re:Just use Ruby or Python (Score:3, Insightful)
Re:Just use Ruby or Python (Score:2, Interesting)
while I agree its a niche language now, it won't be long I imagine till ruby ges more mainstream. The main thing holding ruby back so far has been a lack of books on the subject. hoowever, that is quickly changing and already ruby is more popular than python in japan.
caveat emptor: I've only been dabbeling in ruby for the past week or so
anyway, so far
Re:Just use Ruby or Python (Score:3, Interesting)
And they tend to be better developers too, those that enjoy hacking and being productive.
Re:Just use Ruby or Python (Score:1)
Re:Just use Ruby or Python (Score:1)
Re:Just use Ruby or Python (Score:1)
Re:Just use Ruby or Python (Score:3, Insightful)
As an example, JavaScript has OO, but no classes! How do you suppose that is? It's prototype-based OO. It's an interesting alternative to class-based OO. Well-rounded programmers can pick up a concept like that rapidly -- they don't just say "this is too much of a hassle."
The basics in Ruby a
Re:*Please* use Ruby or Python (Score:2)
With a manual as clear, conside and accessable as PHP's, who cares? There are hundreds of functions in the 'core', but not all of those in the PHP manual are compiled in on most setup's. Who really learns the libraries and function
Re:*Please* use Ruby or Python (Score:2)
I haven't looked at the PHP docs for a while now, but one Perl programmer made up a table of PHP functions [tnx.nl] that even PHP programmers find useful! That page also has a *lot* of good comparisons to Perl. It's amazing how much baggage PHP has accumulated over the years.
Re:*Please* use Ruby or Python (Score:1)
Re:*Please* use Ruby or Python (Score:2, Informative)
Re:*Please* use Ruby or Python (Score:1, Flamebait)
Re:Taking the sting from PHP coding (Score:1)
Re:Where has gone the REALLY good ideas, namely, K (Score:1)
"WASP seems far from simple, let's take this example:
Request::getParameter('Add') != null
wtf? Why can't one do $_POST['Add'] != null?
What format even is Something::Something ??"
------------
Well Something::Something is simply the syntax to access a static function of a class. It is simple.
See http://www.php.net/manual/en/keyword.paamayim-neku dotayim.php [php.net]
Either I misunderstood, but it is not like it is one of the most obscure thing in PHP to know that one.