dilbertone Posted December 24, 2010 Share Posted December 24, 2010 hello dear friends - i want to test if the DOMdocument [class] exists? Can i do this in the shell (on OpenSuse 11.3)? bool class_exists ( string $class_name [, bool $autoload = true ] ) bool class_exists ( string $DOMdocument [, bool $autoload = true ] ) or do i have to create a file that i call itself in the shell!? look forward for an idea / hint / tipp regards db1 Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted December 24, 2010 Share Posted December 24, 2010 You don't have to create a file you could run it on the command line. http://www.php.net/manual/en/features.commandline.usage.php $ php -r 'echo (class_exists("DOMDocument")) ? "It exists \n" : "It Does NOT exist \n";' Quote Link to comment Share on other sites More sharing options...
dilbertone Posted December 24, 2010 Author Share Posted December 24, 2010 hello dear Dj KAT, good Evening! You don't have to create a file you could run it on the command line. http://www.php.net/manual/en/features.commandline.usage.php $ php -r 'echo (class_exists("DOMDocument")) ? "It exists \n" : "It Does NOT exist \n";' again - many thanks!! i did the test: suse-linux:~ # martin@suse-linux:~/perl> $ php -r 'echo (class_exists("DOMDocument")) ? "It exists \n" : "It Does NOT exist \n";' -bash: martin@suse-linux:~/perl: No such file or directory suse-linux:~ # Guess that i have to install it now! then i can run your code you posted below (in the other thread)! i will try to install DOMDocument! i will come back and report all my findings! greetings db1 Quote Link to comment Share on other sites More sharing options...
RichardRotterdam Posted December 24, 2010 Share Posted December 24, 2010 Actually that what you showed doesn't mean DOMDocument doesn't exist. It means you ran the command wrong. The dollar sign just indicates it's on the command line you shouldn't run that. Quote Link to comment Share on other sites More sharing options...
dilbertone Posted December 24, 2010 Author Share Posted December 24, 2010 hi there - hello dear DJ Kat well - i am a bit confused! what to say? ;-) Actually that what you showed doesn't mean DOMDocument doesn't exist. It means you ran the command wrong. The dollar sign just indicates it's on the command line you shouldn't run that. hmmm - i want to run the DOM-Document-code you suggested to me: so i am trying my best to get the Linux-box up and running with all that i need to have. Lemme know if i did something wrong!? well i try it on the shell: Question: should i run this: $ php -r 'echo (class_exists("DOMDocument")) ? "It exists \n" : "It Does NOT exist \n";' or this: on the -r 'echo (class_exists("DOMDocument")) ? "It exists \n" : "It Does NOT exist \n";' or so: -r 'echo (class_exists("DOMDocument")) ? "It exists \n" : "It Does NOT exist \n" hmmm - i am a bit confused... love to hear from you! db1 Quote Link to comment Share on other sites More sharing options...
dilbertone Posted December 24, 2010 Author Share Posted December 24, 2010 hello good evening! i was able to run the test: suse-linux:~ # php -r "echo class_exists('DOMDocument') ? 'It exists' : 'It Does NOT exist';" It existssuse-linux:~ # well i am glad - now i can continue with the work on the parser. @DJ Kat: i continue with some tests on the parserscript (you gave me in an other thread - furhter below)] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.