├── src
├── Template
│ ├── combustor.yml
│ ├── EditPlate.php
│ ├── CreatePlate.php
│ ├── Fields
│ │ ├── DefaultField.php
│ │ ├── EmailField.php
│ │ ├── BooleanField.php
│ │ └── ForeignField.php
│ ├── FooterPlate.php
│ ├── HeaderPlate.php
│ ├── IndexPlate.php
│ ├── Repository.php
│ ├── TablePlate.php
│ ├── Wildfire
│ │ └── Model.php
│ ├── FormPlate.php
│ ├── Doctrine
│ │ └── Model.php
│ └── Controller.php
├── Commands
│ ├── CreateYaml.php
│ ├── RemoveWildfire.php
│ ├── InstallWildfire.php
│ ├── RemoveDoctrine.php
│ ├── CreateRepo.php
│ ├── InstallDoctrine.php
│ ├── CreateLayout.php
│ ├── CreateModel.php
│ ├── CreateRoute.php
│ ├── CreateScaffold.php
│ └── CreateView.php
├── Packages
│ ├── SparkplugPackage.php
│ ├── DescribePackage.php
│ └── CombustorPackage.php
├── Colfield.php
├── Combustor.php
├── Console.php
├── Command.php
└── Inflector.php
├── .editorconfig
├── bin
└── combustor
├── phpstan.neon
├── LICENSE.md
├── .github
└── workflows
│ └── build.yml
├── composer.json
├── phpstyle.php
├── CHANGELOG.md
└── README.md
/src/Template/combustor.yml:
--------------------------------------------------------------------------------
1 | app_path: %%CURRENT_DIRECTORY%%
2 |
3 | custom_fields:
4 | - Rougin\Combustor\Template\Fields\BooleanField
5 | - Rougin\Combustor\Template\Fields\EmailField
6 |
7 | excluded_fields:
8 | - created_at
9 | - updated_at
10 | - deleted_at
--------------------------------------------------------------------------------
/src/Template/EditPlate.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class EditPlate extends FormPlate
11 | {
12 | /**
13 | * @var boolean
14 | */
15 | protected $edit = true;
16 | }
17 |
--------------------------------------------------------------------------------
/src/Template/CreatePlate.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class CreatePlate extends FormPlate
11 | {
12 | /**
13 | * @var boolean
14 | */
15 | protected $edit = false;
16 | }
17 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | ; This file is for unifying the coding style for different editors and IDEs.
2 | ; More information at http://editorconfig.org
3 |
4 | root = true
5 |
6 | [*]
7 | charset = utf-8
8 | indent_size = 4
9 | indent_style = space
10 | end_of_line = lf
11 | insert_final_newline = true
12 | trim_trailing_whitespace = true
13 |
14 | [*.md]
15 | trim_trailing_whitespace = false
--------------------------------------------------------------------------------
/bin/combustor:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | run();
22 | // -------------------------------
23 |
--------------------------------------------------------------------------------
/phpstan.neon:
--------------------------------------------------------------------------------
1 | parameters:
2 | level: 9
3 | paths:
4 | - src
5 | - tests
6 | excludePaths:
7 | analyse:
8 | - tests/Fixture/Plates
9 | - tests/Fixture/Sample/controllers
10 | - tests/Fixture/Sample/models
11 | - tests/Fixture/Sample/repositories
12 | - tests/Fixture/Sample/views
13 | scanDirectories:
14 | - vendor/rougin/codeigniter/src
15 | ignoreErrors:
16 | - '#^Access to property \$database on an unknown class CI_DB\.$#'
17 | - '#^Access to property \$dbdriver on an unknown class CI_DB\.$#'
18 | - '#^Access to property \$dsn on an unknown class CI_DB\.$#'
19 | - '#^Access to property \$hostname on an unknown class CI_DB\.$#'
20 | - '#^Access to property \$password on an unknown class CI_DB\.$#'
21 | - '#^Access to property \$username on an unknown class CI_DB\.$#'
22 | - '#^Constant APPPATH not found\.$#'
23 | - '#^Constant ENVIRONMENT not found\.$#'
--------------------------------------------------------------------------------
/src/Template/Fields/DefaultField.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class DefaultField extends Colfield
13 | {
14 | /**
15 | * @var string
16 | */
17 | protected $class = 'form-control';
18 |
19 | /**
20 | * @return string[]
21 | */
22 | public function getPlate()
23 | {
24 | $field = $this->accessor;
25 |
26 | $class = $this->getClass();
27 |
28 | $name = $this->getName();
29 |
30 | $html = '= form_input(\'' . $name . '\', set_value(\'' . $name . '\'), \'class="' . $class . '"\') ?>';
31 |
32 | if ($this->edit)
33 | {
34 | $html = '= form_input(\'' . $name . '\', set_value(\'' . $name . '\', ' . $field . '), \'class="' . $class . '"\') ?>';
35 | }
36 |
37 | return array($html);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Commands/CreateYaml.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class CreateYaml extends InitializeCommand
13 | {
14 | /**
15 | * @var string
16 | */
17 | protected $file = 'combustor.yml';
18 |
19 | /**
20 | * Returns the source directory for the specified file.
21 | *
22 | * @return string
23 | */
24 | protected function getPlatePath()
25 | {
26 | /** @var string */
27 | return realpath(__DIR__ . '/../Template');
28 | }
29 |
30 | /**
31 | * Returns the root directory from the package.
32 | *
33 | * @return string
34 | */
35 | protected function getRootPath()
36 | {
37 | $root = (string) __DIR__ . '/../../../../../';
38 |
39 | $exists = file_exists($root . '/vendor/autoload.php');
40 |
41 | return $exists ? $root : __DIR__ . '/../../';
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Commands/RemoveWildfire.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class RemoveWildfire extends Command
13 | {
14 | /**
15 | * @var string
16 | */
17 | protected $name = 'remove:wildfire';
18 |
19 | /**
20 | * @var string
21 | */
22 | protected $description = 'Remove the Wildfire package';
23 |
24 | /**
25 | * Checks whether the command is enabled or not in the current environment.
26 | *
27 | * @return boolean
28 | */
29 | public function isEnabled()
30 | {
31 | return class_exists('Rougin\Wildfire\Wildfire');
32 | }
33 |
34 | /**
35 | * Executes the command.
36 | *
37 | * @return integer
38 | */
39 | public function run()
40 | {
41 | system('composer remove rougin/wildfire');
42 |
43 | $this->showPass('Wildfire removed successfully!');
44 |
45 | return self::RETURN_SUCCESS;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/Commands/InstallWildfire.php:
--------------------------------------------------------------------------------
1 |
11 | */
12 | class InstallWildfire extends Command
13 | {
14 | /**
15 | * @var string
16 | */
17 | protected $name = 'install:wildfire';
18 |
19 | /**
20 | * @var string
21 | */
22 | protected $description = 'Install the Wildfire package';
23 |
24 | /**
25 | * Checks whether the command is enabled or not in the current environment.
26 | *
27 | * @return boolean
28 | */
29 | public function isEnabled()
30 | {
31 | return ! class_exists('Rougin\Wildfire\Wildfire');
32 | }
33 |
34 | /**
35 | * Executes the command.
36 | *
37 | * @return integer
38 | */
39 | public function run()
40 | {
41 | system('composer require rougin/wildfire');
42 |
43 | $this->showPass('Wildfire installed successfully!');
44 |
45 | return self::RETURN_SUCCESS;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/Template/FooterPlate.php:
--------------------------------------------------------------------------------
1 |
9 | */
10 | class FooterPlate
11 | {
12 | /**
13 | * @var boolean
14 | */
15 | protected $bootstrap;
16 |
17 | /**
18 | * @param boolean $bootstrap
19 | */
20 | public function __construct($bootstrap)
21 | {
22 | $this->bootstrap = $bootstrap;
23 | }
24 |
25 | /**
26 | * @param string $tab
27 | *
28 | * @return string
29 | */
30 | public function make($tab = ' ')
31 | {
32 | $lines = array();
33 |
34 | if ($this->bootstrap)
35 | {
36 | $lines[] = $tab . '';
37 | $lines[] = $tab . '';
38 | }
39 |
40 | $lines[] = '