-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework code structure, improve code quality (#19)
- Loading branch information
Showing
121 changed files
with
4,023 additions
and
4,615 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
.php-cs-fixer.cache | ||
.phpintel | ||
.phpunit.result.cache | ||
bower_components | ||
build | ||
combustor.bak | ||
combustor.yml | ||
composer.lock | ||
docs | ||
node_modules | ||
tests/Fixture/Sample/controllers | ||
tests/Fixture/Sample/models | ||
tests/Fixture/Sample/views | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
// Load and run the Combustor application | ||
require 'combustor.php'; | ||
use Rougin\Combustor\Console; | ||
|
||
// Return the root directory of the project ------------ | ||
$vendor = (string) __DIR__ . '/../../../../'; | ||
|
||
$exists = file_exists($vendor . '/vendor/autoload.php'); | ||
|
||
$root = $exists ? $vendor : __DIR__ . '/../'; | ||
// ----------------------------------------------------- | ||
|
||
// Load the Composer autoloader ------- | ||
require $root . '/vendor/autoload.php'; | ||
// ------------------------------------ | ||
|
||
$app = new Console($root); | ||
|
||
// Run the console application --- | ||
$app->run(); | ||
// ------------------------------- |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?php | ||
|
||
namespace Rougin\Combustor; | ||
|
||
use Rougin\Describe\Driver\DriverInterface; | ||
use Rougin\SparkPlug\Controller; | ||
|
||
/** | ||
* @package Combustor | ||
* | ||
* @author Rougin Gutib <rougingutib@gmail.com> | ||
*/ | ||
class Combustor | ||
{ | ||
/** | ||
* @var \Rougin\SparkPlug\Controller|null | ||
*/ | ||
protected $app = null; | ||
|
||
/** | ||
* @var \Rougin\Describe\Driver\DriverInterface|null | ||
*/ | ||
protected $driver = null; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $root; | ||
|
||
/** | ||
* @param string $root | ||
*/ | ||
public function __construct($root) | ||
{ | ||
$this->root = $root; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getAppPath() | ||
{ | ||
$app = $this->root . '/application'; | ||
|
||
$root = $this->getRootPath(); | ||
|
||
return is_dir($app) ? $app : $root; | ||
} | ||
|
||
/** | ||
* @return \Rougin\Describe\Driver\DriverInterface|null | ||
*/ | ||
public function getDriver() | ||
{ | ||
return $this->driver; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getRootPath() | ||
{ | ||
return $this->root; | ||
} | ||
|
||
/** | ||
* @param \Rougin\SparkPlug\Controller $app | ||
* | ||
* @return self | ||
*/ | ||
public function setApp(Controller $app) | ||
{ | ||
$this->app = $app; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @param \Rougin\Describe\Driver\DriverInterface $driver | ||
* | ||
* @return self | ||
*/ | ||
public function setDriver(DriverInterface $driver) | ||
{ | ||
$this->driver = $driver; | ||
|
||
return $this; | ||
} | ||
} |
Oops, something went wrong.