drbmhd9583
2016-10-18 14:32
浏览 183
已采纳

Laravel 5.3项目供应商:发布给出了FileNotFoundException

In a new laravel installation i have included several custom build packages. these packages are writing their migration files when i execute

php artisan vendor:publish

however this now gives the following error

 [League\Flysystem\FileNotFoundException]  File not found at path: 016_01_29_094442_create_xxxxx_2_f_a_tokens_table.php

which is not strange since the actual filename is: 2016_01_29_094442_xxxxx_2_f_a_tokens_table.php

This is what my ServiceProvider looks like:

class TwoFAServiceProvider extends ServiceProvider {

    ---- SNIP -----

    public function boot() {
        ---- SNIP -----
        $this->publishMigrations();
    }

    public function publishMigrations() {
        $this->publishes([
            __DIR__ . '/../../migrations/' => base_path('/database/migrations'),
        ], 'migrations');
    }
}

Does anyone know why this is occuring while yesterday this worked perfectly?

--EDIT --

The problem was an update to League\Flysystem in a patch version where they made path checking more restrictive which was reverted in an update so noone should have this issue.

https://github.com/thephpleague/flysystem/issues/712

图片转代码服务由CSDN问答提供 功能建议

在新的laravel安装中,我已经包含了几个自定义构建包。 当我执行

  php artisan vendor:publish 
   
 
 

时,这些包正在编写他们的迁移文件 以下错误

  [League \ Flysystem \ FileNotFoundException]在路径中找不到文件: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扩展ServiceProvider  {
 
 ---- SNIP ----- 
 
公共功能启动(){
 ---- SNIP ----- 
 $ this-> publishMigrations(); 
 公共函数publishMigrations(){
 $ this-> publishes([
 _ _ _ _ _ _ _ _ _ _ _ _ _  n],'迁移'); 
} 
} 
   
 
 

有人知道为什么会发生这种情况,而昨天这种情况完美无缺吗?

- 编辑 -

问题是在补丁版本中对League \ Flysystem进行了更新,他们对路径检查进行了更严格的限制,并在更新中恢复,因此没有人应该有这个问题。 < p> https://github.com/thephpleague/flysystem/issues/712

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dphj737575 2016-10-18 14:39
    已采纳

    Had the same problem. You should probably use backslashes in your paths, depending on your file system. See if this works:

    public function publishMigrations() {
        $this->publishes([
            __DIR__ . '\..\..\migrations\\' => base_path('database\migrations'),
        ], 'migrations');
    }
    
    点赞 打赏 评论

相关推荐 更多相似问题