Skip to content

Commit ce9e2cb

Browse files
committed
Add bin
1 parent 6aa200a commit ce9e2cb

File tree

5 files changed

+35
-21
lines changed

5 files changed

+35
-21
lines changed

PHPJava

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/php
2+
<?php
3+
4+
foreach ([__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php'] as $file) {
5+
if (is_file($file)) {
6+
require $file;
7+
break;
8+
}
9+
}
10+
11+
\PHPJava\Console\Command::main();

bin/PHPJava

Lines changed: 0 additions & 19 deletions
This file was deleted.

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"bin": [
13-
"bin/PHPJava"
13+
"PHPJava"
1414
],
1515
"require": {
1616
"php": ">=7.2",
@@ -27,7 +27,7 @@
2727
"autoload": {
2828
"psr-4": {
2929
"PHPJava\\": "src/",
30-
"PHPJava\\Console\\": "bin/"
30+
"PHPJava\\Console\\": "console/"
3131
}
3232
},
3333
"autoload-dev": {

console/Command.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
namespace PHPJava\Console;
3+
4+
use PHPJava\Console\Commands\JVM\RunCommand;
5+
use PHPJava\Core\JavaArchive;
6+
use PHPJava\Core\PHPJava;
7+
use Symfony\Component\Console\Application;
8+
9+
class Command
10+
{
11+
public static function main()
12+
{
13+
$application = new Application();
14+
$runCommand = new RunCommand();
15+
$application->add($runCommand);
16+
$application->setDefaultCommand(
17+
$runCommand->getName(),
18+
true
19+
);
20+
$application->run();
21+
}
22+
}

0 commit comments

Comments
 (0)