Merge pull request #1687 from bencorlett/develop
Adding ability to specify public path and centralising paths into their own file.
This commit is contained in:
@@ -13,7 +13,7 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase {
|
|||||||
|
|
||||||
$testEnvironment = 'testing';
|
$testEnvironment = 'testing';
|
||||||
|
|
||||||
return require __DIR__.'/../../start.php';
|
return require __DIR__.'/../../bootstrap/start.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
4
artisan
4
artisan
@@ -27,7 +27,7 @@ require __DIR__.'/bootstrap/autoload.php';
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$app = require_once __DIR__.'/start.php';
|
$app = require_once __DIR__.'/bootstrap/start.php';
|
||||||
|
|
||||||
$app->boot();
|
$app->boot();
|
||||||
|
|
||||||
@@ -56,4 +56,4 @@ $artisan = Illuminate\Console\Application::start($app);
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$artisan->run();
|
$artisan->run();
|
||||||
|
|||||||
@@ -41,4 +41,4 @@ Illuminate\Support\ClassLoader::register();
|
|||||||
if (is_dir($workbench = __DIR__.'/../workbench'))
|
if (is_dir($workbench = __DIR__.'/../workbench'))
|
||||||
{
|
{
|
||||||
Illuminate\Workbench\Starter::start($workbench);
|
Illuminate\Workbench\Starter::start($workbench);
|
||||||
}
|
}
|
||||||
|
|||||||
42
bootstrap/paths.php
Normal file
42
bootstrap/paths.php
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return array(
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Application Path
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here we just defined the path to the application directory. Most likely
|
||||||
|
| you will never need to change this value as the default setup should
|
||||||
|
| work perfectly fine for the vast majority of all our applications.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'app' => __DIR__.'/../app',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Public Path
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| We understand that not all hosting environments allow flexibility with
|
||||||
|
| public paths. That's why we allow you to change where your public path
|
||||||
|
| is below.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'public' => __DIR__.'/../public',
|
||||||
|
|
||||||
|
/*
|
||||||
|
|-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
| Base Path
|
||||||
|
|-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
|
|
||||||
|
| You probably shouldn't be editing this.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'base' => __DIR__.'/..',
|
||||||
|
|
||||||
|
);
|
||||||
@@ -15,18 +15,21 @@ $app = new Illuminate\Foundation\Application;
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Define The Application Path
|
| Bind Paths
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Here we just defined the path to the application directory. Most likely
|
| Here we are binding the paths configured in paths.php to the app. You
|
||||||
| you will never need to change this value as the default setup should
|
| should not be changing these here but rather in paths.php.
|
||||||
| work perfectly fine for the vast majority of all our applications.
|
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$app->instance('path', $appPath = __DIR__.'/app');
|
$paths = require __DIR__.'/paths.php';
|
||||||
|
|
||||||
$app->instance('path.base', __DIR__);
|
$app->instance('path', $appPath = $paths['app']);
|
||||||
|
|
||||||
|
$app->instance('path.base', $paths['base']);
|
||||||
|
|
||||||
|
$app->instance('path.public', $paths['public']);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -69,4 +72,4 @@ require $app->getBootstrapFile();
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return $app;
|
return $app;
|
||||||
@@ -12,4 +12,4 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev"
|
"minimum-stability": "dev"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ require __DIR__.'/../bootstrap/autoload.php';
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$app = require_once __DIR__.'/../start.php';
|
$app = require_once __DIR__.'/../bootstrap/start.php';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
|||||||
|
|
||||||
$uri = urldecode($uri);
|
$uri = urldecode($uri);
|
||||||
|
|
||||||
$requested = __DIR__.'/public'.$uri;
|
$paths = require __DIR__.'/bootstrap/paths.php';
|
||||||
|
|
||||||
|
$requested = $paths['public'].$uri;
|
||||||
|
|
||||||
// This file allows us to emulate Apache's "mod_rewrite" functionality from the
|
// This file allows us to emulate Apache's "mod_rewrite" functionality from the
|
||||||
// built-in PHP web server. This provides a convenient way to test a Laravel
|
// built-in PHP web server. This provides a convenient way to test a Laravel
|
||||||
@@ -14,4 +16,4 @@ if ($uri !== '/' and file_exists($requested))
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once(__DIR__ . '/public/index.php');
|
require_once $paths['public'].'/index.php';
|
||||||
|
|||||||
Reference in New Issue
Block a user