#!/usr/bin/env php
<?php

/**
 * This file is part of the ApiGen (http://apigen.org)
 *
 * For the full copyright and license information, please view
 * the file license.md that was distributed with this source code.
 */

require __DIR__ . '/../src/bootstrap.php';

use ApiGen\PharCompiler;

error_reporting(-1);
ini_set('display_errors', 1);

try {
	$compiler = new PharCompiler(__DIR__ . '/..');
	echo 'Creating apigen.phar...';
	$compiler->compile('apigen.phar');
	echo "done. Sha1 of file: ". sha1_file(__DIR__. '/../apigen.phar') . "\n";

} catch (\Exception $e) {
	echo 'Failed to compile phar: [' . get_class($e) . '] ' . $e->getMessage() . ' at ' . $e->getFile() . ':' . $e->getLine();
	exit(1);
}
