Skip to content

Commit

Permalink
Fix invalid path to autoloader when using mo with composer (#54)
Browse files Browse the repository at this point in the history
Fixes #30.

See PR #46 from Learnosity/bug-invalid-path-to-mo

Commits included:

* Incorrect path in `mo` pointing to vendor folder

(cherry picked from commit 7ae40ac)
  • Loading branch information
ttton authored Oct 8, 2019
1 parent 3c4fa70 commit 241e602
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion bin/mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
#!/usr/bin/env php
<?php

require __DIR__ . '/../vendor/autoload.php';
foreach (
[
__DIR__ . '/../../../../vendor/autoload.php',
__DIR__ . '/../../autoload.php',
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/vendor/autoload.php'
] as $file
) {
if (file_exists($file)) {
define('AUTOLOAD_PATH', $file);
break;
}
}

unset($file);

if (!defined('AUTOLOAD_PATH')) {
fwrite(STDERR, 'Cannot find the Composer autoloader' . PHP_EOL . PHP_EOL);
die();
}

require_once AUTOLOAD_PATH;

use LearnosityQti\Commands\ConvertToLearnosityCommand;
use LearnosityQti\Commands\ConvertToQtiCommand;
Expand Down

0 comments on commit 241e602

Please sign in to comment.