Browse Source

Update for optimize command.

Taylor Otwell 11 years ago
parent
commit
13d7adb38f
4 changed files with 37 additions and 0 deletions
  1. 1 0
      .gitignore
  2. 1 0
      app/config/app.php
  3. 18 0
      app/config/compile.php
  4. 17 0
      bootstrap/autoload.php

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
+/bootstrap/compiled.php
 /vendor
 composer.phar
 composer.lock

+ 1 - 0
app/config/app.php

@@ -97,6 +97,7 @@ return array(
 		'Illuminate\Log\LogServiceProvider',
 		'Illuminate\Mail\MailServiceProvider',
 		'Illuminate\Database\MigrationServiceProvider',
+		'Illuminate\Foundation\Providers\OptimizeServiceProvider',
 		'Illuminate\Pagination\PaginationServiceProvider',
 		'Illuminate\Foundation\Providers\PublisherServiceProvider',
 		'Illuminate\Queue\QueueServiceProvider',

+ 18 - 0
app/config/compile.php

@@ -0,0 +1,18 @@
+<?php
+
+return array(
+
+	/*
+	|--------------------------------------------------------------------------
+	| Additional Compiled Classes
+	|--------------------------------------------------------------------------
+	|
+	| Here you may specify additional classes to include in the compiled file
+	| generated by the `artisan optimize` command. These should be classes
+	| that are included on basically every request into the application.
+	|
+	*/
+
+
+
+);

+ 17 - 0
bootstrap/autoload.php

@@ -14,6 +14,23 @@
 
 require __DIR__.'/../vendor/autoload.php';
 
+/*
+|--------------------------------------------------------------------------
+| Register The Composer Auto Loader
+|--------------------------------------------------------------------------
+|
+| Composer provides a convenient, automatically generated class loader
+| for our application. We just need to utilize it! We'll require it
+| into the script here so that we do not have to worry about the
+| loading of any our classes "manually". Feels great to relax.
+|
+*/
+
+if (file_exists($compiled = __DIR__.'/compiled.php'))
+{
+	require $compiled;
+}
+
 /*
 |--------------------------------------------------------------------------
 | Register The Laravel Auto Loader