Interesting Article "Experiences of Using PHP in Large Websites"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David

    Interesting Article "Experiences of Using PHP in Large Websites"

    I found and interesting article, "Experience s of Using PHP in Large
    Websites" (http://www.ukuug.org/events/linux2002/papers/html/php/) ,
    which lists some issues with scaling PHP for larger projects. Worth
    a read although it appears to be three years old.

    The major issue I have had with PHP is a conflict in class names for
    modules created by two project teams. We resolved this by prefixing
    all class names with a module ID, ex. "ModuleName__<C lass Name>"

    The only mistake I can see with this article is a statement that you
    can only have one php.ini per server.

    Who is using PHP for larger projects and how do you handle the naming
    issue?



  • Wayne

    #2
    Re: Interesting Article &quot;Experienc es of Using PHP in Large Websites&quot;

    On Thu, 15 Sep 2005 20:03:00 -0500, David <martindb@sbcgl obal.net>
    wrote:
    [color=blue]
    >Who is using PHP for larger projects and how do you handle the naming
    >issue?[/color]

    I use "package" naming where each class is prefixed with it's path
    location separated by underscores. Examples:

    Net_Mail_Messag e
    Web_UI_Control_ TextBox
    Data_Driver_MyS qlConnection

    It's a *very* large PHP5 project.

    Comment

    • Chung Leong

      #3
      Re: Interesting Article &quot;Experienc es of Using PHP in Large Websites&quot;

      David wrote:[color=blue]
      > I found and interesting article, "Experience s of Using PHP in Large
      > Websites" (http://www.ukuug.org/events/linux2002/papers/html/php/) ,
      > which lists some issues with scaling PHP for larger projects. Worth
      > a read although it appears to be three years old.[/color]

      Why do people keep bringing up this stupid article? It's both partisan
      and dishonest. Starting with the title: it purports to be an article
      about the experience of using PHP in large projects, yet there was zero
      discussions about actual problems encounter. Everything is just the
      author's opinions.
      [color=blue]
      > Who is using PHP for larger projects and how do you handle the naming
      > issue?[/color]

      Easy. You just rename one or both of the classes.

      Comment

      • Colin McKinnon

        #4
        Re: Interesting Article &quot;Experienc es of Using PHP in Large Websites&quot;

        David wrote:
        [color=blue]
        > I found and interesting article, "Experience s of Using PHP in Large
        > Websites" (http://www.ukuug.org/events/linux2002/papers/html/php/) ,
        > which lists some issues with scaling PHP for larger projects. Worth
        > a read although it appears to be three years old.
        >[/color]

        Not really - the article is rather badly written, poorly justified, and in
        several instances just plain wrong. I find it remarkable that someone could
        produce so many words about PHP development without mentioning code
        testing. (see recenet thread here regards typing / variable declaration).
        [color=blue]
        > The major issue I have had with PHP is a conflict in class names for
        > modules created by two project teams. We resolved this by prefixing
        > all class names with a module ID, ex. "ModuleName__<C lass Name>"
        >
        > The only mistake I can see with this article is a statement that you
        > can only have one php.ini per server.
        >
        > Who is using PHP for larger projects and how do you handle the naming
        > issue?[/color]

        I have about 600,000 lines of PHP here, 6 programmers and between 1 and 3
        web designers. The servers field about 3 million requests/day. Is that big?

        I use a similar approach - any global symbol in an include file should be
        prefixed by the file name e.g. file transact_db.inc .php might contain fn
        transact_db_ini (), class transact_db, fn transact_db_que ry(), fn
        transact_db_dic onnect()...

        The namespace thing is an old chestnut in PHP circles. I had some time
        recently to have a think about it and wrote my own namespace handler (in
        PHP). Next time I have some time free I'll publish it somewhere.

        The ,ost important advice I could give to anyone embarking on a large-scale
        project using PHP would be:

        - set strict style/naming guidelines - the PEAR ones are a useful starting
        point
        - use unit and integration testing
        - don't worry about scalability - PHP has it in spades

        HTH

        C.

        Comment

        Working...