dDeviantArt: 1.0

No, Sorry, This isnt a release :(

dDeviantart 1.0 is in the works and will be 2.5 compatible only, I’ve had to make the choice as i’m completely rewriting it, and would like to take advantage of some of the functionality offered by WordPress 2.5.

Much of the problems which have been reported with the previous version will hopefully be solved, The portfolio Pages issue will be gone for once and all(Possibly replaced by WP 2.5’s gallery functionality).
Caching issues will hopefully be gone with a rewrite of the caching  functions, Infact, Most of the code is getting a rewrite, A New options page will debut which will hopefully fit in with 2.5 better (And it’ll not require javascript which is a step forward)

Hopefully i’ll release it in a week or so, Time permitting.

What new functions are in PHP x.x?

A Question was asked on the wp-hackers mailing list:

Does a map of PHP versions to available functions exist? I can look up the
PHP function reference to see which version a function appeared in, but I’m
not aware of a reverse mapping (and I must be Googling very badly today).

Posting by Jeff Waugh

Well.. I couldnt find one either, So i created a hacked-together list very quickly: http://dd32.id.au/php-functions-by-version.htm

It simply allows you to view what functions were added to a specific PHP version, This was prompted by WordPress moving to PHP 4.3+ for version 2.5 which is due out later this year.

Hopefully its of use to someone.

PHP: SimpleXML + SOAP

Recently after getting into XML parsing with PHP and realising how hard most of the functions were to use, I decided to put it down and that i was going to require PHP5 for all my projects. Great i thought, SOAP, PHP’s got a SOAPClient class!

Personally i didnt like the Soap class, I’m happy to hardcode the values i send to the server,  But i want to read the returned XML easily.

I looked around, and found SimpleXML, And i like it!, It  worked well with all the sniplets of XML i gave it.. Well, Until i actually used it on some live data!

Suddenly SimpleXML refuses to parse the SOAP reply…

Heres a example of XML SimpleXML didnt like:

[sourcecode language=”xml”]<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetProviders xmlns="http://hostname/" />
</soap:Body>
</soap:Envelope>[/sourcecode]

See any problem? Looks valid to me!

The cause of it not parsing though? SimpleXML doesnt like any colons(:) in tagnames or attribute names! If its contained within the value of the tag or attribute its ok though.

So, What can i do? A Mass-replace of all colons? That’d potentially destroy my source data..

I came up with this short snipplet of PHP regular expressions to strip out any colons in the tags/attributes:

[sourcecode language=”php”]$out = preg_replace(‘|<([/\w]+)(:)|m’,’<$1′,$in);
$out = preg_replace(‘|(\w+)(:)(\w+=\")|m’,’$1$3′,$out);[/sourcecode]

The result after this has been done:

[sourcecode language=”xml”]<?xml version="1.0" encoding="utf-8"?>
<soapEnvelope xmlnsxsi="http://www.w3.org/2001/XMLSchema-instance" xmlnsxsd="http://www.w3.org/2001/XMLSchema" xmlnssoap="http://schemas.xmlsoap.org/soap/envelope/">
<soapBody>
<GetProviders xmlns="http://hostname/" />
</soapBody>
</soapEnvelope>
[/sourcecode]

As you can see, the general gyst of the document is there, and its parsable,  just without the colons where simpleXML cant handle them.

MSN: FailedAuthentication Profile accrual is required

I’m writing a PHP MSN ‘framework’ based on MSNP15 at present, This evening the SSO authentication failed with the following message: (Apologies to not having exact XML)

wsse FailedAuthentication
Failure Code: Profile accrual is required 

The cause? MSN has updated the protocol? Nope, I needed to update the profile for that account, upon logging into MSN messenger with it i was asked to fill out my Birthyear and Country. Upon entering those details in its once again working nicely.

Why blog about this? Well, Why not? Google didnt have any comments for the given failure code, might as well get an explanation out there :)