本文整理汇总了PHP中Illuminate\Support\ServiceProvider::pathsToPublish方法的典型用法代码示例。如果您正苦于以下问题:PHP ServiceProvider::pathsToPublish方法的具体用法?PHP ServiceProvider::pathsToPublish怎么用?PHP ServiceProvider::pathsToPublish使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\ServiceProvider
的用法示例。
在下文中一共展示了ServiceProvider::pathsToPublish方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_it_should_publish_the_config_path
public function test_it_should_publish_the_config_path()
{
$this->appMock->shouldReceive('routesAreCached')->andReturn(true);
$this->appMock->shouldReceive('call');
$this->sp->boot($this->routerMock);
$paths = ServiceProvider::pathsToPublish(RouteBinderServiceProvider::class, 'config');
$this->assertArrayHasKey(dirname(__DIR__) . '/config/routes.php', $paths);
$this->assertContains('/config/routes.php', $paths);
}
示例2: fire
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$paths = ServiceProvider::pathsToPublish($this->option('provider'), $this->option('tag'));
foreach ($paths as $from => $to) {
if ($this->files->isFile($from)) {
$this->publishFile($from, $to);
} elseif ($this->files->isDirectory($from)) {
$this->publishDirectory($from, $to);
}
}
$this->info('Publishing Complete!');
}
示例3: fire
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$paths = ServiceProvider::pathsToPublish($this->option('provider'), $this->option('tag'));
if (empty($paths)) {
return $this->comment("Nothing to publish.");
}
foreach ($paths as $from => $to) {
if ($this->files->isFile($from)) {
$this->publishFile($from, $to);
} elseif ($this->files->isDirectory($from)) {
$this->publishDirectory($from, $to);
} else {
$this->error("Can't locate path: <{$from}>");
}
}
$this->info('Publishing Complete!');
}
示例4: publishTag
/**
* Publishes the assets for a tag.
*
* @param string $tag
*
* @return mixed
*/
private function publishTag($tag)
{
$paths = ServiceProvider::pathsToPublish($this->option('provider'), $tag);
if (empty($paths)) {
return $this->comment("Nothing to publish for tag [{$tag}].");
}
foreach ($paths as $from => $to) {
if ($this->files->isFile($from)) {
$this->publishFile($from, $to);
} elseif ($this->files->isDirectory($from)) {
$this->publishDirectory($from, $to);
} else {
$this->error("Can't locate path: <{$from}>");
}
}
$this->info("Publishing complete for tag [{$tag}]!");
}
示例5: handlePublishes
protected function handlePublishes()
{
if ($this->published) {
return;
}
$pathsToPublish = ServiceProvider::pathsToPublish($this->extension->namespace);
$this->ensurePathsExistence(array_keys($pathsToPublish));
\Artisan::call('vendor:publish', ['--provider' => $this->extension->namespace]);
// Ensure the paths exist
$this->waitUntilPathsExist(array_values($pathsToPublish));
$this->published = true;
}
示例6: testPublishedPathsAssets
public function testPublishedPathsAssets()
{
$paths = ServiceProvider::pathsToPublish('NewMarket\\Content\\Providers\\ContentServiceProvider', 'assets');
$this->assertTrue(count($paths) > 0);
}