Skip to content

Commit

Permalink
Basic project layout
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Apr 1, 2018
0 parents commit 1a0fe75
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.idea
/vendor
*.phar
35 changes: 35 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "phpgt/cli",
"description": "Command line interface for common tasks.",
"keywords": [
"phpgt",
"webengine",
"cli",
"server",
"build",
"taskrunner"
],

"license": "MIT",

"authors": [
{
"name": "Greg Bowler",
"email": "greg.bowler@g105b.com"
}
],

"autoload": {
"psr-4": {
"Gt\\Cli\\": "./src"
}
},

"require": {

},

"bin": [
"gt"
]
}
26 changes: 26 additions & 0 deletions gt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env php
<?php

use Gt\Cli\App;

$autoloadLocations = [];
$autoloadLocations []= implode(DIRECTORY_SEPARATOR, [
__DIR__,
"..",
"..",
"autoload.php",
]);
$autoloadLocations []= implode(DIRECTORY_SEPARATOR, [
__DIR__,
"vendor",
"autoload.php",
]);

foreach($autoloadLocations as $location) {
if(is_file($location)) {
require($location);
}
}

$app = new App();
$app->run();
8 changes: 8 additions & 0 deletions src/App.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
namespace Gt\Cli;

class App {
public function run() {
echo "Running from CLI!" . PHP_EOL;
}
}

0 comments on commit 1a0fe75

Please sign in to comment.