SitePoint Sponsor

User Tag List

Page 1 of 4 1234 LastLast
Results 1 to 25 of 80

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Project ZNF: PHP5 Struts-like MVC framework

    Hi, my name is Alessandro 'Aronnax' Rossini and I want to let you know the launch of a new project called ZNF.
    The goal of this project is to provide an open source framework for building PHP5 enterprise web applications. It's based on the Apache Struts project of the Apache Software Foundation, available at http://struts.apache.org.
    This is not the first attempt to rewrite the Struts implementation, or part of it, in PHP, but after spending a lot of time studying existing open source frameworks, like Phrame, PHPMVC, Struts4PHP, Seagull and Vida, we choose to reimplement a brand new framework from scratch for many reasons. First of all, all the mentioned frameworks, except Vida, are written in PHP4 and we believe that its object engine (Zend Engine 1) is too limited for developing enterprise level web application. At the same time the code analyzed is written without a rigorous approach (coding standards, compliance to W3C standards, output of notice/warnings, lack of documentation/examples). Last but not least frameworks claiming to be a porting of Struts have made no code optimization during the porting from J2EE to PHP.
    ZNF is free software released under GNU/LGPL license, the official ZNF home page is at http://znf.zeronotice.com. You will find the main package, a PEAR compatible package and the developer's guide.
    The project has been developed by me and Graziano 'FreeJay' Liberati, we are searching for comments, feedback, bug signaling and best of all new developers. Any kind of contribution will be appreciated, if you find the project interesting join the team!

    Best regards.

  2. #2
    simple tester McGruff's Avatar
    Join Date
    Sep 2003
    Location
    Glasgow
    Posts
    1,690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does this come with a full suite of unit & etc tests?

  3. #3
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by McGruff
    Does this come with a full suite of unit & etc tests?
    Full unit testing, probably using PHPUnit2, is not yet done but it's scheduled for the 0.8.0 release. If new developers will join the team it could be done before.

  4. #4
    SitePoint Guru
    Join Date
    Oct 2001
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't like Struts.

  5. #5
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Struts in Java is a beautiful thing. I have used it and it certainly makes building large sites with a team a structured process.

    I think the central ideas of Struts are shared by many frameworks, but the most successful PHP frameworks have abandoned the idea of porting Struts. Even the Java world is moving away from Struts to more lightweight container based frameworks.

    I would ask Aronnax and FreeJay if they have addressed all the reasons why porting Struts to PHP is a bad idea because of the lack of an application server?
    Christopher

  6. #6
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    I would ask Aronnax and FreeJay if they have addressed all the reasons why porting Struts to PHP is a bad idea because of the lack of an application server?
    I'm not disagreeing with your point here (i.e., porting struts to PHP is a bad idea), but I am with the second part. PHP is an application server itself, in all the senses this phrase covers that I know of -- well, not exactly by itself, but in a conjuction with a Web server underneath.

    I would even go as far to say that PHP is basically a Web application platform using its own proprietary language instead of some more widely used like Java or ECMAScript.

  7. #7
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    I would ask Aronnax and FreeJay if they have addressed all the reasons why porting Struts to PHP is a bad idea because of the lack of an application server?
    The framework is titled "Struts-like" and not "a port of Struts" simply because we've taken from Struts all the ideas that, according to us, could be successful in a PHP5 environment.
    We've replicated the behavior of Struts's RequestProcessor, ActionForm and Action classes, we've also followed the naming conventions for the packages/classes. The rest of the features has been developed keeping in mind the absence of an application server, in few words for each request variables/objects are created and destructed.
    For example the configuration of the front controller is defined in a XML configuration file. What happens in Struts is that this file is parsed and, thanks to the application server, kept in memory for all the time of execution of the application. In PHP this is not possible but it's even unacceptable that the configuration file would be parsed at each request, like happens in many of the cited PHP frameworks claiming to be a port of Struts. What we've done is a chaching mechanism that, at the first request and once the configuration is validated, parses and loads the configuration in an associative array and serialize it to the filesystem. For every successive request, of course if the configuration file is leaved untouched, the framework loads and works only with this array and not with an XML tree, making it extremely fast compared to other solutions.
    Except the roboust implementation of the framework and other cool features, we also think that the developer's guide is very complete and this is one of the key feature where other frameworks doesn't make a lot of work, leaving the API as the sole documentation for developers.
    I hope someone here would look deeper at the project in order to have feedback of any kind, anyway thanks for interesting.

  8. #8
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by aronnax
    What we've done is a chaching mechanism that, at the first request and once the configuration is validated, parses and loads the configuration in an associative array and serialize it to the filesystem. For every successive request, of course if the configuration file is leaved untouched, the framework loads and works only with this array and not with an XML tree, making it extremely fast compared to other solutions.
    I have plans of making a similar application-level persistence for PHP5, although I intend to make it more universal. It will be based on SQLite instead of filesystem, so it will probably be very fast.

  9. #9
    SitePoint Guru
    Join Date
    Nov 2002
    Posts
    841
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    Struts in Java is a beautiful thing. I have used it and it certainly makes building large sites with a team a structured process.

    I think the central ideas of Struts are shared by many frameworks, but the most successful PHP frameworks have abandoned the idea of porting Struts. Even the Java world is moving away from Struts to more lightweight container based frameworks.
    This project implements the same sample application in several Java frameworks. What struck me about the examples was how crufty the struts version looked in comparison to the others.

  10. #10
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Selkirk
    This project implements the same sample application in several Java frameworks. What struck me about the examples was how crufty the struts version looked in comparison to the others.
    I agree. But it sure would be nice if PHP has a crufty old standard as good as Struts.

    The other thing I noticed is that most new Java "frameworks" are not frameworks in the current PHP sense. They are really more component/library "distros" that combine existing controllers, persistence libraries, etc. for you in a easy to use way.
    Christopher

  11. #11
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ZNF 0.7.5 released

    We've just released the 0.7.5 version of the framework with some nice new features. You can check it out at http://znf.zeronotice.com. Don't forget to join the mailing list if you find the project interesting.

  12. #12
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    I agree. But it sure would be nice if PHP has a crufty old standard as good as Struts.

    The other thing I noticed is that most new Java "frameworks" are not frameworks in the current PHP sense. They are really more component/library "distros" that combine existing controllers, persistence libraries, etc. for you in a easy to use way.
    Struts is hard to implement in PHP because it has the power of servlets and JSPs behind it. Besides being an MVC framework, those JSPs with custom tags really rock. I wish there was something similar for PHP. Smarty sucks.

  13. #13
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bonefry
    Struts is hard to implement in PHP because it has the power of servlets and JSPs behind it. Besides being an MVC framework, those JSPs with custom tags really rock. I wish there was something similar for PHP.
    I didn't mean Struts for PHP which has been tried many times. I meant a well written, well designed, broadly used framework that other tool and frameworks builders can expand from.
    Quote Originally Posted by bonefry
    Smarty sucks.
    Agreed.
    Christopher

  14. #14
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    but I am with the second part. PHP is an application server itself, in all the senses this phrase covers that I know of -- well, not exactly by itself, but in a conjuction with a Web server underneath.
    I think the difference is that with an application server the application is compiled and installed into the application server where it's internal state is maintained as a running program. This is very different from PHP where you always start with no state and have to load what you want manually. That is what makes for the key differences between PHP and Java frameworks.
    Christopher

  15. #15
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by arborint
    I think the difference is that with an application server the application is compiled and installed into the application server where it's internal state is maintained as a running program. This is very different from PHP where you always start with no state and have to load what you want manually. That is what makes for the key differences between PHP and Java frameworks.
    In other words, persistence between requests is achieved by keeping the variables/objects/state in memory, while in PHP it is (or can be) achieved using flat files, database etc. Pot-a-to, potato.

    Even PHP has mechanisms, like sessions, to keep states between requests. It just gives you a greater flexibility of how to achieve it.

  16. #16
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BerislavLopac
    In other words, persistence between requests is achieved by keeping the variables/objects/state in memory, while in PHP it is (or can be) achieved using flat files, database etc. Pot-a-to, potato.
    The key difference between servets and cgi (or mod_php) is that servet is loaded once and keeps running between requests. This is much like desktop (or daemon) programming, where the single physical instance of running program handles mutiple events or requests.

    And no, php is not an application server. Although it's hard to define "application server" formally, it's easy to understand by example.

  17. #17
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In other words, persistence between requests is achieved by keeping the variables/objects/state in memory, while in PHP it is (or can be) achieved using flat files, database etc. Pot-a-to, potato.

    Even PHP has mechanisms, like sessions, to keep states between requests. It just gives you a greater flexibility of how to achieve it.
    I didn't say you couldn't achieve simlar things using either Java or PHP. My point was that you have to do very different things to achieve the same result. For example having a single, large memory resident data map with information about each pages' configuration makes sense with an application server. Loading a very large data map every request in PHP does not make a lot of sense. Another example is the difference between how Hibernate does what it does and what can be done in PHP also demonstrates this difference as well.
    Christopher

  18. #18
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree. My point was that what makes PHP an application server is the fact that it can do all the things an app server can, although a bit differently than most app servers. And that makes it an app server.

  19. #19
    SitePoint Zealot
    Join Date
    Feb 2003
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My point was that what makes PHP an application server is the fact that it can do all the things an app server can, although a bit differently than most app servers. And that makes it an app server.
    So basically every webserver that supports cgi/fcgi (and thereby every language you can use with it) is an app server by your definition, or maybe even every language that supports sockets (and thus allows you to reimplement a webserver on your own).
    I am not sure wether it is helpful to define the term so broadly. I find the narrower definition (as per arborint) to be of more use.

  20. #20
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by R. U. Serious
    I am not sure wether it is helpful to define the term so broadly. I find the narrower definition (as per arborint) to be of more use.
    You might have a point here, although I'm still very uncertain what would be the most precise definition of a (Web) application server.

    The Hitchhiker's Guid... I mean, the Wikipedia is not of much help here: all it says is "An application server is a server computer in a computer network dedicated to running certain software applications. The term also refers to the software installed on such a computer to facilitate the serving (running) of other applications."

  21. #21
    SitePoint Guru
    Join Date
    Oct 2001
    Posts
    656
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's what you get when marketing people make the concept definitions, as is the case in the IT industry today

  22. #22
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It will be based on SQLite instead of filesystem, so it will probably be very fast.
    But not very flexible in the true nature of the term of what a Relational Database Management System represents. SQLite is a poor mans excuse for a database, much like SimpleXml is a poor mans excuse for the DOM, but that's a personal point of view

  23. #23
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sax, simple xml, and dom xml (even php xpath) all have their places.


    so this thread isn't totally hijacked

    aronnax ->

    good job with the documentation, its a pet peeve of mine. and job prefixing your classes. and providing alot of graphs


    i have to ask though, are you guys using smarty or have it intregrated with the frame work? (have to ask cause of the code examples)

    also do you guys have an HttpRequest class or similar function to check for magic quotes and act according? cause i saw a bunch of addslasshes() on post data in the code examples.

    will you be putting in code examples in the api documentation?

    and will you build chms of both documents ? or place the document in other versions other than pdf? flash paper? (i have 2.8ghz cpu and 1.5 g of ram and acrobat still takes its sweet little time. )

    also what about a traditional error handler in case of people using php 4 code or with trigger_errors or php's core errors and etc, how are they handled?

  24. #24
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mx2k
    i have to ask though, are you guys using smarty or have it intregrated with the frame work?

    also do you guys have an HttpRequest class or similar function to check for magic quotes and act according? cause i saw a bunch of addslasshes() on post data in the code examples.

    will you be putting in code examples in the api documentation?

    and will you build chms of both documents ? or place the document in other versions other than pdf? flash paper?

    also what about a traditional error handler in case of people using php 4 code or with trigger_errors or php's core errors and etc, how are they handled?
    We make use of Smarty and PEAR_DB libraries in our framework, but, as reported in the documentation, view and model layer classes are to be considered as helper classes, you can use them or continue using your preferred technologies.

    As regard the check for magic quotes, this is not yet handled by ZNF, we will probably add a BeanUtil class in next releases in order to automatically populate ActionForm properties, and probably this will be the best place where to add this and other kind of checks.

    The documentation has been written with Latex, so possible output formats are dvi, ps and pdf, we choose the last one because is the most widely used. It's possible to convert Latex to HTML but the result is very ugly, I don't know if there are other possible output formats, proposal are welcome! Some code example are already present in the API but we will continue to focus to the News Demo example because we think it is more useful for new developers.

    PHP4 style error handling for now is leaved untouched. We are evaluating to switch to PEAR_Error/PEAR_Exception once PEAR version 1.4.x is out.

    Would you like to contribute in some of this topics? It will be appreciated
    Regards.

  25. #25
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, another PHP framework.

    I really hope some day a really good framework will replace all those wannabe. PHP really lacks a good framework. I don't know if Struts is such a good MVC example for PHP, but it's at least the best we've got, so stick with it.

    A piece of advice: drop Smarty from your project and use at least a template manager that have tags written in XML. When all the world is starting to use component and event based arhitecture (asp.net, tapestry, jsf) with templates that can be designed with visual tools and that can be parsed with XSL, only PHP does a really good job of being stuck with that dinozaur.

    You say that one can use any template manager with your framework, but that's exactly what's missing from the PHP puzzle, a good standards aware template manager. Why not consider making a good template manager ? JSP like, or Cocoon like ?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •