Page 1 of 2 12 LastLast
Results 1 to 15 of 30

Thread: PHP5!

  1. #1
    Join Date
    18th November 2004 - 11:00
    Bike
    big gay1 that I am not licenced to use
    Location
    Whangarei
    Posts
    2,545

    Blah PHP5!

    Wow, I have started migrating some of my scripts over and decided to completely rebuild from the ground up, and I must say - I am in love the error handling, it is sooo good that I find myself overusing it ...

    How can you not love PHP5?...

    PHP Code:
    <?php
    class xmlException extends Exception {

        function 
    __construct() { //print_r($this); }

    };

    class 
    xml extends DOMDocument {

        public function 
    __construct( ) {
            
    parent::__construct();
        }

        public function 
    loadFile($file) {
            try {
                
    self::fileExists($file);
                
    parent::load($file);

                return 
    true;
            } catch (
    xmlException $e) {
                
    // File Not Found
                
    return false;
            }
        }

        public function 
    saveFile($file) {
            try {
                
    self::fileDoesExist($file);
                
    parent::save($file);

                return 
    true;
            } catch (
    xmlException $e) {
                
    // File Exists
                
    return false;
            }
        }

        private function 
    fileExists($file) {
            if (!
    file_exists($file)) throw new xmlException();
        }
        
        private function 
    fileDoesExist($file) {
            if (!
    file_exists($file)) throw new xmlException();
        }

    }

    ?>
    edit:
    Quiz,
    I threw in 2 sneaky little syntax errors, try find it..


  2. #2
    Join Date
    12th May 2004 - 23:54
    Bike
    Honda Jade 250 + CBR600RR
    Location
    Wgtn
    Posts
    1,132
    *without turning, walks away very, very slowly*
    liberi minutalem amant

  3. #3
    Join Date
    18th November 2004 - 11:00
    Bike
    big gay1 that I am not licenced to use
    Location
    Whangarei
    Posts
    2,545
    Quote Originally Posted by Velox
    *without turning, walks away very, very slowly*
    Don’t you mean sacrifice a couple of virgins and a cow?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Untitled-1 copy.jpg 
Views:	34 
Size:	28.4 KB 
ID:	12109  


  4. #4
    Join Date
    18th November 2004 - 11:00
    Bike
    big gay1 that I am not licenced to use
    Location
    Whangarei
    Posts
    2,545
    I also just realised that that base script is no good, so am starting again - still feel free to find the sneaky syntax errors, it will be fun


  5. #5
    Join Date
    2nd May 2005 - 01:22
    Bike
    2012 Moto Guzzi Stelvio 8V
    Location
    Perth, W.A; ex Tauranga
    Posts
    1,720
    No comment.
    Marty

    Ever notice that anyone slower than you is an idiot, but anyone going faster is a maniac?

  6. #6
    Join Date
    7th September 2004 - 10:00
    Bike
    A Krappisaki Tractor
    Location
    South
    Posts
    941
    Quote Originally Posted by John
    How can you not love PHP5?...
    When you work in asp and asp.net
    The contents of this post are my opinion and may not be subjected to any form of reality
    It means I'm not an authority or a teacher, and may not have any experience so take things with a pinch of salt (a.k.a bullshit) rather than fact

  7. #7
    Join Date
    15th January 2005 - 11:00
    Bike
    Zilch
    Location
    Dirty ol' Nappies
    Posts
    1,049
    **Leaves the room in silence. Comes back and throws milkshake at John **

    Peace hath higher tests of manhood

    than battle ever knew.

  8. #8
    Join Date
    18th November 2004 - 11:00
    Bike
    big gay1 that I am not licenced to use
    Location
    Whangarei
    Posts
    2,545
    Quote Originally Posted by TwoSeven
    When you work in asp and asp.net
    BAH! EVIL EVIL EVIL EVIL...

    I dab in asp but I just hate its database support...


  9. #9
    Join Date
    26th February 2005 - 15:10
    Bike
    Ubrfarter V Klunkn,ffwabbit,Petal,phoebe
    Location
    In the cave of Adullam
    Posts
    13,624
    Quote Originally Posted by John
    BAH! EVIL EVIL EVIL EVIL...

    I dab in asp but I just hate its database support...
    Meh. Kiddy code. Join the dark side. Cobol and ABAP and C
    Quote Originally Posted by skidmark
    This world has lost it's drive, everybody just wants to fit in the be the norm as it were.
    Quote Originally Posted by Phil Vincent
    The manufacturers go to a lot of trouble to find out what the average rider prefers, because the maker who guesses closest to the average preference gets the largest sales. But the average rider is mainly interested in silly (as opposed to useful) “goodies” to try to kid the public that he is riding a racer

  10. #10
    Join Date
    18th November 2004 - 11:00
    Bike
    big gay1 that I am not licenced to use
    Location
    Whangarei
    Posts
    2,545
    Quote Originally Posted by Ixion
    Meh. Kiddy code. Join the dark side. Cobol and ABAP and C
    Kiddy code? PHP?

    Its just so many little kids throw an include() into there file and think that they can code, I think you would be surprised what PHP can do, C pisses me off, but then I dont have a decent debugger and studio.net is a faggort.

    If I had visual C++ developer I would get into it more methinks


  11. #11
    Join Date
    8th August 2004 - 17:16
    Bike
    1999 GSXR1100W, 1975 CT90
    Location
    Upper Hutt
    Posts
    5,551
    Wha? What is this language you speak of?

  12. #12
    Join Date
    6th November 2004 - 14:34
    Bike
    SUZUKI TR50 STREET MAGIC
    Posts
    2,724
    OGRE HATES NNNNEEEEEERRRDDDDSSSSS

  13. #13
    Join Date
    18th November 2004 - 11:00
    Bike
    big gay1 that I am not licenced to use
    Location
    Whangarei
    Posts
    2,545
    Quote Originally Posted by WINJA
    OGRE HATES NNNNEEEEEERRRDDDDSSSSS
    But nerds love you, gimmie love down there...


  14. #14
    Join Date
    26th February 2005 - 15:10
    Bike
    Ubrfarter V Klunkn,ffwabbit,Petal,phoebe
    Location
    In the cave of Adullam
    Posts
    13,624
    Quote Originally Posted by John
    Kiddy code? PHP?

    Its just so many little kids throw an include() into there file and think that they can code, I think you would be surprised what PHP can do, C pisses me off, but then I dont have a decent debugger and studio.net is a faggort.

    If I had visual C++ developer
    I would get into it more methinks
    Meh. get Vi from Here . What more you need ?

    Gcc and gcc++ from Here
    and gdb debugger (none better) from same place

    Cost = $0. Good sauce HP sauce, better source Open source.
    Quote Originally Posted by skidmark
    This world has lost it's drive, everybody just wants to fit in the be the norm as it were.
    Quote Originally Posted by Phil Vincent
    The manufacturers go to a lot of trouble to find out what the average rider prefers, because the maker who guesses closest to the average preference gets the largest sales. But the average rider is mainly interested in silly (as opposed to useful) “goodies” to try to kid the public that he is riding a racer

  15. #15
    Join Date
    7th September 2004 - 10:00
    Bike
    A Krappisaki Tractor
    Location
    South
    Posts
    941
    Quote Originally Posted by John
    BAH! EVIL EVIL EVIL EVIL...

    I dab in asp but I just hate its database support...
    Its pretty good now. .net is a bit obfusticated tho.
    The contents of this post are my opinion and may not be subjected to any form of reality
    It means I'm not an authority or a teacher, and may not have any experience so take things with a pinch of salt (a.k.a bullshit) rather than fact

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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