SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Mar 2003
    Location
    ny
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Object-Oriented PHP

    This is somewhat of a repost of http://www.sitepointforums.com/showt...009#post876009. I am researching different ways of creating an extensible object-oriented application framework for PHP. I am not crazy about PHP Nuke, although they do have a large user base and alot of support from the open source community. PHP Nuke does serve its purpose.

    I want to create this framework using mostly classes if possible. I've read Kabir's "Secure PHP Development," and although it had a couple of bad reviews, I thought that it was an interesting way to approach application development. I'm sure that Java developers are used to that kind of programming, but I think that many PHP developers still use procedural code for their applications. This makes it difficult to debug and extend. It makes sense to create an error class and a debug class to handle all of the complexity of these tasks. It is also nice to have a centralized authentication/authorization scheme that works.

    The only thing that disappointed me about the book was the fact that Kabir didn't explain how to extend the framework to create extra functionality. You want to create class modules that can be added to the application without changing any of the underlying code. You want to use the same centralized authentication/authorization scheme for each module. You also want to be able to catch errors and debug the application using the same error and debug classes.

    I am really starting to see the benefits of using OOP to create applications and PHP Web sites. Has anyone read Kabir's book, and if you have, what do you think are its strong points? Weak points? Would you follow his way of building applications? If not, how would you do it differently?

    I would appreciate any feedback on this topic. I'm sure that there must be a few of you out there that would be interested in this topic. Go to Barnes and Nobles or Borders Bookstore and skim through Kabir's "Secure PHP Development" if you haven't done so and if you are interested in Object-Oriented PHP.

  2. #2
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Umm.... Personally I wouldn't go down the PHPNuke road since there are a few other options... PFrame comes to mind as one for example ?

    Okay it doesn't have the community support but to me this would be far easier to exploit that what PHPNuke would be ?

  3. #3
    SitePoint Enthusiast CamelToe's Avatar
    Join Date
    May 2003
    Location
    Canada
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Sample Simple Site

    Well,

    This certainly isn't the best coding job.

    I've included the VERY FIRST draft of my 'simple framework' if you wanted to call it that.

    I want to create this framework using mostly classes if possible.
    This pretty much does the job.

    Its NOT MVC, I am not stating that it follows MVC Design Pattern. It was just a Hack.

    I finally got the Martin Fowler Book on Design Patterns and I would love to eventually redo the entire thing using what I will have learned from there.

    By the way, this SimpleApp uses Eclipse Library , so you will have to download it and put it in the /application/Classes folder.

    Make sure you change the settings in the /application/init.php to fit your needs.

    I'm open to suggestions on what I have done here. I do not mean to start another MVC Rant. I just thought I'd share my 'work'.

    By the way, I have reworked (not refactored) some of this code, this is an older version, but at least it works and will give you an idea of what I've done.
    Attached Files Attached Files

  4. #4
    SitePoint Zealot jinx3's Avatar
    Join Date
    May 2002
    Location
    Vancouver, WA
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So how is the book???
    jinx
    superbubba.com
    If you want to learn something . . . start doing it!


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
  •