Added PHP based stuff.
Added other stuff from PHP version.