Skip to content

Commit 9d1a077

Browse files
committed
Progress on v4
1 parent 5903226 commit 9d1a077

File tree

8 files changed

+78
-33
lines changed

8 files changed

+78
-33
lines changed

composer.json

-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@
5858
]
5959
},
6060
"extra": {
61-
"branch-alias": {
62-
"dev-develop": "3.x-dev"
63-
},
6461
"laravel": {
6562
"providers": [
6663
"October\\Rain\\Foundation\\Providers\\AppSupportServiceProvider",

src/Database/DatabaseServiceProvider.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class DatabaseServiceProvider extends DatabaseServiceProviderBase
1717
public function register()
1818
{
1919
Model::clearBootedModels();
20-
Model::clearExtendedClasses();
2120
Model::flushEventListeners();
2221

2322
$this->registerConnectionServices();

src/Extension/ExtendableTrait.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,6 @@ public static function extendableExtendCallback($callback)
9898
Container::$classCallbacks[$class][] = $callback;
9999
}
100100

101-
/**
102-
* @deprecated use \October\Rain\Extension\Container::clearExtensions()
103-
*/
104-
public static function clearExtendedClasses()
105-
{
106-
Container::clearExtensions();
107-
}
108-
109101
/**
110102
* extensionExtractImplements will return classes to implement.
111103
*/
@@ -617,4 +609,12 @@ protected function getExtendableMethodFromDynamicMethods(string $name): ?callabl
617609

618610
return $dynamicCallable;
619611
}
612+
613+
/**
614+
* @deprecated use \October\Rain\Extension\Container::clearExtensions()
615+
*/
616+
public static function clearExtendedClasses()
617+
{
618+
Container::clearExtensions();
619+
}
620620
}

src/Foundation/Application.php

+6-17
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Illuminate\Foundation\AliasLoader;
1212
use Illuminate\Foundation\PackageManifest;
1313
use Illuminate\Foundation\ProviderRepository;
14+
use Illuminate\Log\Context\ContextServiceProvider;
1415
use Carbon\Laravel\ServiceProvider as CarbonServiceProvider;
1516
use Illuminate\Support\Env;
1617
use Throwable;
@@ -46,11 +47,11 @@ protected function registerBaseServiceProviders()
4647

4748
$this->register(new LogServiceProvider($this));
4849

50+
$this->register(new ContextServiceProvider($this));
51+
4952
$this->register(new RoutingServiceProvider($this));
5053

5154
$this->register(new ExecutionContextProvider($this));
52-
53-
$this->register(new CarbonServiceProvider($this));
5455
}
5556

5657
/**
@@ -192,20 +193,6 @@ protected function normalizeCachePath($key, $default)
192193
: $this->basePath($env);
193194
}
194195

195-
/**
196-
* joinPaths together
197-
*
198-
* @todo Can be removed if Laravel >= 10
199-
*
200-
* @param string $basePath
201-
* @param string $path
202-
* @return string
203-
*/
204-
public function joinPaths($basePath, $path = '')
205-
{
206-
return $basePath.($path != '' ? DIRECTORY_SEPARATOR.ltrim($path, DIRECTORY_SEPARATOR) : '');
207-
}
208-
209196
/**
210197
* before logic is called before the router runs.
211198
* @param \Closure|string $callback
@@ -312,6 +299,8 @@ public function registerConfiguredProviders()
312299

313300
(new ProviderRepository($this, new Filesystem, $this->getCachedServicesPath()))
314301
->load($providers->collapse()->toArray());
302+
303+
$this->fireAppCallbacks($this->registeredCallbacks);
315304
}
316305

317306
/**
@@ -332,7 +321,7 @@ public function registerCoreContainerAliases()
332321
'db.schema' => [\Illuminate\Database\Schema\Builder::class],
333322
'encrypter' => [\Illuminate\Encryption\Encrypter::class, \Illuminate\Contracts\Encryption\Encrypter::class],
334323
'events' => [\October\Rain\Events\Dispatcher::class, \Illuminate\Contracts\Events\Dispatcher::class],
335-
'files' => [\Illuminate\Filesystem\Filesystem::class],
324+
'files' => [\October\Rain\Filesystem\Filesystem::class, \Illuminate\Filesystem\Filesystem::class],
336325
'filesystem' => [\Illuminate\Filesystem\FilesystemManager::class, \Illuminate\Contracts\Filesystem\Factory::class],
337326
'filesystem.disk' => [\Illuminate\Contracts\Filesystem\Filesystem::class],
338327
'filesystem.cloud' => [\Illuminate\Contracts\Filesystem\Cloud::class],
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php namespace October\Rain\Foundation\Configuration;
2+
3+
use Illuminate\Foundation\Configuration\ApplicationBuilder as ApplicationBuilderBase;
4+
use Illuminate\Foundation\Configuration\Exceptions;
5+
6+
/**
7+
* ApplicationBuilder foundation class as an extension of Laravel
8+
*/
9+
class ApplicationBuilder extends ApplicationBuilderBase
10+
{
11+
/**
12+
* Register the standard kernel classes for the application.
13+
*
14+
* @return $this
15+
*/
16+
public function withKernels()
17+
{
18+
$this->app->singleton(
19+
\Illuminate\Contracts\Http\Kernel::class,
20+
\October\Rain\Foundation\Http\Kernel::class
21+
);
22+
23+
$this->app->singleton(
24+
\Illuminate\Contracts\Console\Kernel::class,
25+
\October\Rain\Foundation\Console\Kernel::class
26+
);
27+
28+
return $this;
29+
}
30+
31+
/**
32+
* Register and configure the application's exception handler.
33+
*
34+
* @param callable|null $using
35+
* @return $this
36+
*/
37+
// public function withExceptions(?callable $using = null)
38+
// {
39+
// $this->app->singleton(
40+
// \Illuminate\Contracts\Debug\ExceptionHandler::class,
41+
// \October\Rain\Foundation\Exception\Handler::class
42+
// );
43+
44+
// $using ??= fn () => true;
45+
46+
// $this->app->afterResolving(
47+
// \Illuminate\Foundation\Exceptions\Handler::class,
48+
// fn ($handler) => $using(new Exceptions($handler)),
49+
// );
50+
51+
// return $this;
52+
// }
53+
}

src/Foundation/Providers/AppSupportServiceProvider.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php namespace October\Rain\Foundation\Providers;
22

33
use Illuminate\Support\AggregateServiceProvider;
4+
use October\Rain\Extension\Container as OctoberContainer;
45

56
/**
67
* AppSupportServiceProvider supplies eager providers
@@ -17,4 +18,12 @@ class AppSupportServiceProvider extends AggregateServiceProvider
1718
\October\Rain\Html\UrlServiceProvider::class,
1819
\October\Rain\Argon\ArgonServiceProvider::class
1920
];
21+
22+
/**
23+
* register the service provider
24+
*/
25+
public function register()
26+
{
27+
OctoberContainer::clearExtensions();
28+
}
2029
}

src/Halcyon/HalcyonServiceProvider.php

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public function register()
3434
{
3535
Model::clearBootedModels();
3636

37-
Model::clearExtendedClasses();
38-
3937
Model::flushEventListeners();
4038

4139
$this->app->singleton('halcyon', function ($app) {

src/Support/helpers.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ function array_except($array, $keys)
373373
* @param mixed $default
374374
* @return mixed
375375
*/
376-
function array_first($array, callable $callback = null, $default = null)
376+
function array_first($array, $callback = null, $default = null)
377377
{
378378
return Arr::first($array, $callback, $default);
379379
}
@@ -440,7 +440,7 @@ function array_has($array, $keys)
440440
* @param mixed $default
441441
* @return mixed
442442
*/
443-
function array_last($array, callable $callback = null, $default = null)
443+
function array_last($array, $callback = null, $default = null)
444444
{
445445
return Arr::last($array, $callback, $default);
446446
}

0 commit comments

Comments
 (0)