问题运行php artisan优化

时间:2016-06-10 03:31:36

标签: laravel laravel-5.2

我的Laravel 5.2应用程序出现问题。我试图将我的存储库安装到Forge,并且我一直收到“提供的文件无效”错误,导致安装无法完成。

要在我的本地计算机上模仿这个,我将.env文件更改为生产模式并运行php artisan optimize,这是Forge安装卡住的地方。我得到了同样的错误,这是我的laravel.log文件的输出。

[2016-06-10 03:14:39] local.ERROR: RuntimeException: Invalid filename provided. in /{{ APP_PATH }}/vendor/classpreloader/classpreloader/src/ClassPreloader.php:114
Stack trace:
#0 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php(83): ClassPreloader\ClassPreloader->getCode(false, false)
#1 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Foundation/Console/OptimizeCommand.php(64): Illuminate\Foundation\Console\OptimizeCommand->compileClasses()
#2 [internal function]: Illuminate\Foundation\Console\OptimizeCommand->fire()
#3 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#4 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)
#5 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php(259): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(844): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(192): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Foundation\Console\OptimizeCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /{{ APP_PATH }}/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(123): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /{{ APP_PATH }}/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /{{ APP_PATH }}/artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 {main}  

我的config/compile.php文件在filesproviders数组中没有任何内容。我的composer.json的scripts部分更新为当前版本。这是我的整个composer.json文件:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "authorizenet/authorizenet": "^1.8",
        "inacho/php-credit-card-validator": "^1.0",
        "geoip2/geoip2": "^2.3",
        "doctrine/dbal": "^2.5",
        "laravelcollective/html": "^5.1",
        "pingdevelopment/usps-php-api": "@dev",
        "barryvdh/laravel-debugbar": "^2.0",
        "mobiledetect/mobiledetectlib": "^2.8",
        "phpmd/phpmd": "^2.3",
        "ext-curl": "*",
        "jms/serializer": "xsd2php-dev as 0.18.0",
        "barryvdh/laravel-dompdf": "^0.6.1",
        "easypost/easypost-php": "^3.0"
    },
    "repositories": [{
          "type": "vcs",
          "url": "https://github.com/goetas/serializer.git"
      }],
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1",
        "goetas/xsd2php": "2.*@dev",
        "goetas/xsd-reader": "2.*@dev",
        "symfony/dom-crawler": "~3.0",
        "symfony/css-selector": "~3.0"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/",
            "{{ APP NAME }}\\": "app/{{ APP NAME }}"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

我真的迷失在这里。

1 个答案:

答案 0 :(得分:1)

我经历了每一个依赖,我找到了罪魁祸首。事实证明它是class Pokemon(object): def __init__(self, name, poketype): self.name = name self.poketype = poketype def weakness(self): if self.poketype == 'fire': print 'strong against grass' print 'weak against water' elif self.poketype == 'water': print 'strong against first' print 'weak against grass' elif self.poketype == 'grass': print 'strong against water' print 'weak against fire' Charmander = Pokemon('charmander','fire') Squirtle = Pokemon('squirtle','water') Bulbasaur = Pokemon('bulbasaur','grass') print Charmander.weakness() 。他们引用了"authorizenet/authorizenet": "^1.8",这已被放弃。他们仍在努力修复以整合新的存储库,但与此同时,还添加了一个热修复程序。该依赖项应替换为"goetas/xsd2php": "2.*@dev"