Skip to content

Commit

Permalink
new, fresh project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaminded committed Mar 26, 2023
1 parent ef537c0 commit ca27571
Show file tree
Hide file tree
Showing 9 changed files with 906 additions and 3,252 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

# IDE files
/.idea

/.env
8 changes: 2 additions & 6 deletions Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@

use Jadob\Core\AbstractBootstrap;

/**
* Class Bootstrap
* @author pizzaminded <[email protected]>
* @license MIT
*/

class Bootstrap extends AbstractBootstrap
{

public function getServiceProviders(string $env): array
{
return [
\Jadob\SymfonyConsoleBridge\ServiceProvider\ConsoleProvider::class,
\Jadob\Bridge\Symfony\Console\ServiceProvider\ConsoleProvider::class,
\Jadob\Router\ServiceProvider\RouterServiceProvider::class,
\Jadob\Bridge\Twig\ServiceProvider\TwigProvider::class
];
Expand Down
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
# jadob/skeleton

This is a generic project structure for jadob/jadob `0.4.x` version. Feel free to modify it as you want!
This is a minimal project structure for jadob/jadob `0.4.x` version, which includes:
- Support for CLI commands
- Twig Template engine

## Getting started

Install dependencies:

``composer install``

Create `.env` file in your project with given content:

```dotenv
APP_ENV=dev
```






5 changes: 2 additions & 3 deletions bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@

use Jadob\Core\Kernel;

require_once __DIR__.'/../vendor/autoload.php';
require_once __DIR__.'/../Bootstrap.php';
require_once __DIR__.'/../boot.php';

$bootstrap = new Bootstrap();

$kernel = new \Jadob\Core\Kernel('dev', new Bootstrap());
$kernel = new Kernel('dev', new Bootstrap());
$builder = $kernel->getContainerBuilder();
$kernel->setContainer($builder->build($kernel->getConfig()->toArray()));
$kernel->getContainer()->get('console')->run();
25 changes: 25 additions & 0 deletions boot.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
/**
* Includes all required files and performs basic env checks before continuing with execution.
*/
use Jadob\Core\Kernel;
use Symfony\Component\Dotenv\Dotenv;

require_once __DIR__.'/vendor/autoload.php';
require_once __DIR__.'/Bootstrap.php';

(new Dotenv())->load(__DIR__.'/.env');

/**
* If your app relies on some environment variables, pass it here.
*/
Kernel::checkEnvsPresence([
'APP_ENV'
]);

/**
* If your app relies on specific PHP extensions, pass the names here.
*/
Kernel::checkExtensionsPresence([

]);
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
},
"require": {
"php": "^8",
"jadob/jadob": "^0.4.14"
"jadob/bridge-symfony-console": "^0.4.15",
"jadob/bridge-twig": "^0.4.15",
"jadob/router": "^0.4.15",
"jadob/core": "^0.4.15",
"symfony/dotenv": "^6.2"
}
}
Loading

0 comments on commit ca27571

Please sign in to comment.