July 19, 2006 3:36 PM   Subscribe

Movable Type PHP library: is it possible to use the PHP library in the same fashion as the perl library?

Maybe I am not making sense. MT comes w/ the perl library, e.g.,, etc.

I've taken lately to writing shell scripts and cron jobs in PHP, but I have one perl script (and another coming) that must be in perl cos they use the MT library to write an automated entry, e.g.:

$entry = MT::Entry->new;
$mt->rebuild_entry(Entry => $entry, BuildDependencies => true) or die $mt->errstr;

So but lately MT comes with an extensive PHP library (mt directory/php/lib). But it seems like this isn't really a library/API, but rather some basic functions. Is it possible to duplicate the above functionality using MT's php lib?
posted by xmutex to Technology (4 answers total)
PHP can do pretty much anything Perl does, as its a full fledged language - so I'm guessing you could rewrite the MT stuff into php. I don't think you'd want to, though, as MT is written in perl so you'd basically have to rewrite a big part of MT in php -- not a small task.

For something like this, you'd probably want to use webservices. Thats the usual way to programmatically create/edit/read posts from a blog. I'm sure that MT supports the metaweblog API, so probably the best way to do is to get a PHP metaweblog library and have that talk to MT.

MT & metaweblog -

metaweblog library in php

These links were from very quick google searches - you may find better resources/libraries if you look harder.
posted by rsanheim at 6:29 AM on July 20, 2006

I will second that the right way to do this would be through an xml-rpc call, rather than reinventing the wheel.
posted by adamrice at 7:46 AM on July 20, 2006

The PHP library that comes with Movable Type is 99%[1] read-only. It is meant to be used to dynamically render blogs. So there are no functions provided to create entries and/or rebuild the static pages from PHP. XMLRPC is the way to go.

The other alternative is to use the Perl-based API and invoke that script from PHP.

[1]: The 1% I allude to above is a feature of MT 3.31 which lets you save back to the database plugin configuration settings by PHP-based plugins.
posted by bschoate at 1:48 PM on July 20, 2006 [1 favorite]

^^^ The ultimate authority, btw...
posted by fooljay at 12:50 AM on February 12, 2007

« Older Dumb calculus question...   |   How do I get my lost Mac Keychain password back? Newer »
This thread is closed to new comments.