From 4fa3a7abfd88045385a6dd60fd4741e4aba1ec98 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Wed, 19 Feb 2014 19:41:12 -0600 Subject: [PATCH] Moving moontoast/math and symfony/console to require-dev; fixes #20 --- bin/uuid | 11 +++++++++++ composer.json | 8 +++++--- tests/bootstrap.php | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/bin/uuid b/bin/uuid index 1ce97bc..ddfdc61 100755 --- a/bin/uuid +++ b/bin/uuid @@ -37,6 +37,17 @@ if (!defined('UUID_COMPOSER_INSTALL')) { ); } +// We require the Symfony Console component and Moontoast\Math to run +// this command line tool. +if (!class_exists('Symfony\Component\Console\Application') || !class_exists('Moontoast\Math\BigNumber')) { + die( + 'To use the uuid command line tool, you need to install symfony/console' . PHP_EOL . + 'and moontoast/math. To do so, run the following Composer commands:' . PHP_EOL . + '' . PHP_EOL . + 'composer.phar require "moontoast/math=~1.1" "symfony/console=~2.3"' . PHP_EOL + ); +} + use Rhumsaa\Uuid\Console\Application; use Rhumsaa\Uuid\Console\Command; diff --git a/composer.json b/composer.json index 804ac42..95246ca 100644 --- a/composer.json +++ b/composer.json @@ -20,16 +20,18 @@ "source": "https://github.com/ramsey/uuid" }, "require": { - "php": ">=5.3.3", - "moontoast/math": "~1.1", - "symfony/console": "~2.4" + "php": ">=5.3.3" }, "require-dev": { + "moontoast/math": "~1.1", + "symfony/console": "~2.4", "doctrine/dbal": ">=2.3", "phpunit/phpunit": "~3.7" }, "bin": ["bin/uuid"], "suggest": { + "moontoast/math": "Support for converting UUID to 128-bit integer (in string form).", + "symfony/console": "Support for use of the bin/uuid command line tool.", "doctrine/dbal": "Allow the use of a UUID as doctrine field type." }, "autoload": { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index d4a0abd..1710d4a 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -3,7 +3,7 @@ error_reporting(E_ALL | E_STRICT); // Ensure that composer has installed all dependencies -if (!file_exists(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'composer.lock')) { +if (!file_exists(dirname(__DIR__) . '/vendor/autoload.php')) { die("Dependencies must be installed using composer:\n\nphp composer.phar install --dev\n\n" . "See http://getcomposer.org for help with installing composer\n"); }