Skip to content

The correct registration of binary script for composer #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions bin/phpcr
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/usr/bin/env php
<?php

$vendorDir = __DIR__.'/../vendor';

$file = $vendorDir.'/autoload.php';
if (file_exists($file)) {
$autoload = require_once $file;
} else {
die("Install dependencies before using this command.\n");
if (!class_exists('\Symfony\Component\Console\Application')) {
if (is_file(__DIR__.'/../vendor/autoload.php')) {
require __DIR__.'/../vendor/autoload.php';
} elseif (is_file(__DIR__.'/../../../autoload.php')) {
require __DIR__.'/../../../autoload.php';
} else {
echo 'Cannot find the vendor directory, have you executed composer install?'.PHP_EOL;
echo 'See https://getcomposer.org to get Composer.'.PHP_EOL;
exit(1);
}
}

$configFile = getcwd() . DIRECTORY_SEPARATOR . 'cli-config.php';
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"PHPCR\\Util": "src"
}
},
"bin": ["bin/phpcr"],
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
Expand Down