Jump to content

how to test if the DOMdocument [class] exists?


dilbertone

Recommended Posts

 

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

 

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)]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.