diff --git a/md2resume_dev.php b/md2resume_dev.php
index a0fbe94..b1e4d11 100755
--- a/md2resume_dev.php
+++ b/md2resume_dev.php
@@ -16,7 +16,7 @@ $app->add('Resume', __DIR__ . '/src');
$console = new Resume\Cli\Resume();
// If we're running from phar, we get these values from the stub
-if (!defined("IN_PHAR")) {
+if (!defined('IN_PHAR')) {
$project = json_decode(file_get_contents(__DIR__ . '/composer.json'));
}
diff --git a/src/Resume/Cli/Resume.php b/src/Resume/Cli/Resume.php
index dc025ce..0e0a3f2 100644
--- a/src/Resume/Cli/Resume.php
+++ b/src/Resume/Cli/Resume.php
@@ -30,6 +30,9 @@ class Resume extends Application
// the alternative is OutputInterface::OUTPUT_PLAIN;
$this->outputFormat = OutputInterface::OUTPUT_NORMAL;
+ // Exits on missing dependencies
+ $this->checkDependencies();
+
// We do this now because we've loaded the project info from the composer file
$this->setName($this->project->description);
$this->setVersion($this->project->version);
@@ -65,6 +68,18 @@ class Resume extends Application
return parent::getLongVersion().' by Craig Davis';
}
+ public function checkDependencies() {
+ $output = new ConsoleOutput();
+ if (!extension_loaded('mbstring')) {
+ $output->writeln(
+ "\nMissing Dependency: Please install the Multibyte String Functions.\n" .
+ "More help: http://www.php.net/manual/en/mbstring.installation.php\n",
+ $this->outputFormat
+ );
+ exit(1);
+ }
+ }
+
public function registerStyles(&$output)
{
// https://github.com/symfony/Console/blob/master/Formatter/OutputFormatterStyle.php