Skip to content

Commit 97cd2e7

Browse files
committed
dropping cache logic
1 parent 1507c8e commit 97cd2e7

File tree

3 files changed

+12
-34
lines changed

3 files changed

+12
-34
lines changed

src/FractionManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,6 @@ public function all(): array
7575
*/
7676
public function boot(): void
7777
{
78-
Bootable::fire($this->application);
78+
Bootable::fire();
7979
}
8080
}

src/Support/Bootable.php

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,41 @@
44

55
namespace Fraction\Support;
66

7-
use Illuminate\Foundation\Application;
8-
97
/**
108
* @internal
119
*
1210
* @codeCoverageIgnore
1311
*/
1412
final readonly class Bootable
1513
{
16-
public function __construct(private Application $application)
14+
public function __construct()
1715
{
1816
//
1917
}
2018

2119
/**
2220
* Boot the fraction.
2321
*/
24-
public static function fire(Application $application): void
22+
public static function fire(): void
2523
{
26-
$class = new self($application);
24+
$class = new self();
2725

2826
$files = $class->files();
2927

30-
$class->require($files);
31-
}
32-
33-
/**
34-
* Get the files to be booted.
35-
*/
36-
private function files(): mixed
37-
{
38-
if ($this->application->isProduction() && file_exists($path = base_path('bootstrap/cache/actions.php'))) {
39-
return require $path;
28+
if ($files === [] || $files === false) {
29+
return;
4030
}
4131

42-
return glob(config('fraction.path').'/*.php');
32+
foreach ($files as $file) {
33+
require $file;
34+
}
4335
}
4436

4537
/**
46-
* Require the files and cache them.
38+
* Get the files to be booted.
4739
*/
48-
private function require(array $files): void
40+
private function files(): array|false
4941
{
50-
$cached = [];
51-
52-
foreach ($files as $file) {
53-
$cached[] = $file;
54-
55-
require $file;
56-
}
57-
58-
if ($this->application->isProduction() && $cached !== []) {
59-
file_put_contents(
60-
base_path('bootstrap/cache/actions.php'),
61-
'<?php return '.var_export($cached, true).';'
62-
);
63-
}
42+
return glob(config('fraction.path').'/*.php');
6443
}
6544
}

tests/Architecture/ArchitectureTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@
154154
arch()
155155
->expect(Bootable::class)
156156
->toBeFinal()
157-
->toHaveConstructor()
158157
->toOnlyBeUsedIn(FractionManager::class)
159158
->toHaveMethods([
160159
'files',

0 commit comments

Comments
 (0)