本文整理汇总了PHP中Illuminate\Foundation\Application::setBasePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::setBasePath方法的具体用法?PHP Application::setBasePath怎么用?PHP Application::setBasePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Foundation\Application
的用法示例。
在下文中一共展示了Application::setBasePath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bootstrap
/**
* Bootstrap the given application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @return void
*/
public function bootstrap(Application $app)
{
$this->app = $app;
$this->app->setBasePath($this->basePath);
$this->app->instance('path', $this->getPath());
foreach (['config', 'database', 'lang', 'public', 'storage'] as $path) {
$this->app->instance('path.' . $path, $this->getPath($path));
}
}
示例2: setupApplication
private function setupApplication()
{
$app = new Application();
$app->setBasePath(sys_get_temp_dir());
$app->instance('config', new Repository());
return $app;
}
示例3: setupApplication
/**
* @return Application
*/
private function setupApplication()
{
// Create the application such that the config is loaded.
$app = new Application();
$app->setBasePath(sys_get_temp_dir());
$app->instance('config', new Repository());
return $app;
}
示例4: setBasePath
/**
* Set the base path for the application.
*
* @param string $basePath
* @return $this
* @static
*/
public static function setBasePath($basePath)
{
return \Illuminate\Foundation\Application::setBasePath($basePath);
}