Skip to content

Commit

Permalink
Merge pull request #597 from wayofdev/feat/annotated-v4
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp authored Mar 4, 2024
2 parents ee8e383 + 4be5ace commit 8f1c140
Show file tree
Hide file tree
Showing 10 changed files with 201 additions and 119 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"require": {
"php": "^8.2",
"ext-pdo": "*",
"cycle/annotated": "^3.5",
"cycle/annotated": "^4.1",
"cycle/database": "^2.8",
"cycle/entity-behavior": "^1.3",
"cycle/migrations": "^4.2",
Expand Down
157 changes: 51 additions & 106 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions config/cycle.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,24 @@
* Should class locator cache the results?
*/
'cache' => [
'directory' => null,
'enabled' => false,
'enabled' => env('CYCLE_TOKENIZER_CACHE_TARGETS', true),
'directory' => storage_path('framework/cache/cycle/tokenizer'),
],

/*
* What kind of classes should be loaded?
*/
'load' => [
'classes' => env('CYCLE_TOKENIZER_LOAD_CLASSES', true),
'enums' => env('CYCLE_TOKENIZER_LOAD_ENUMS', false),
'interfaces' => env('CYCLE_TOKENIZER_LOAD_INTERFACES', false),
],
],

'attributes' => [
'cache' => [
'enabled' => env('CYCLE_ATTRIBUTES_CACHE', true),
'store' => env('CYCLE_ATTRIBUTES_CACHE_DRIVER', 'file'),
],
],

Expand Down Expand Up @@ -163,7 +179,7 @@
*/
'cache' => [
'enabled' => env('CYCLE_SCHEMA_CACHE', true),
'store' => env('CACHE_DRIVER', 'file'),
'store' => env('CYCLE_SCHEMA_CACHE_DRIVER', 'file'),
],

/*
Expand Down
5 changes: 4 additions & 1 deletion src/Bridge/Laravel/Providers/CycleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace WayOfDev\Cycle\Bridge\Laravel\Providers;

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

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

$registrators = [
Registrators\RegisterConfigs::class,
Registrators\RegisterClassesInterface::class,
Registrators\RegisterTokenizer::class,
Registrators\RegisterAttributes::class,
Registrators\RegisterAnnotated::class,
Registrators\RegisterDatabase::class,
Registrators\RegisterSchema::class,
Expand Down
1 change: 1 addition & 0 deletions src/Bridge/Laravel/Providers/Registrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface Registrator
public const CFG_KEY = 'cycle';
public const CFG_KEY_DATABASE = 'cycle.database';
public const CFG_KEY_TOKENIZER = 'cycle.tokenizer';
public const CFG_KEY_ATTRIBUTES = 'cycle.attributes';
public const CFG_KEY_MIGRATIONS = 'cycle.migrations';
public const CFG_KEY_SCHEMA = 'cycle.schema';
public const CFG_KEY_WARMUP = 'cycle.warmup';
Expand Down
Loading

0 comments on commit 8f1c140

Please sign in to comment.