Skip to content

Commit c01f4c4

Browse files
committed
Scaffolding for cli app
including *nix and windows runners for peg and the actual peg.php
1 parent 5460e6a commit c01f4c4

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

composer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "peg-org/peg-cli",
3+
"description": "CLI PHP Extension Generator",
4+
"license": "MIT",
5+
"authors": [
6+
{
7+
"name": "Elizabeth M Smith",
8+
"email": "auroraeosrose@gmail.com"
9+
},
10+
{
11+
"name": "Jefferson González", }
12+
],
13+
"require": {
14+
"php" : ">=5.4.0",
15+
"symfony/console": "2.*"
16+
"peg-org/peg-cli": "dev-master"
17+
},
18+
}
19+
"require-dev": {
20+
"phpunit/phpunit": "4.0.*"
21+
},
22+
"autoload": {
23+
"psr-4": {
24+
"Peg\\Cli\\": "src"
25+
}
26+
}
27+
}

peg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env php
2+
<?php
3+
include __DIR__ . '/peg.php';

peg.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@ECHO OFF
2+
php "%~dp0peg.php" %*

peg.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
$autoload = __DIR__ . '/vendor/autoload.php';
4+
if(!file_exists($autoload)) {
5+
die('Please install composer from https://getcomposer.org and run composer install');
6+
}
7+
8+
require $autoload;
9+
10+
use Symfony\Component\Console\Application;
11+
12+
$console = new Application();
13+
14+
$console->run();

0 commit comments

Comments
 (0)