-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- refactor autoload internals for better testability - make autoload caching opt-in via ddd:cache, otherwise the initial cache will never be busted - clean up tests
- Loading branch information
Showing
40 changed files
with
513 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Lunarstorm\LaravelDDD\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Lunarstorm\LaravelDDD\Support\DomainCache; | ||
|
||
class CacheClearCommand extends Command | ||
{ | ||
protected $name = 'ddd:clear'; | ||
|
||
protected $description = 'Clear cached domain autoloaded objects.'; | ||
|
||
public function handle() | ||
{ | ||
DomainCache::clear(); | ||
|
||
$this->info('Domain cache cleared.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Lunarstorm\LaravelDDD\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
use Lunarstorm\LaravelDDD\Support\DomainAutoloader; | ||
|
||
class CacheCommand extends Command | ||
{ | ||
protected $name = 'ddd:cache'; | ||
|
||
protected $description = 'Cache auto-discovered domain objects used for autoloading.'; | ||
|
||
public function handle() | ||
{ | ||
DomainAutoloader::cacheProviders(); | ||
|
||
$this->info('Cached domain providers.'); | ||
|
||
DomainAutoloader::cacheCommands(); | ||
|
||
$this->info('Cached domain commands.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.