Skip to content

Commit f553d1f

Browse files
committed
Remove the policy and listener discovery for the product mode.
1 parent 07ecb09 commit f553d1f

3 files changed

Lines changed: 0 additions & 43 deletions

File tree

‎src/Discovery/ListenerDiscovery.php‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,7 @@ class ListenerDiscovery implements Discoverable, Cacheable
4444
*/
4545
public function discover()
4646
{
47-
// For the production mode we will cache the listeners to improve the performance.
48-
// So don't need to discover the listeners from the filesystem.
49-
// In the production mode we have to run the discovery once so that it does not miss any listeners.
5047
if (!app()->is_dev_mode()) {
51-
return $this->discover_once();
52-
}
53-
54-
return $this->create_cache_file();
55-
}
56-
57-
/**
58-
* Discover the listeners from the cache.
59-
*
60-
* @return self
61-
*
62-
* @since 1.0.0
63-
*/
64-
protected function discover_once()
65-
{
66-
$listeners_cache_path = config_path('listeners.cache.php');
67-
68-
if (!file_exists($listeners_cache_path)) {
6948
return $this;
7049
}
7150

‎src/Discovery/PolicyDiscovery.php‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,6 @@ public function discover()
4444
// For the production mode we will cache the policies to improve the performance.
4545
// So don't need to discover the policies from the filesystem.
4646
if (!app()->is_dev_mode()) {
47-
return $this->discover_once();
48-
}
49-
50-
return $this->create_cache_file();
51-
}
52-
53-
/**
54-
* Discover the policies from the cache.
55-
*
56-
* @return self
57-
*
58-
* @since 1.0.0
59-
*/
60-
protected function discover_once()
61-
{
62-
$policies_cache_path = config_path('policies.cache.php');
63-
64-
if (!file_exists($policies_cache_path)) {
6547
return $this;
6648
}
6749

‎src/Managers/PolicyManager.php‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@
1313
defined('ABSPATH') || exit;
1414

1515
use Framework\Concerns\DependencyResolvable;
16-
use Framework\Database\Query\Model;
1716
use Framework\Exceptions\AuthorizationException;
18-
use Framework\Supports\Arr;
1917
use InvalidArgumentException;
20-
use ReflectionMethod;
21-
use ReflectionNamedType;
2218

2319
use function Framework\app;
2420
use function Framework\config_path;

0 commit comments

Comments
 (0)