Metatron – CLI tool for S9y
A command line tool (written in PHP) for developers and admins of Serendipity.
There are two ways to install Metatron.
Install the metatron.phar file
Download the phar file to your Serendipity root directory:
Install Metatron from source using Composer
$ git clone https://github.com/s9y/Metatron # Clone the git repository $ cd Metatron $ curl -s https://getcomposer.org/installer | php # Download Composer $ php ./composer.phar install # Use Composer to install all dependencies
Metatron has been tested on Linux and PHP 5.4.9/5.5.3, but should run in other environments and at least PHP 5.3.3.
If you use Suhosin, you should probably add/edit the following line to its config (e.g. /etc/php5/cli/conf.d/suhosin.ini)
suhosin.executor.include.whitelist = php phar
Right now, there are only a few commands. Change to your Serendipity root directory and make sure you have read permissions to
You get a list of all available commands by entering:
$ php metatron.phar list
If you need help running a command, type:
$ php metatron.phar help <command>
Keeping Metatron up to date
As of version 0.1.1, Metatron is able to update itself to the latest version. Just run
$ php metatron.phar self-update
Prints the current S9y version.
$ php metatron.phar diag:version
Information about the current installation
Prints basic information about the current S9y installation.
$ php metatron.phar diag:version
Retrieve S9y config values
Prints the value of one or more Serendipity config keys where the optional argument
name is the name of the config key. Setting the
search option list all config keys that contain
$ php metatron.phar diag:config [-s|--search] [name]
Lists all users in the system. You can enter an optional
$ php metatron.phar user:list [username]
Set new password for user
Set new password for user. Opens a dialog where you must enter the user's new password twice.
$ php metatron.phar user:password username
Flushes cache directory. You can enter an optional cache directory (Default: templates_c).
$ php metatron.phar cache:flush [dir]
Lists all comments, or the last X comments.
$ php metatron.phar comment:list [limit]
List and approve comments, or approve a single comment by id. This will most certainly change in future versions.
$ php metatron.phar comment:approve [commentid]
Lists installed plugins, optional types are 'event' and 'sidebar'.
$ php metatron.phar plugin:list [type]
Metatron configuration file
As of version 0.2.0, Metatron will save certain settings in a configuration file
Setting config values
Sets a value for a specific key.
$ php metatron.phar config:set key value
Creates a dump of the blog's database, schema only or full with data. Optionally gzipped. Requires a backup directory to be set first.
$ php metatron.phar backup:db:dump [--type[="..."]] [--gzipped]
- Make sure you have Composer and Phing installed
- Clone the repository into the Serendipity web root, e.g.
git clone https://github.com/s9y/Metatron.git
cd Metatron && composer install --devto install the dependencies
- You should always create a new version of the
metatron.pharPHAR archive after you finished by simply calling
phing(make sure that
phar.readonly = Offin your php.ini)
- To run commands from the Serendipity web root, either symlink the
metatron.pharPHAR archive or call
php Metatron/console.php [options] command [arguments]as root
If you find a bug in Metatron, please file an issue. Metatron is currently in an alpha state and should not be used on production servers! You have been warned ;)
If you have any further questions, feel free to visit the Serendipity forum.
In order to run the tests provided in the repository, from the Metatron root directory run:
$ phpunit --bootstrap tests/bootstrap.php --configuration tests/phpunit.xml `pwd`/tests/Serendipity/
You need to have PHPUnit (3.7) installed.
Metatron is released under the BSD License. See the bundles LICENSE file for details.