Friday, April 01, 2011

The new PHP TARDIS Api

Yeah, from PHP 5.4 and further you will be finally be able to access your TARDIS from PHP code:
$t = new Tardis("192.168.0.4"); // the IP address of the TARDIS
$t->configureOwner(11); // only numbers from 1 to 11 supported
                        // but we'll eventually get to 13
You see the innovation here? PHP is providing a new extension with an object-oriented Api instead of a bunch of tardis_*() functions which take as parameters strings, arrays, integers and resources. Indeed we have jumper into the future.
The good news is spreading all over Twitter and in PHP mailing lists, as frameworks and hosting services will never be the same thanks to the use of TARDIS (so much for the Java platform being more powerful for integrating external software.)
What are the advantages of such an Api, directly available as a core extension of PHP? Here's my take.

Translation of pages
Homepage of TARDIS-powered Google Deutsch.
You can access the telepathical hooks of the TARDIS to write your pages only one time, and then translate automatically the content by linking the device to the minds of your users.
Make sure to display an EULA, or some I Accept checkbox, before diving into this feature. However, i18n is finally solved!
Disclaimer: as you can see in the example on the right, it does not work with images for now. It seems that translation of image-contained text is covered by a patent that Gallifreyans couldn't obtain.

Dimensional trascendence
As you know, TARDIS interior is in a different dimension from the exterior appearance. This space is suitable for server clusters and other technology: for example by moving your TARDIS to your server room, you will have an enormous capacity for scaling as it can contain an huge amount of racks.
You may have to install some additional cooling mechanism, however.

Chameleon Circuit
My home servers
You can rent rack space from other companies, but how can you make sure they not fiddle with your servers? You can simply link them to the chameleon circuit of the TARDIS. Their appearance will merge with the background, and no one will be able to find them without your permission.
But that's not all: you can also link newly spawned virtual machines to it via the PHP Api, so that they effectively disapper in the cloud and remain unreachable from attackers!

Teleportation
You can now physically access your production servers in case something is wrong and teleport them to the colocation site for production.
When this PHP script is executed (it can be chained to the failure of tests or to repeated failures of the db connection, or to the detection that someone wants to access your private customer data), the servers linked to the TARDIS are teleported back:
$tardis = new Tardis(...);
$tardis->query('SELECT * FROM servers
        WHERE failed IS NOT NULL')
       ->fetchAll()
       ->teleport('22031', 'Italy'); 
Of course substitute my parameters with your ZIP code and country. And yes, the TARDIS speaks SQL.

My conclusions
PHP is going to be revolutionized and empowered by the TARDIS integration. You'd better hurry up and join a startup based on this new technology - visit the project page for more information on TARDIS-enabled PHP.

No comments:

Post a Comment