#!/usr/bin/env php
<?php
require_once dirname(__DIR__) . '/common.php';

if ($argc !== 2) {
    throw new \InvalidArgumentException(basename($argv[0]) . ' requires 1 argument as server state.');
}

if (file_put_contents(SERVER_STATE_DATA, $argv[1]) === false) {
    throw new \RuntimeException('Failed to change server state');
}
