SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 48
  1. #1
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP5:: namespace ennumeration.

    Is there any way to ennumerate namespaces for classes inside them, ie Something similar to the get_class() & get_class_methods() ?

  2. #2
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't worry about it. namespaces are now gone from PHP5.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    UK
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is that definite?
    I thought there was still heated debate on the issue.

    http://blogs.phparch.com/index.php?m=200305#134

  4. #4
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There was a heated debate, but Zeev said they're done, so there isn't really much discussion about it anymore...

    (At least that's the way I interpreted it when I read the comment from dev's etc)
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  5. #5
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, namespaces has been cleaned from the cvs, and looks like it won't come back with the first unless someone manages to come up with a good implementation.

  6. #6
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nucleuz
    Yeah, namespaces has been cleaned from the cvs, and looks like it won't come back with the first unless someone manages to come up with a good implementation.
    I would ask why, but i'm too drunk to askk why and read amy more...

  7. #7
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Poland
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    namespaces would slow everything very much, thats why they wont add them

  8. #8
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would ask why, but i'm too drunk to askk why and read amy more...
    Think the argument was they couldn't find a good way to implement an "import" keyword, without which they felt they were adding nothing with namespaces.

    Personally I don't think this was the right decision - my reasoning;

    It looks like one day namespaces will be included again (if they sort out import).

    Syntax wise, PHP5 introduces some relatively major additions. The upheaval of migrating class libraries to take advantage of these libraries is something developers are only likely to want to do once, and in one go, with the release of PHP5. Let's face it reviewing old code is usually dull and laborious.

    Introduce namespaces later and no one will use them (or at least old libraries won't be updated).

    This leads me to train of thought which is not so positive about what's going on at the core of PHP.

    How hard can it be to implement "import"? For me it would seem you only need to impose the rule that namespaces must correspond to directories and class names to file names. You then search the include path looking for them.

    Of course that might take time and slow down PHP scripts alot. Most languages that do this (including Python) do some kind of compilation of the source so the files a linked on further executions. Of course compiled PHP comes with a price tag... Perhaps I'm wrong. Certainly missing namespaces, as many have pointed out, won't impress people who were really hoping push PHP software to their clients.

    One other thing that's been bothering me (just getting it off my chest) is this blog by Sterling Hughes. Now he's not saying what exactly it is about ASP.NET technology that's better than PHP technology.

    Either he means the core of .NET, clr etc. etc. which he feels is written way better than the core of PHP (which is probably true, given the $$s spent on .NET) or he means that the .NET class library is delivering something way further ahead than anyone has done with PHP anywhere.

    Now the latter simply isn't true. There are some amazing frameworks and libraries written in pure PHP (e.g. eZpublish, Krysalis, binarycloud, phpHtmlLib) which offer a real challenge to ASP.NET. Some of the design of eZ publish, for example, are truly innovative IMO and have no match in ASP.NET right now.

    What Sterling's post suggests to me is he fundamentally believes you can't write much more than if/else with PHP, after which you should turn to a "real language" and write an extension instead.

    Contrast that with a language like Python where alot of the core libraries which developers rely upon (and are part of it's distribution) are written in Python.

    Anyway, I really hope that with PHP5, once it's released and the remaining bugs have been found, the core brains will quit messing with it for a while and devote some time organizing a solid and standard class library, written in PHP (i.e. refactoring PEAR) so PHP developers can stop re-inventing the wheel and have some standards to work to.

    Sorry - just ranting.

  9. #9
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I agree with Harry 100%. I'm still very new in the world of development but from what I hear, PHP is one of the most popular languages, but it also has so much untapped potential.

    The upcoming release of PHP5, at the start, looked like a Godsend, an entirely reworked and upgraded object model that could compete with languages such as ASP/.NET and a whole host of new features which everybody raved on about. Now, it isn't looking as great as we all thought and you really gotta ask why?

  10. #10
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's worrying isn't it ?

    I'm not one for namespaces and I'd proberly never use them anyway; but I think having them from the first release would have been a great benifit for PHP but now, to me it's now only half finished.

    Also, is this the start of something more ? Like, what else is going to be missing from the release ?

    Something for you to think about aye ?

  11. #11
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I read Zeev's comments, and it doesn't seem like there is plans to remove anything else, it seemed like their implimentation of namespaces was just somewhat buggy and not very well thought out from the get go.

    He also made mention that it is better to remove it sooner than later.


    I certainly hope they are thinking of a better way to impliment namespaces. It might have been better not to have them in the first place, as now I've been using them, and suddenly they are gone, I found them excellent for grouping functions, etc.

    (I had typed up a really long reply on how I think the 'import' function could be made to work, but then I went to eat, and accidentally closed the browser when I got back, and I'm not typing it again, lol, just thought I'd mention that )
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  12. #12
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ... And you can't really blame it on booze either...


  13. #13
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    UK
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good post HarryF.
    Did you see that further down in the comments (June 6, 3:39pm) Sterling expands on his comments?

  14. #14
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yer, and it looks like Jeremy C W has a few things still to learn about PHP IMO

  15. #15
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you see that further down in the comments (June 6, 3:39pm) Sterling expands on his comments?
    Just been reading - whoa - discussion exploded.

    That post of Sterling, reading his list of PHP "pros" I still get the feeling that he doesn't trust PHP itself, as a language. Who knows - perhaps he doesn't actually use it that much?

    The point is looking at other languages that implement some kind of interpreter the pattern is the same for all; the implement a runtime in whatever language then implement a class library in a language the runtime was designed for. Java and Python are two prime examples. Much of .NET's class library in written in C# I believe.

    Once PHP5 is released, it's down to PHP to "save" itself, implementing the class library to bring it up to a level of .NET and Java. To make that happen the PHP community really needs to explore what Java and .NET (and Python) are doing and use it as guidance.

    Anyway... nuff ranting.

  16. #16
    Talk to the /dev/null Theiggsta's Avatar
    Join Date
    Mar 2001
    Location
    Tampa, FL
    Posts
    376
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Harry, I completely agree. I am getting out of PHP soon because it will take at least 5 years for PHP to make a turnaround to a decent language. Almost everything I am doing in PHP is cheating the system or some kind of hack/workaround. Heck PHP cannot process XSLT quickly at all (load times when processing a simple XML document with 5 loops exceeds 100ms and thats with one user, imagine about 5,000 hitting that at once)

    For those who don't know about the lawsuit, Microsoft copied Sun's Java source into what is now known as C# and the ASP.NET framework. All the core serverside and clientside principles have been copied, but also improved upon. Don't get me wrong, I don't mind if microsoft wishes to buyout or copy someone, but if they do have the courtesy to improve on what the other didd'nt, I take notice.

    I think ill be switching over to something waay more structured like mod_perl which is quick as lightning or giving ASP a shot, if I can find an inexpensive host possibly. PHP is cluttered, littered with lots of frameworks and ideas, but no single solution or agreement. Everyone wants the language to be something it *cannot* which impedes any further advancement of the language.

    Java and Perl are by far some of the most structured languages out on the net, being the most popular, its no wonder Microsoft and PHP are taking after them and making their own version, but this is quite absurd. I long for the day when a company like Microsoft will contribute to the cause instead of making their own war. It only corporatizes the languages and reduces use and popularity. If you look at Java today, there is little to no open-source movements to the cause because corps have been given the exclusive keys to the language and made their own version of the language for their servers.

    Macromedia has at least stepped up to the plate and begun to replace Java clientside(flash MX) and embraded Java's very powerful serverside abilities (coldfusion is now pure Java).

    Coming back to the subject at hand, PHP has to either stake its own name in the industry by creating a better versions of its language. I would honestly suggest a C++/Java api approach where the modules use and load your applications not as pages, but as applications and plugins. This allows for limitless extensibility as you could write new processing components in its own native language alogn with the ability to run the entire thing from memory which reduces load times and server processing load. I am not here to shoot down languages, just letting everyone know that you can learn from mistakes, not make them again and again.

    Ill cease with the rant, its my little chip in after the 2+ years ive been developing with PHP.
    Aaron "Theiggsta" Kalin
    Pixel Martini
    Ruby and Rails Developer

  17. #17
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know its abusing the original intention of such a thing, but considering PHP5 has the ability to use nested classes surely Namespaces are largely irellevent?

    And as someone in one of those blog comments said, this whole "enterprise ready" schpiel is little more than a major inferiority complex on many peoples behalf. Would people consider C an inferior language because it doesn't have namespaces? Or ANY OO constructs?

    The syntax does not make the language people.

  18. #18
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know its abusing the original intention of such a thing, but considering PHP5 has the ability to use nested classes surely Namespaces are largely irellevent?
    Very true. Without import they're basically the same thing - syntactic sugar as some put it.

    And one hand I agree the "enterprise ready" argument is also a hoax - PHP already is in the enterprise.

    But some things seem to be required for a language to get serious minded folk really interested in it.

    For me what's an interesting comparison to PHP is Python. From an OO point of view, when it comes down to it, Python isn't much better off than PHP4 in particular no private / protected members. Certainly PHP5 will be looking (to some extent) stronger than Python 2.2. But it's got all sorts of people raving about it with IBM practically promoting it while PHP4 is criticized for not having things Python is also lacking.

    My guess as to why, from what I've seen of Python 2.2, is it signposts the "right way" to code pretty clearly, thereby encouraging standards. Plus Python has got a ton extensions for things like GUI development. The overall development experience is more organised and means time saved (although for documentation, Python's got a way to go IMO).

    Anyway - it's no train smash. There are more important things PHP5 brings, such as exception handling.

  19. #19
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems to me that every single one of these "PHP vs *" debates always seems to boil down to "PHP doesn't have a decent class library". Which in my mind equates to "Nobody else has done all my work for me, so it can't possibly be as good as another language where someone has".

    PHP5 will add a lot of extremely useful features, the best one to my mind being the exception handling. Namespaces are NOT a big deal to anyone who takes a bit of care with their code.

    But then another criticism of PHP also seems to be "It doesn't hold my hand for me". Well tough, maybe you should learn to code a bit better.

  20. #20
    Sidewalking anode's Avatar
    Join Date
    Mar 2001
    Location
    Philadelphia, US
    Posts
    2,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by HarryF
    My guess as to why, from what I've seen of Python 2.2, is it signposts the "right way" to code pretty clearly, thereby encouraging standards. Plus Python has got a ton extensions for things like GUI development. The overall development experience is more organised and means time saved (although for documentation, Python's got a way to go IMO).


    While the official docs aren't the best (as a direct comparison to PHP), between docstrings, Python's introspection features, PyDoc, the free books and resources(Dive Into Python, How to Think Like a Computer Scientist, Effbot.org and the Standard Library Book, Thinking in Python, tons more), Python has PHP murdered.

    I'm not sure how much poking around you've done in Python, but to my (untrained to OOP eye), Python's OOP features are leagues beyond PHP's, for example:
    http://www.onlamp.com/pub/a/python/2...taclasses.html
    http://aspn.activestate.com/ASPN/Coo...Python?kwd=OOP
    TuitionFree — a free library for the self-taught
    Anode Says...Blogging For Your Pleasure

  21. #21
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    May be I shouldn't have said that The fact that everything in Python is an object (including functions ) suggests the core engine is way ahead.

    But you're right; aside from fiddling with Python and SOAP, haven't done anything serious with it yet. What was scary was a tutorial (somewhere) on IBM about Python and wxWindows which had be knocking up my own Python web browser in about 50 lines of code!

  22. #22
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Phil.Roberts
    It seems to me that every single one of these "PHP vs *" debates always seems to boil down to "PHP doesn't have a decent class library". Which in my mind equates to "Nobody else has done all my work for me, so it can't possibly be as good as another language where someone has".
    Yes, that and it's lacking OOP feature set. While it's okay, other languages are more rich at that area.

    But then another criticism of PHP also seems to be "It doesn't hold my hand for me". Well tough, maybe you should learn to code a bit better.
    While things like advanced OOP features, class librares, and IDE:s can be called "holding your hand", I'd rather see them as tools which makes be an even better developer.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  23. #23
    SitePoint Member
    Join Date
    Apr 2003
    Location
    Beirut Lebanon
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all
    I have been away from php and its community for nearly a month now (for personal reasons) but what I remember was a high optimistic atmosphere that php would be ready for the enterprises and such stuff… nearly two month ago I read an interview with Mr. sterling whom I respect his views regarding php (having read his book) he said some thing about not liking some features in the upcoming php5.
    But now after what we read in the web log there is two things I can come out with either this guy have found out that php has no future, or there is some thing wrong and M$ has some thing with it…

  24. #24
    Talk to the /dev/null Theiggsta's Avatar
    Join Date
    Mar 2001
    Location
    Tampa, FL
    Posts
    376
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think PHP in version 5 needs to implement a modules system like PERL. Where users can create extensions in native PHP. Allowing you to create and reuse components, etc.

    That would be the grounds of php becoming a more serious language as a whole. Where your not constrianed by the extensions compiled in the install of PHP.
    Last edited by Theiggsta; Jun 12, 2003 at 19:47.
    Aaron "Theiggsta" Kalin
    Pixel Martini
    Ruby and Rails Developer

  25. #25
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or impliment something like dl() in Module mode.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.


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
  •