Commit 82315f31 authored by Taylor Otwell's avatar Taylor Otwell

added configurable automatic key generation.

parent 6b14bd39
...@@ -89,18 +89,6 @@ ...@@ -89,18 +89,6 @@
</head> </head>
<body> <body>
<div id="main"> <div id="main">
<?php if (Config::get('application.key') == ''): ?>
<h1>Whoops!</h1>
<br>
<div class="warning">
Please set an application key in <strong>application/config/application.php</strong>!
</div>
<?php else: ?>
<h1>Welcome To Laravel</h1> <h1>Welcome To Laravel</h1>
<h2>A Framework For Web Artisans</h2> <h2>A Framework For Web Artisans</h2>
...@@ -136,9 +124,6 @@ ...@@ -136,9 +124,6 @@
<li><a href="http://forums.laravel.com">Laravel Forums</a></li> <li><a href="http://forums.laravel.com">Laravel Forums</a></li>
<li><a href="http://github.com/laravel/laravel">GitHub Repository</a></li> <li><a href="http://github.com/laravel/laravel">GitHub Repository</a></li>
</ul> </ul>
<?php endif; ?>
</div> </div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -64,6 +64,18 @@ if (isset($_SERVER['CLI']['ENV'])) ...@@ -64,6 +64,18 @@ if (isset($_SERVER['CLI']['ENV']))
$_SERVER['LARAVEL_ENV'] = $_SERVER['CLI']['ENV']; $_SERVER['LARAVEL_ENV'] = $_SERVER['CLI']['ENV'];
} }
/**
* Call the bootstrap Closure that was defined in the start.php
* file for the framework. This allows events and more to be
* registered extremely early in the life cycle.
*/
if (isset($bootstrap))
{
call_user_func($bootstrap);
unset($bootstrap);
}
/** /**
* Register all of the core class aliases. These aliases provide a * Register all of the core class aliases. These aliases provide a
* convenient way of working with the Laravel core classes without * convenient way of working with the Laravel core classes without
......
...@@ -52,6 +52,20 @@ error_reporting(-1); ...@@ -52,6 +52,20 @@ error_reporting(-1);
ini_set('display_errors', Config::get('error.display')); ini_set('display_errors', Config::get('error.display'));
/**
* Determine if we need to set the application key to a random
* string for the developer. This provides the developer with
* a zero configuration install process.
*/
$key = Config::get('application.key');
if ($key == '' and Config::get('key.auto'))
{
ob_start() and with(new CLI\Tasks\Key)->generate();
ob_end_clean();
}
/** /**
* Even though "Magic Quotes" are deprecated in PHP 5.3, they may * Even though "Magic Quotes" are deprecated in PHP 5.3, they may
* still be enabled on the server. To account for this, we will * still be enabled on the server. To account for this, we will
......
...@@ -58,6 +58,14 @@ else ...@@ -58,6 +58,14 @@ else
$paths['public'] = 'public'; $paths['public'] = 'public';
} }
// --------------------------------------------------------------
// Define a bootstrap Closure that runs on core load.
// --------------------------------------------------------------
$bootstrap = function()
{
Laravel\Config::set('key.auto', true);
};
// -------------------------------------------------------------- // --------------------------------------------------------------
// Define each constant if it hasn't been defined. // Define each constant if it hasn't been defined.
// -------------------------------------------------------------- // --------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment