Skip to content

Commit 32b3d32

Browse files
committed
introduce Formal BEAR as the base framework
1 parent fa445e1 commit 32b3d32

15 files changed

+51
-100
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/app/config/parameters.yml
12
/composer.lock
23
/var/log/*
34
!/var/log/.placefolder

Diff for: app/config/config.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
imports:
2+
- parameters.yml
3+
4+
framework:
5+
named_constants:
6+
signal_parameters:

Diff for: app/config/config_api.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
imports:
2+
- config.yml

Diff for: app/config/config_dev.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
imports:
2+
- config.yml

Diff for: app/config/config_prod.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
imports:
2+
- config.yml

Diff for: app/config/config_test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
imports:
2+
- config_dev.yml

Diff for: app/config/parameters.yml.dist

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
parameters:

Diff for: composer.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
"prefer-stable": true,
1515
"require": {
1616
"php": ">=5.4.0",
17-
"bear/package": "dev-develop",
18-
"bear/resource": "*",
19-
"bear/sunday": "*",
20-
"ray/di": "*"
17+
"phpmentors/formal-bear": "~1.0"
2118
},
2219
"require-dev": {
2320
"bear/dev-package": "~0.2",

Diff for: src/Module/App/Aspect.php

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace PHPMentors\DomainCoder\Module\App;
44

5-
use BEAR\Package;
65
use Ray\Di\AbstractModule;
76

87
class Aspect extends AbstractModule

Diff for: src/Module/App/Dependency.php

-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
namespace PHPMentors\DomainCoder\Module\App;
44

5-
use BEAR\Package;
65
use Ray\Di\AbstractModule;
7-
use Ray\Di\Injector;
86

97
class Dependency extends AbstractModule
108
{

Diff for: src/Module/AppModule.php

+34-15
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,34 @@
11
<?php
2+
/*
3+
* Copyright (c) 2014 KUBO Atsuhiro <[email protected]>,
4+
* All rights reserved.
5+
*
6+
* This file is part of Domain Coder.
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
221

322
namespace PHPMentors\DomainCoder\Module;
423

5-
use BEAR\Package\Module\Package\StandardPackageModule;
6-
use Ray\Di\AbstractModule;
24+
use BEAR\Package\Provide\TemplateEngine\Twig\TwigModule;
25+
use PHPMentors\FormalBEAR\Config\ConfigReader;
26+
use PHPMentors\FormalBEAR\Module\EntryModule;
27+
use PHPMentors\FormalBEAR\Module\FrameworkModule;
728
use Ray\Di\Di\Inject;
829
use Ray\Di\Di\Named;
930

10-
class AppModule extends AbstractModule
31+
class AppModule extends EntryModule
1132
{
1233
/**
1334
* @var string
@@ -27,21 +48,19 @@ public function __construct($context = 'prod')
2748
}
2849

2950
/**
30-
* {@inheritdoc}
51+
* {@inheritDoc}
3152
*/
3253
protected function configure()
3354
{
34-
$this->install(new StandardPackageModule('PHPMentors\DomainCoder', $this->context, dirname(dirname(__DIR__))));
35-
36-
// override module
37-
// $this->install(new SmartyModule($this));
38-
39-
// $this->install(new AuraViewModule($this));
40-
41-
// install application dependency
42-
// $this->install(new App\Dependency);
55+
$this->install(new FrameworkModule($this, 'PHPMentors\DomainCoder', $this->context, dirname(dirname(__DIR__))));
56+
$this->install(new TwigModule($this));
57+
}
4358

44-
// install application aspect
45-
// $this->install(new App\Aspect($this));
59+
/**
60+
* {@inheritDoc}
61+
*/
62+
protected function readConfig(ConfigReader $configReader)
63+
{
64+
return $configReader->read(dirname(dirname(__DIR__)) . '/app/config/config_' . $this->context. '.yml');
4665
}
4766
}

Diff for: var/conf/constants.php

-31
This file was deleted.

Diff for: var/conf/db/mysql.php

-21
This file was deleted.

Diff for: var/conf/db/sqlite.php

-10
This file was deleted.

Diff for: var/conf/params.php

-16
This file was deleted.

0 commit comments

Comments
 (0)