Skip to content

Commit 09964cc

Browse files
Removed compiled class file generation
1 parent 9e51e89 commit 09964cc

File tree

8 files changed

+2
-288
lines changed

8 files changed

+2
-288
lines changed

composer.json

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"php": ">=5.6.4",
1919
"ext-mbstring": "*",
2020
"ext-openssl": "*",
21-
"classpreloader/classpreloader": "~3.0",
2221
"doctrine/inflector": "~1.0",
2322
"erusev/parsedown": "~1.6",
2423
"league/flysystem": "~1.0",

src/Illuminate/Contracts/Foundation/Application.php

-7
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ public function booting($callback);
8383
*/
8484
public function booted($callback);
8585

86-
/**
87-
* Get the path to the cached "compiled.php" file.
88-
*
89-
* @return string
90-
*/
91-
public function getCachedCompilePath();
92-
9386
/**
9487
* Get the path to the cached services.php file.
9588
*

src/Illuminate/Foundation/Application.php

-10
Original file line numberDiff line numberDiff line change
@@ -860,16 +860,6 @@ public function getCachedRoutesPath()
860860
return $this->bootstrapPath().'/cache/routes.php';
861861
}
862862

863-
/**
864-
* Get the path to the cached "compiled.php" file.
865-
*
866-
* @return string
867-
*/
868-
public function getCachedCompilePath()
869-
{
870-
return $this->bootstrapPath().'/cache/compiled.php';
871-
}
872-
873863
/**
874864
* Get the path to the cached services.php file.
875865
*

src/Illuminate/Foundation/ComposerScripts.php

-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ protected static function clearCompiled()
4141
{
4242
$laravel = new Application(getcwd());
4343

44-
if (file_exists($compiledPath = $laravel->getCachedCompilePath())) {
45-
@unlink($compiledPath);
46-
}
47-
4844
if (file_exists($servicesPath = $laravel->getCachedServicesPath())) {
4945
@unlink($servicesPath);
5046
}

src/Illuminate/Foundation/Console/ClearCompiledCommand.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,12 @@ class ClearCompiledCommand extends Command
2727
*/
2828
public function fire()
2929
{
30-
$compiledPath = $this->laravel->getCachedCompilePath();
3130
$servicesPath = $this->laravel->getCachedServicesPath();
3231

33-
if (file_exists($compiledPath)) {
34-
@unlink($compiledPath);
35-
}
36-
3732
if (file_exists($servicesPath)) {
3833
@unlink($servicesPath);
3934
}
4035

41-
$this->info('The compiled class file has been removed.');
36+
$this->info('The compiled services file has been removed.');
4237
}
4338
}

src/Illuminate/Foundation/Console/Optimize/config.php

-207
This file was deleted.

src/Illuminate/Foundation/Console/OptimizeCommand.php

+1-52
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
namespace Illuminate\Foundation\Console;
44

5-
use ClassPreloader\Factory;
65
use Illuminate\Console\Command;
76
use Illuminate\Support\Composer;
87
use Symfony\Component\Console\Input\InputOption;
9-
use ClassPreloader\Exceptions\VisitorExceptionInterface;
108

119
class OptimizeCommand extends Command
1210
{
@@ -59,54 +57,7 @@ public function fire()
5957
$this->composer->dumpOptimized();
6058
}
6159

62-
if ($this->option('force') || ! $this->laravel['config']['app.debug']) {
63-
$this->info('Compiling common classes');
64-
$this->compileClasses();
65-
} else {
66-
$this->call('clear-compiled');
67-
}
68-
}
69-
70-
/**
71-
* Generate the compiled class file.
72-
*
73-
* @return void
74-
*/
75-
protected function compileClasses()
76-
{
77-
$preloader = (new Factory)->create(['skip' => true]);
78-
79-
$handle = $preloader->prepareOutput($this->laravel->getCachedCompilePath());
80-
81-
foreach ($this->getClassFiles() as $file) {
82-
try {
83-
fwrite($handle, $preloader->getCode($file, false)."\n");
84-
} catch (VisitorExceptionInterface $e) {
85-
//
86-
}
87-
}
88-
89-
fclose($handle);
90-
}
91-
92-
/**
93-
* Get the classes that should be combined and compiled.
94-
*
95-
* @return array
96-
*/
97-
protected function getClassFiles()
98-
{
99-
$app = $this->laravel;
100-
101-
$core = require __DIR__.'/Optimize/config.php';
102-
103-
$files = array_merge($core, $app['config']->get('compile.files', []));
104-
105-
foreach ($app['config']->get('compile.providers', []) as $provider) {
106-
$files = array_merge($files, forward_static_call([$provider, 'compiles']));
107-
}
108-
109-
return array_map('realpath', $files);
60+
$this->call('clear-compiled');
11061
}
11162

11263
/**
@@ -117,8 +68,6 @@ protected function getClassFiles()
11768
protected function getOptions()
11869
{
11970
return [
120-
['force', null, InputOption::VALUE_NONE, 'Force the compiled class file to be written.'],
121-
12271
['psr', null, InputOption::VALUE_NONE, 'Do not optimize Composer dump-autoload.'],
12372
];
12473
}

src/Illuminate/Support/Facades/App.php

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* @method static void boot()
1414
* @method static void booting(mixed $callback)
1515
* @method static void booted(mixed $callback)
16-
* @method static string getCachedCompilePath()
1716
* @method static string getCachedServicesPath()
1817
*
1918
* @see \Illuminate\Foundation\Application

0 commit comments

Comments
 (0)