Skip to content

Commit 8f1c140

Browse files
authored
Merge pull request #597 from wayofdev/feat/annotated-v4
2 parents ee8e383 + 4be5ace commit 8f1c140

File tree

10 files changed

+201
-119
lines changed

10 files changed

+201
-119
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"require": {
1818
"php": "^8.2",
1919
"ext-pdo": "*",
20-
"cycle/annotated": "^3.5",
20+
"cycle/annotated": "^4.1",
2121
"cycle/database": "^2.8",
2222
"cycle/entity-behavior": "^1.3",
2323
"cycle/migrations": "^4.2",

composer.lock

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

config/cycle.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,24 @@
5050
* Should class locator cache the results?
5151
*/
5252
'cache' => [
53-
'directory' => null,
54-
'enabled' => false,
53+
'enabled' => env('CYCLE_TOKENIZER_CACHE_TARGETS', true),
54+
'directory' => storage_path('framework/cache/cycle/tokenizer'),
55+
],
56+
57+
/*
58+
* What kind of classes should be loaded?
59+
*/
60+
'load' => [
61+
'classes' => env('CYCLE_TOKENIZER_LOAD_CLASSES', true),
62+
'enums' => env('CYCLE_TOKENIZER_LOAD_ENUMS', false),
63+
'interfaces' => env('CYCLE_TOKENIZER_LOAD_INTERFACES', false),
64+
],
65+
],
66+
67+
'attributes' => [
68+
'cache' => [
69+
'enabled' => env('CYCLE_ATTRIBUTES_CACHE', true),
70+
'store' => env('CYCLE_ATTRIBUTES_CACHE_DRIVER', 'file'),
5571
],
5672
],
5773

@@ -163,7 +179,7 @@
163179
*/
164180
'cache' => [
165181
'enabled' => env('CYCLE_SCHEMA_CACHE', true),
166-
'store' => env('CACHE_DRIVER', 'file'),
182+
'store' => env('CYCLE_SCHEMA_CACHE_DRIVER', 'file'),
167183
],
168184

169185
/*

src/Bridge/Laravel/Providers/CycleServiceProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace WayOfDev\Cycle\Bridge\Laravel\Providers;
66

7+
use Cycle\ORM\ORM as CycleORM;
78
use Cycle\ORM\ORMInterface;
89
use Illuminate\Contracts\Config\Repository as IlluminateConfig;
910
use Illuminate\Support\ServiceProvider;
@@ -34,6 +35,7 @@ public function boot(): void
3435
$warmup = $config->get('cycle.warmup');
3536

3637
if (true === $warmup) {
38+
/** @var CycleORM $orm */
3739
$orm = $this->app->get(ORMInterface::class);
3840
$orm->prepareServices();
3941
}
@@ -51,7 +53,8 @@ public function register(): void
5153

5254
$registrators = [
5355
Registrators\RegisterConfigs::class,
54-
Registrators\RegisterClassesInterface::class,
56+
Registrators\RegisterTokenizer::class,
57+
Registrators\RegisterAttributes::class,
5558
Registrators\RegisterAnnotated::class,
5659
Registrators\RegisterDatabase::class,
5760
Registrators\RegisterSchema::class,

src/Bridge/Laravel/Providers/Registrator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface Registrator
99
public const CFG_KEY = 'cycle';
1010
public const CFG_KEY_DATABASE = 'cycle.database';
1111
public const CFG_KEY_TOKENIZER = 'cycle.tokenizer';
12+
public const CFG_KEY_ATTRIBUTES = 'cycle.attributes';
1213
public const CFG_KEY_MIGRATIONS = 'cycle.migrations';
1314
public const CFG_KEY_SCHEMA = 'cycle.schema';
1415
public const CFG_KEY_WARMUP = 'cycle.warmup';

0 commit comments

Comments
 (0)