Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,27 @@
"php": ">=8.4.23",
"d11wtq/boris": "~1.0",
"filp/whoops": "~2.11",
"illuminate/bus": "^13",
"illuminate/cache": "^13",
"illuminate/collections": "^13",
"illuminate/conditionable": "^13",
"illuminate/container": "^13",
"illuminate/contracts": "^13",
"illuminate/cookie": "^13",
"illuminate/database": "^13",
"illuminate/encryption": "^13",
"illuminate/events": "^13",
"illuminate/filesystem": "^13",
"illuminate/http": "^13",
"illuminate/macroable": "^13",
"illuminate/pagination": "^13",
"illuminate/pipeline": "^13",
"illuminate/redis": "^13",
"illuminate/reflection": "^13",
"illuminate/session": "^13",
"illuminate/support": "^13",
"ircmaxell/password-compat": "~1.0",
"laravel/serializable-closure": "^1.2",
"laravel/serializable-closure": "^2.0.10",
"monolog/monolog": "^3.10",
"nesbot/carbon": "^3.8.4",
"opis/closure": "~3.6",
Expand All @@ -44,27 +57,16 @@
},
"replace": {
"illuminate/auth": "self.version",
"illuminate/cache": "self.version",
"illuminate/config": "self.version",
"illuminate/console": "self.version",
"illuminate/cookie": "self.version",
"illuminate/database": "self.version",
"illuminate/encryption": "self.version",
"illuminate/events": "self.version",
"illuminate/exception": "self.version",
"illuminate/filesystem": "self.version",
"illuminate/foundation": "self.version",
"illuminate/hashing": "self.version",
"illuminate/http": "self.version",
"illuminate/html": "self.version",
"illuminate/log": "self.version",
"illuminate/mail": "self.version",
"illuminate/pagination": "self.version",
"illuminate/queue": "self.version",
"illuminate/redis": "self.version",
"illuminate/routing": "self.version",
"illuminate/session": "self.version",
"illuminate/support": "self.version",
"illuminate/translation": "self.version",
"illuminate/validation": "self.version",
"illuminate/view": "self.version",
Expand Down
26 changes: 13 additions & 13 deletions src/Illuminate/Auth/AuthManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ protected function createDriver($driver)
// When using the remember me functionality of the authentication services we
// will need to be set the encryption instance of the guard, which allows
// secure, encrypted cookie values to get generated for those cookies.
$guard->setCookieJar($this->app['cookie']);
$guard->setCookieJar($this->container['cookie']);

$guard->setDispatcher($this->app['events']);
$guard->setDispatcher($this->container['events']);

return $guard->setRequest($this->app->refresh('request', $guard, 'setRequest'));
return $guard->setRequest($this->container->refresh('request', $guard, 'setRequest'));
}

/**
Expand All @@ -38,7 +38,7 @@ protected function callCustomCreator($driver)

if ($custom instanceof Guard) return $custom;

return new Guard($custom, $this->app['session.store']);
return new Guard($custom, $this->container['session.store']);
}

/**
Expand All @@ -50,7 +50,7 @@ public function createDatabaseDriver()
{
$provider = $this->createDatabaseProvider();

return new Guard($provider, $this->app['session.store']);
return new Guard($provider, $this->container['session.store']);
}

/**
Expand All @@ -60,14 +60,14 @@ public function createDatabaseDriver()
*/
protected function createDatabaseProvider()
{
$connection = $this->app['db']->connection();
$connection = $this->container['db']->connection();

// When using the basic database user provider, we need to inject the table we
// want to use, since this is not an Eloquent model we will have no way to
// know without telling the provider, so we'll inject the config value.
$table = $this->app['config']['auth.table'];
$table = $this->container['config']['auth.table'];

return new DatabaseUserProvider($connection, $this->app['hash'], $table);
return new DatabaseUserProvider($connection, $this->container['hash'], $table);
}

/**
Expand All @@ -79,7 +79,7 @@ public function createEloquentDriver()
{
$provider = $this->createEloquentProvider();

return new Guard($provider, $this->app['session.store']);
return new Guard($provider, $this->container['session.store']);
}

/**
Expand All @@ -89,9 +89,9 @@ public function createEloquentDriver()
*/
protected function createEloquentProvider()
{
$model = $this->app['config']['auth.model'];
$model = $this->container['config']['auth.model'];

return new EloquentUserProvider($this->app['hash'], $model);
return new EloquentUserProvider($this->container['hash'], $model);
}

/**
Expand All @@ -101,7 +101,7 @@ protected function createEloquentProvider()
*/
public function getDefaultDriver()
{
return $this->app['config']['auth.driver'];
return $this->container['config']['auth.driver'];
}

/**
Expand All @@ -112,7 +112,7 @@ public function getDefaultDriver()
*/
public function setDefaultDriver($name)
{
$this->app['config']['auth.driver'] = $name;
$this->container['config']['auth.driver'] = $name;
}

}
40 changes: 39 additions & 1 deletion src/Illuminate/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ class Application extends \Symfony\Component\Console\Application {
*/
protected $laravel;

/**
* Callbacks to run when a console application is starting.
*
* ponytail: BC shim for v13 Support\ServiceProvider::commands(), which calls
* Illuminate\Console\Application::starting(). Remove when console swaps to v13 (task 4.2/4.3).
*
* @var callable[]
*/
protected static $startingCallbacks = array();

/**
* Register a callback to run when the console application is starting.
*
* @param callable $callback
* @return void
*/
public static function starting($callback)
{
static::$startingCallbacks[] = $callback;
}

/**
* Create and boot a new Console application.
*
Expand Down Expand Up @@ -51,6 +72,11 @@ public static function make($app)

$app->instance('artisan', $console);

foreach (static::$startingCallbacks as $callback)
{
$callback($console);
}

return $console;
}

Expand Down Expand Up @@ -153,7 +179,19 @@ public function resolveCommands($commands)

foreach ($commands as $command)
{
$this->resolve($command);
try
{
$this->resolve($command);
}
catch (\Throwable $e)
{
// ponytail: some v13 components (session/cache/…) register console commands
// that extend v13 console base classes absent from the not-yet-swapped fork
// console. Skip the ones that can't load so artisan still boots; they return
// with the console swap (task 4.2). Commands that load fine still register.
error_log('[l13] skipped unresolvable console command '
. (is_string($command) ? $command : gettype($command)) . ': ' . $e->getMessage());
}
}
}

Expand Down
13 changes: 13 additions & 0 deletions src/Illuminate/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ public function __construct()
$this->specifyParameters();
}

/**
* ponytail: BC shim — exists so v13 component commands that declare
* `#[\Override] configureDefaults()` (against the v13 console Command) can load under
* the not-yet-swapped fork console. The fork configures via the constructor /
* specifyParameters() instead, so this is a no-op. Remove at the console swap (task 4.2).
*
* @return void
*/
protected function configureDefaults()
{
//
}

/**
* Specify the arguments and options on the command.
*
Expand Down
39 changes: 39 additions & 0 deletions src/Illuminate/Console/MigrationGeneratorCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php namespace Illuminate\Console;

/**
* ponytail: BC shim for v13's Illuminate\Console\MigrationGeneratorCommand. The fork
* console is not swapped yet (task 4.2), but v13 component commands (make:session-table,
* make:cache-table) extend this base — without it their class declaration fatals and
* breaks artisan boot. This lets them load; actual migration generation needs the v13
* console and is out of scope until the console swap. Remove then.
*/
abstract class MigrationGeneratorCommand extends Command {

/**
* Get the migration table name.
*
* @return string
*/
abstract protected function migrationTableName();

/**
* Get the path to the migration stub file.
*
* @return string
*/
abstract protected function migrationStubFile();

/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
if (method_exists($this, 'error')) {
$this->error('make:*-table generators require the v13 console (L13 migration task 4.2).');
}

return 1;
}
}
45 changes: 45 additions & 0 deletions src/Illuminate/Console/Prohibitable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php namespace Illuminate\Console;

/**
* ponytail: BC shim for v13's Illuminate\Console\Prohibitable trait. The fork console
* is not swapped yet (task 4.2), but v13 component commands (migrate:fresh/refresh/reset)
* `use` this trait — without it their class declaration fatals and breaks artisan boot.
* Minimal but functional: gates command execution when prohibited. Remove at the console swap.
*/
trait Prohibitable
{
/**
* @var bool
*/
protected static $prohibitedFromRunning = false;

/**
* Indicate whether the command should be prohibited from running.
*
* @param bool $prohibit
* @return void
*/
public static function prohibit($prohibit = true)
{
static::$prohibitedFromRunning = $prohibit;
}

/**
* Determine if the command is prohibited from running and display a warning if so.
*
* @param bool $prohibit
* @return bool
*/
protected function isProhibited($prohibit = false)
{
if (! static::$prohibitedFromRunning && ! $prohibit) {
return false;
}

if (method_exists($this, 'components')) {
$this->components->error('This command is prohibited from running in this environment.');
}

return true;
}
}
46 changes: 42 additions & 4 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,20 @@ public function bindInstallPaths(array $paths)
}
}

/**
* Get the path to the resources directory.
*
* ponytail: v13 ServiceProviders (e.g. PaginationServiceProvider) call resourcePath();
* the L4.2 fork Application lacks it. Remove once Foundation swaps to v13.
*
* @param string $path
* @return string
*/
public function resourcePath($path = '')
{
return $this['path.base'].DIRECTORY_SEPARATOR.'resources'.($path != '' ? DIRECTORY_SEPARATOR.$path : '');
}

/**
* Get the application bootstrap file.
*
Expand Down Expand Up @@ -441,7 +455,12 @@ public function registerDeferredProvider($provider, $service = null)
{
$this->booting(function() use ($instance)
{
$instance->boot();
// v13 ServiceProvider has no default boot(); call only when defined
// (mirrors the eager boot() loop). Via the container so boot() DI works.
if (method_exists($instance, 'boot'))
{
$this->call([$instance, 'boot']);
}
});
}
}
Expand Down Expand Up @@ -635,7 +654,11 @@ public function boot()
{
if ($this->booted) return;

array_walk($this->serviceProviders, function($p) { $p->boot(); });
array_walk($this->serviceProviders, function($p) {
// v13 ServiceProvider has no default boot(); call only when defined (via
// the container so boot() method-injection keeps working).
if (method_exists($p, 'boot')) $this->call([$p, 'boot']);
});

$this->bootApplication();
}
Expand Down Expand Up @@ -1176,11 +1199,10 @@ public function registerCoreContainerAliases()
'translator' => 'Illuminate\Translation\Translator',
'log' => 'Illuminate\Log\Logger',
'mailer' => 'Illuminate\Mail\Mailer',
'paginator' => 'Illuminate\Pagination\Factory',
'auth.reminder' => 'Illuminate\Auth\Reminders\PasswordBroker',
'queue' => 'Illuminate\Queue\QueueManager',
'redirect' => 'Illuminate\Routing\Redirector',
'redis' => 'Illuminate\Redis\Database',
'redis' => 'Illuminate\Redis\RedisManager',
'request' => 'Illuminate\Http\Request',
'router' => 'Illuminate\Routing\Router',
'session' => 'Illuminate\Session\SessionManager',
Expand All @@ -1205,6 +1227,22 @@ public function registerCoreContainerAliases()
// BC: Hashing\HasherInterface → Contracts\Hashing\Hasher (task 2.11); keep old name resolvable.
// class_alias covers use/typehint/instanceof; make()/autowiring by the old name needs this.
$this->alias('hash', 'Illuminate\Hashing\HasherInterface');

// L13 SCC-1 swap (task 4.1): the swapped components ship v13 contracts. Alias them to
// the core bindings so v13 code that type-hints the contracts resolves (the v13
// providers don't always register these against the fork's core aliases).
$this->alias('events', 'Illuminate\Contracts\Events\Dispatcher');
$this->alias('redis', 'Illuminate\Contracts\Redis\Factory');
$this->alias('cache', 'Illuminate\Contracts\Cache\Factory');
$this->alias('cache.store', 'Illuminate\Contracts\Cache\Repository');
$this->alias('config', 'Illuminate\Contracts\Config\Repository');
$this->alias('db', 'Illuminate\Database\ConnectionResolverInterface');

// ponytail: v13's Support\Facades\Artisan resolves Illuminate\Contracts\Console\Kernel.
// The fork has no console Kernel (task 4.2); 'artisan' is a lazy singleton
// (ArtisanServiceProvider), so alias the contract to it globally — works for the
// Artisan facade in web/console/tests (make()-only aliasing missed Artisan::call()).
$this->alias('artisan', 'Illuminate\Contracts\Console\Kernel');
}

}
Loading
Loading