Skip to content

Commit 084b76b

Browse files
committed
Merge branch 'release/0.13.1'
2 parents 3caa3bd + a2b070d commit 084b76b

File tree

3 files changed

+14
-74
lines changed

3 files changed

+14
-74
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
},
6363
"extra": {
6464
"branch-alias": {
65-
"dev-master": "0.12.x-dev"
65+
"dev-master": "0.13.x-dev"
6666
}
6767
}
6868
}

composer.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bootstrap/Bootstrap.php

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@
1212
use Doctrine\Common\Cache\ApcCache;
1313
use Doctrine\Common\Cache\FilesystemCache;
1414
use BEAR\Package\Module\Di\DiCompilerProvider;
15-
use Ray\Aop\Matcher;
16-
use Ray\Di\AbstractModule;
17-
use Ray\Di\Injector;
18-
use Ray\Di\CacheableModule;
1915
use Doctrine\Common\Cache\Cache;
20-
use Ray\Di\CacheInjector;
21-
use Ray\Di\ModuleCacheInjector;
2216

23-
class Bootstrap
17+
final class Bootstrap
2418
{
2519
/**
2620
* @param ClassLoader $loader
@@ -37,26 +31,6 @@ public static function registerLoader(ClassLoader $loader, $appName, $appDir)
3731
AnnotationReader::addGlobalIgnoredName('returns');
3832
}
3933

40-
/**
41-
* Return compiled application instance
42-
*
43-
* (experimental)
44-
*
45-
* @param $appName
46-
* @param $context
47-
* @param $tmpDir
48-
*
49-
* @return \BEAR\Sunday\Extension\Application\AppInterface
50-
*/
51-
public static function getCompiledApp($appName, $context, $tmpDir, Cache $cache = null)
52-
{
53-
$diCompiler = (new DiCompilerProvider($appName, $context, $tmpDir, $cache))->get();
54-
$app = $diCompiler->getInstance('BEAR\Sunday\Extension\Application\AppInterface');
55-
/** $app \BEAR\Sunday\Extension\Application\AppInterface */
56-
57-
return $app;
58-
}
59-
6034
/**
6135
* @param string $appName
6236
* @param string $context
@@ -67,44 +41,10 @@ public static function getCompiledApp($appName, $context, $tmpDir, Cache $cache
6741
*/
6842
public static function getApp($appName, $context, $tmpDir, Cache $cache = null)
6943
{
70-
$appModule = $appName . '\Module\AppModule';
71-
$cache = $cache ?: (function_exists('apc_fetch') ? new ApcCache : new FilesystemCache($tmpDir));
72-
$cacheKey = 'module-' . $appName . $context;
73-
$moduleProvider = function () use ($appModule, $context) {return new $appModule($context);};
74-
$injector = ModuleCacheInjector::create($moduleProvider, $cache, $cacheKey, $tmpDir);
75-
$app = $injector->getInstance('BEAR\Sunday\Extension\Application\AppInterface');
76-
44+
$diCompiler = (new DiCompilerProvider($appName, $context, $tmpDir, $cache))->get();
45+
$app = $diCompiler->getInstance('BEAR\Sunday\Extension\Application\AppInterface');
7746
/** $app \BEAR\Sunday\Extension\Application\AppInterface */
78-
return $app;
79-
}
8047

81-
/**
82-
* Return cached application instance
83-
*
84-
* (experimental)
85-
*
86-
* @param string $appName
87-
* @param string $context
88-
* @param string $tmpDir
89-
* @param Cache $cache
90-
*
91-
* @return \BEAR\Sunday\Extension\Application\AppInterface
92-
*/
93-
public static function getCachedApp($appName, $context, $tmpDir, Cache $cache = null)
94-
{
95-
$appModule = $appName . '\Module\AppModule';
96-
$cache = $cache ?: function_exists('apc_fetch') ? new ApcCache : new FilesystemCache($tmpDir);
97-
$cacheKey = $appName . $context;
98-
$initialization = function () {
99-
// initialize per system startup (not per each request)
100-
};
101-
$injector = function () use ($appModule, $cache) {
102-
return Injector::create([new $appModule], $cache, __DIR__ . '/tmp');
103-
};
104-
$injector = new CacheInjector($injector, $initialization, $cacheKey, $cache);
105-
$app = $injector->getInstance('BEAR\Sunday\Extension\Application\AppInterface');
106-
107-
/** $app \BEAR\Sunday\Extension\Application\AppInterface */
10848
return $app;
10949
}
11050

0 commit comments

Comments
 (0)