Posted by KeithCu on March 28, 2006 at 11:16pm
I've been using drupal for a few months but now getting into learning more about PHP and recently read a bit about the various PHP frameworks and I wonder whether Drupal could be cleaned up and development happen faster and made easier for new people to jump in if it built on top of a PHP framework like perhaps the Zend framework. I have looked through the drupal code a bit and I see it has its own logging, DB abstraction layer, and perhaps other pieces which frameworks could provide. Perhaps this could be done as part of a PHP 5 migration to take advantage of the OO features.
What do people think?
Comments
ADODB
I personally use ADODB for my PHP work; it's fast and reliable. It also supports proper SQL parameters - you should always use "?" in your SQL instead of backticking everything!
However, I think moving Drupal to a "framework" at this stage would be very difficult- perhaps for 5.0?
-- Version Control your Drupal web site with The File High Club's Free Trial!
-- Version Control your Drupal web site with The File High Club's Free Trial!
I thought Drupal *is* a
I thought Drupal *is* a framework in itself...
--
Drupal consultancy
--
Ixis (UK): Drupal consultancy, Drupal hosting.
I am certainly treating it
I am certainly treating it as such. :p
--
Drupal services
My Drupal services
--
Drupal services
My Drupal services
Drupal framework
Drupal is both a framework and a CMS. I highly doubt that Drupal will abandon its own internal framework, and move to an external one, any time in the foreseeable future - very few (if any) developers are thinking of taking Drupal in this direction. Personally I think moving to an external framework would be a very bad idea, as well as a waste of all the hard work that's gone into the Drupal core over the years.
However, there is a lot of talk about making Drupal core (even) lighter than it is now: light enough for Drupal itself to be considered a 'framework'. This will be accompanied by the release of various 'distributions' built upon the core, and bundled with various modules. This is the way things are moving at the moment. When this happens, Drupal might just be a framework that other apps are built on (similar to how it is with Ruby on Rails), and it might even be better than a lot of other frameworks out there.
Jeremy Epstein - GreenAsh
Jeremy Epstein - GreenAsh
yes, but what is Drupal's core competency?
Yes, Drupal contains a framework, but I suspect that like most plumbing, it was built only to be 'good enough' to get the job done of building a CMS and that few if any other apps will ever use the drupal plumbing. Most of the exciting work is at the top, not at the bottom of the stack.
In adddition to the other benefits, it would make it easier to share code built on frameworks.
I think this should be thought about for Drupal 5, perhaps as part of an OO effort. I know that Drupal has many OO elements right now, but adopting the standard mechanisms would simplify and probably clarify its design to make it easier for people to wrap their head around it.
We've shot down so many
We've shot down so many "make Drupal use OO" ideas that I have stopped counting,. Consider yours to be n+1.
--
Drupal services
My Drupal services
--
Drupal services
My Drupal services
I searched for PHP frameworks
references in the forums and didn't find any so I decided to post this.
I'm not sure why people shut the idea down although I can imagine it would be a bunch of work. However, if Drupal were built on PHP 5 I'm sure the design would be quite different. The language constructs you choose frame many aspects of your design.
If lots of people have an idea, maybe it has merit? I remember talking to C programmers about the advantages of C#/Java and getting those ideas shot down at first.
To each his own, I simply
To each his own, I simply like Drupal's procedural style and see no convincing reason to change either my preference or Drupal.
--
Drupal services
My Drupal services
--
Drupal services
My Drupal services
So you advocate completely
So you advocate completely abandoning all the users on limited hosts with php4? Should we be going to MySQL5 only as well and not worry about PostGRE? :)
Drupal is several years old. To sign in with a few hour old account without 'getting to know' the community, code and the history is not 'getting shot down' first. It's responding with the short hand answers to issues already debated multiple times. You need to present a truly compelling argument to switch and frankly you probably won't be able to without a better understanding of the history and the code and how it is used.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
Moving things ahead
I don't think a dependency on PHP 5 would be a huge impediment, especially as it's so easy to install a new version of PHP with these Linux repositories--and all of my linux installs use PHP 5. I'm not sure if it makes sense to take a dependency on MySQL 5, especially if you want something which supports multiple databases and so therefore can't have too many intricate dependencies. Also, each dependency decision is different.
My account is new, but I've been lurking on forums here and playing with Drupal for a number of months and have been a programmer for 11 years. Drupal's user base grew by 4x in the last year, so there is bound to be some old discussions getting re-hashed.
I agree that there is a lot to learn about Drupal, but at the same time, the core codebase isn't very large and the issues not so complicated as everything is very componentized. I know the advantages of C++ over C and the new PHP features of richer frameworks and OO constructs I am sure add value. While sharing code and unifying conventions and libraries is hard work, a ton of benefits come out of that, many of which weren't considered at the time. The one I'm most interested in is the ability for Drupal to ship faster and add new contributors and features faster.
I definitely don't think this issue should necessarily be the most pressing issue of Drupal as I do think the upper layers are where most of the interesting work will be done but I do think that if people take a crack at it working their way up, it could be done in an incremental way. Apache's Lucene was ported from Java to PHP as part of the Zend framework; I think it would be easier to port Drupal to PHP 5 + a PHP framework.
The Zend framework team currently has 14 people and probably a virtual team much larger, and growing, like Drupal.
Well, stick around, play
Well, stick around, play with the code and get familier with it. Submit patches to fix things in the current CVS and when that's branched to 4.7 and the next version opens up, then feel free to submit code for feature requests or style's you'd like to see changed.
The php5 mention was a somewhat tongue in cheek rebuttal in any case. :)
Drupal is a meritocracy in work, code and community involvement in a serious way. Things will only move in an area if a) someone provides work to get there and b) can convince a significant portion of the active developers who have been around awhile (and the 3-4 people with cvs commit access to Drupal core). So far the OO argument part hasn't worked out so well as an intro for folks but many survive it. You are also welcome to code contrib modules in an OO manner.
If you haven't, read JonBob's article on Drupal and OO you really should.
http://drupaldocs.org/api/head/file/contributions/docs/developer/topics/...
I will also mention that it's not as if Drupal developers are not unfamilier with php development trends and have at times gotten to chat about aspects of php development with folks familier with php.
In the mean time, as I said, have fun playing with the code. Welcome to the community and hope you sitck around.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
Even though I think OO has
Even though I think OO has it's place, it it not in PHP. I like PHP. I HATE JAVA! Why? It's dependency on OO. Plus, using OO every is inefficient and stupid, IMHO.
PHP offers OO just in case you need to use it. Not to compete with java.
PS: I also treat drupal as a framework. So far so good.
----
http://LandCondos.com
Suspicions
Have you actually looked at the code in detail? Please don't knock Drupal as a framework based on nothing but your expectations.
Cortext Communications
Drupal Themes & Modules
------------------------------------------
Drupal Specialists: Consulting, Development & Training
Robert Castelo, CTO
Code Positive
London, United Kingdom
----
That isn't what I said
My suspicion has to do with the *motivations* of the team writing the code, and reading the code doesn't help with that. But yes, I am spending time reading the code and trying to wrap my head around the pieces.
#135
There is a recent post that it debates this idea. Click here.
Dont think so...
Drupal as a CMS is flexible as all get out, it's true. I would not use anything else to make a php website. with community features etc. It already is kind of a special purpose cms framework. OO orientation with php applications is futile until php allows you access to the exterior of the event loop, like say mod_perl, or fastcgi. Then you could seperate per request actions from initialization actions. Until then might as well just use functions, you have to build the whole thing each request anyway. Zend's framework looks ok, but this one looks better:
http://www.symfony-project.com/
better means better documentation... and good documentation means that you dont have to read 300 lines of source code to find out what the arguments of a function are.
But again, to each job, a set of tools. you could build a similar cms system out of almost any php framework, but unless some idle billionare paid you to do that, then why would you re-invent the wheel?