Laravel 5.3 项目 vendor:publish 给出 FileNotFoundException
Laravel 5.3 project vendor:publish gives FileNotFoundException
在新的 laravel 安装中,我包含了几个自定义构建包。当我执行时,这些包正在写入它们的迁移文件
php artisan vendor:publish
但是现在出现以下错误
[League\Flysystem\FileNotFoundException] File not found at path: 016_01_29_094442_create_xxxxx_2_f_a_tokens_table.php
这并不奇怪,因为实际的文件名是:2016_01_29_094442_xxxxx_2_f_a_tokens_table.php
这是我的 ServiceProvider 的样子:
class TwoFAServiceProvider extends ServiceProvider {
---- SNIP -----
public function boot() {
---- SNIP -----
$this->publishMigrations();
}
public function publishMigrations() {
$this->publishes([
__DIR__ . '/../../migrations/' => base_path('/database/migrations'),
], 'migrations');
}
}
有谁知道为什么会发生这种情况,而昨天它运行良好?
--编辑--
问题出在补丁版本 League\Flysystem 的更新中,他们对路径检查进行了更严格的限制,但在更新中已恢复,因此没有人会遇到此问题。
有同样的问题。您可能应该在路径中使用反斜杠,具体取决于您的文件系统。看看这是否有效:
public function publishMigrations() {
$this->publishes([
__DIR__ . '\..\..\migrations\' => base_path('database\migrations'),
], 'migrations');
}
在新的 laravel 安装中,我包含了几个自定义构建包。当我执行时,这些包正在写入它们的迁移文件
php artisan vendor:publish
但是现在出现以下错误
[League\Flysystem\FileNotFoundException] File not found at path: 016_01_29_094442_create_xxxxx_2_f_a_tokens_table.php
这并不奇怪,因为实际的文件名是:2016_01_29_094442_xxxxx_2_f_a_tokens_table.php
这是我的 ServiceProvider 的样子:
class TwoFAServiceProvider extends ServiceProvider {
---- SNIP -----
public function boot() {
---- SNIP -----
$this->publishMigrations();
}
public function publishMigrations() {
$this->publishes([
__DIR__ . '/../../migrations/' => base_path('/database/migrations'),
], 'migrations');
}
}
有谁知道为什么会发生这种情况,而昨天它运行良好?
--编辑--
问题出在补丁版本 League\Flysystem 的更新中,他们对路径检查进行了更严格的限制,但在更新中已恢复,因此没有人会遇到此问题。
有同样的问题。您可能应该在路径中使用反斜杠,具体取决于您的文件系统。看看这是否有效:
public function publishMigrations() {
$this->publishes([
__DIR__ . '\..\..\migrations\' => base_path('database\migrations'),
], 'migrations');
}