本文整理汇总了PHP中Illuminate\Contracts\Foundation\Application::publicPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::publicPath方法的具体用法?PHP Application::publicPath怎么用?PHP Application::publicPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Contracts\Foundation\Application
的用法示例。
在下文中一共展示了Application::publicPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compileScriptMaterial
/**
* @return \Illuminate\Support\Collection
*/
protected function compileScriptMaterial()
{
$files = new Collection();
$this->layoutJsMaterial->merge($this->defaultJsMaterial)->merge($this->extendJsMaterial)->each(function ($value) use($files) {
$files->push($this->findPath($value));
});
$code = md5($files);
$this->dispatcher->listen('kernel.handled', function () use($code, $files) {
$dictionary = new Collection();
$dictionary->push($this->application->publicPath());
$dictionary->push('cache');
$dictionary = $this->pathSplit($code, '2,2,2,2,2,2', $dictionary);
$dictionary = $dictionary->implode(DIRECTORY_SEPARATOR);
if (!$this->files->isDirectory($dictionary)) {
$this->files->makeDirectory($dictionary, 0755, true, true);
}
$file = $dictionary . DIRECTORY_SEPARATOR . Str::substr($code, 12, 20) . '.js';
$key = 'cache.script.' . $code;
if (!$this->files->exists($file) || !$this->cache->has($key) && $this->application->inDebugMode()) {
$content = $this->compileScript($files);
$expires = Carbon::now()->addMinutes(10);
$this->cache->put($key, $content, $expires);
file_put_contents($file, $content);
}
});
return $this->pathSplit($code, '2,2,2,2,2,2,20', Collection::make(['cache']))->implode('/') . '.js';
}
示例2: bootstrap
public function bootstrap(Application $app)
{
$this->app = $app;
$this->fs = new Filesystem();
$paths = [$app->exportPath(), $app->homePath(), $app->storagePath(), $app->databasePath(), $app->publicPath(), $app->configPath()];
foreach ($paths as $path) {
$this->ensureDirectory($path);
}
$storagePaths = ['app', 'framework', 'framework/cache', 'framework/views', 'framework/sessions', 'logs', $app->getSlug()];
foreach ($storagePaths as $path) {
$this->ensureDirectory(path_join($app->storagePath(), $path));
}
}
示例3: publishAssets
protected function publishAssets()
{
$this->filesystem->copyDirectory($this->application->basePath() . '/vendor/components/font-awesome/fonts', $this->application->publicPath() . '/assets/fonts');
}