The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 16, 2019, 11:34:23 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: LIBXML_DOTTED_VERSION  (Read 2578 times)
dirk
Global Moderator
Expert
*****
Offline Offline

Posts: 416


View Profile
« on: April 07, 2009, 08:28:45 PM »

Below is a code snippet of a WP plugin which tests the libxml version:

Code:
if (   
        LIBXML_DOTTED_VERSION == '2.7.0' 
        || LIBXML_DOTTED_VERSION == '2.7.1' 
        || LIBXML_DOTTED_VERSION == '2.7.2' 
    ) {   
        // do something
    }   

How can I get the value of LIBXML_DOTTED_VERSION with a simple script
without the WP machine?
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #1 on: April 07, 2009, 09:30:50 PM »

Dirk - I'm running WP 2.2.3 on one of my blogs, so I grepped for LIBXML and didn't find any instance of it at all. What version are you looking at?

I'd imagine that it's part of the libxml library when it's loaded with PHP ie., the constant is defined by the installed module. When you say 'Simple Script' I assume your thinking PERL or shell... I wonder if there's a -i or something calling the libxml SO by itself that you could then parse...?
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
dirk
Global Moderator
Expert
*****
Offline Offline

Posts: 416


View Profile
« Reply #2 on: April 07, 2009, 09:44:58 PM »

Ed - the plugin is used by different WP versions.

It should fix that some versions of libxml2 didnít work properly with PHP,
resulting in brackets being stripped from XML:

http://josephscott.org/code/wordpress/plugin-libxml2-fix/

Normally the libxml version is displayed by phpinfo() but not always.

Hence I was looking for another way to get the version.

The simple script can be a PHP script which should not require WP stuff.

Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #3 on: April 07, 2009, 10:25:23 PM »

Here's a good reference page on libxml and php. It really looks as though you must have libxml installed before any of this works:

http://www.w3schools.com/php/php_ref_libxml.asp

however at the php ref site, it says that the constants are included with 5.1 automatically - I believe the libxml hooks are compiled into 5.1+ automatically unless you explicitly turn them off. This would probably be because there are so many XML functions desired in a garden variety PHP install.

http://us.php.net/manual/en/intro.libxml.php
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
dirk
Global Moderator
Expert
*****
Offline Offline

Posts: 416


View Profile
« Reply #4 on: April 07, 2009, 10:36:18 PM »

Thanks for the links.

Will have a look and test it later today.
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!