Professional Web Applications Themes

newbie oop in php question - PHP Development

Hi All, I've been looking at the php docs and can't find what I'mlooking for contained therein so I'm posing this question here. Can you create packages in php so that you can have related classes together and call them in a packageName.className style like in Java or Python? This would obviously allow a multi-tiered file structure for a project and allow me to compartmentalise the classes I create into loosely related groupings for use when needed. Also is there a useable version of unittest for php to use as an aid in development? Thank you for your time and ...

  1. #1

    Default newbie oop in php question

    Hi All,
    I've been looking at the php docs and can't find what I'mlooking for
    contained therein so I'm posing this question here. Can you create
    packages in php so that you can have related classes together and call
    them in a packageName.className style like in Java or Python?
    This would obviously allow a multi-tiered file structure for a project and
    allow me to compartmentalise the classes I create into loosely related
    groupings for use when needed.
    Also is there a useable version of unittest for php to use as an aid in
    development?
    Thank you for your time and patience. Lol McBride
    Lol McBride Guest

  2. #2

    Default Re: newbie oop in php question

    On Thu, 20 Nov 2003 21:32:48 +0000, Lol McBride <lollolmc.nospam.com>
    wrote:
    >Hi All,
    >I've been looking at the php docs and can't find what I'mlooking for
    >contained therein so I'm posing this question here. Can you create
    >packages in php so that you can have related classes together and call
    >them in a packageName.className style like in Java or Python?
    >This would obviously allow a multi-tiered file structure for a project and
    >allow me to compartmentalise the classes I create into loosely related
    >groupings for use when needed.
    >Also is there a useable version of unittest for php to use as an aid in
    >development?
    >Thank you for your time and patience. Lol McBride
    You can do what you are talking about (sort of). Remember that PHP
    doesn't have the concept of anything at "application level" though.

    An object can contain objects, and you can also make an associative
    array of objects (they are very nearly the same thing in PHP4.x).

    One way of "faking" application level objects would be to store them
    in session variables - PHP will serialise them on the way in so you
    will at least need to check how much data you are putting in them.

    Have a play with a small script to figure it out - that's how most of
    us found our way around it.



    kafooey
    - [email]kafooeynospam.yahoo.co.uk[/email]
    - [url]http://www.pluggedout.com/blog[/url]
    kafooey Guest

  3. #3

    Default Re: newbie oop in php question

    Lol McBride wrote on Thursday 20 November 2003 13:32:
    > Hi All,
    > I've been looking at the php docs and can't find what I'mlooking for
    > contained therein so I'm posing this question here. Can you create
    > packages in php so that you can have related classes together and call
    > them in a packageName.className style like in Java or Python?
    As far as *loading* classes:

    I have created a very simple system (similar to Java's imports) and use that
    for loading classes in my PHP scripts. Check out ActiveLink IORCA at:

    [url]http://www.active-link.com/intranet/software.php[/url]

    There are few packages there but what you are looking for is an
    "include.php" script that contains an import function. Once that's loaded,
    I simply use:

    // for example loading an XMLDoent class
    import("org.active-link.xml.XMLDoent");

    It's an extremely simple process and is used for loading classes only. It
    eliminates filename conflicts, and organizes pretty well. Feel free to
    extend it, everything there is LGPLed.

    --
    Business Web Solutions
    ActiveLink, LLC
    [url]www.active-link.com/intranet/[/url]
    Zurab Davitiani Guest

Similar Threads

  1. Newbie Question: Biz Card Template Question
    By Thomas_Porter@adobeforums.com in forum Adobe Indesign Windows
    Replies: 4
    Last Post: May 30th, 08:08 AM
  2. A newbie with a newbie question
    By dusty_davis@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 5
    Last Post: October 14th, 07:54 AM
  3. A newbie question on SSO
    By Holysmoke in forum ASP.NET Security
    Replies: 2
    Last Post: October 8th, 01:53 PM
  4. Pen Tool Use Question. (Embarrassingly Newbie Question)
    By Bozo Schmozo in forum Macromedia Flash
    Replies: 0
    Last Post: November 12th, 10:00 PM
  5. [newbie] dbi question
    By tsheets in forum PERL Miscellaneous
    Replies: 3
    Last Post: September 10th, 04:26 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139