-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #540 from hydephp/develop
v0.36.x - Add package auto-discovery
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Hyde\Framework; | ||
|
||
use Illuminate\Filesystem\Filesystem; | ||
use Illuminate\Foundation\PackageManifest; | ||
|
||
class Application extends \LaravelZero\Framework\Application | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function registerBaseBindings(): void | ||
{ | ||
parent::registerBaseBindings(); | ||
|
||
/* | ||
* Enable auto-discovery. | ||
*/ | ||
$this->app->singleton(PackageManifest::class, function () { | ||
return new PackageManifest( | ||
new Filesystem, $this->basePath(), $this->basePath('storage/framework/cache/packages.php') | ||
); | ||
}); | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
namespace Hyde\Framework\Commands; | ||
|
||
use Hyde\Framework\Hyde; | ||
use Illuminate\Foundation\Console\PackageDiscoverCommand as BaseCommand; | ||
use Illuminate\Foundation\PackageManifest; | ||
|
||
class HydePackageDiscoverCommand extends BaseCommand | ||
{ | ||
protected $hidden = true; | ||
|
||
public function handle(PackageManifest $manifest) | ||
{ | ||
$manifest->manifestPath = Hyde::path('storage/framework/cache/packages.php'); | ||
parent::handle($manifest); | ||
} | ||
} |
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