update script
This commit is contained in:
19
bin/scan
19
bin/scan
@ -1,6 +1,23 @@
|
|||||||
#!/usr/bin/php
|
#!/usr/bin/php
|
||||||
<?php
|
<?php
|
||||||
require __DIR__.'/../vendor/autoload.php';
|
$paths = [
|
||||||
|
// as a root package or phar
|
||||||
|
__DIR__.'/../vendor/autoload.php',
|
||||||
|
// as a dependency from bin
|
||||||
|
__DIR__.'/../autoload.php',
|
||||||
|
// as a dependency from package folder
|
||||||
|
__DIR__.'/../../../autoload.php',
|
||||||
|
];
|
||||||
|
function init_composer(array $paths) {
|
||||||
|
foreach ($paths as $path) {
|
||||||
|
if (file_exists($path)) {
|
||||||
|
require_once $path;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!init_composer($paths)) die('Run `composer install` firstly.'.PHP_EOL);
|
||||||
|
|
||||||
use wapmorgan\Mp3Info\Mp3Info;
|
use wapmorgan\Mp3Info\Mp3Info;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user