jonaswouters / XhprofBundle

XHProf bundle for Symfony 2
210 stars 49 forks source link

Error on production server with xhprof disabled #70

Closed ryabenko-pro closed 9 years ago

ryabenko-pro commented 9 years ago

This is kinda strange. It was working fine, but today after I run composer self-update and then composer install I've got this issue:

*@cat:~/projects/*/www$ ./composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
  - Installing facebook/xhprof (dev-master 6bf0072)
    Cloning 6bf00728827fc1e2a639dff6f94f1618396bffc5

  - Installing jns/xhprof-bundle (dev-master 2630d49)
    Cloning 2630d49bab9b0722c8e184e2e8153edbdbe74d5f

  - Installing sensio/generator-bundle (dev-master e50108c)
    Cloning e50108c2133ee5c9c484555faed50c17a61221d3

jns/xhprof-bundle suggests installing ext-xhprof (Hierarchical Profiler for PHP)
Generating autoload files
Updating the "app/config/parameters.yml" file

  [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
  Xhprof Bundle is enabled but the xhprof extension is not enabled.

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception

  [RuntimeException]
  An error occurred when executing the "'cache:clear --no-warmup'" command.

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]
jonaswouters commented 9 years ago

Hey @ryabenko-pro

Looks like the xhprof extension is not enabled in your environment. Take a look at this pull request and let me know if you have any questions https://github.com/jonaswouters/XhprofBundle/pull/61

@stephpy Do you think this was a bad change? We can always roll back

ewgRa commented 9 years ago

Same for me. Some developers have xhprof, some not. Solve it by move enabled to params, but it is ugly on my mind.

Maybe better to have something "strict_enabled", or "check_extension_exists"

jonaswouters commented 9 years ago

@ewgRa feel free to add it and do a pull request :)

jonaswouters commented 9 years ago

Or perhaps revert the changes? https://github.com/jonaswouters/XhprofBundle/pull/72

ewgRa commented 9 years ago

I don't know how author follow BC changes. On my mind #61 broke BC. But for now revert it - broke it again. Since there is one year left, I prefer not to revert it, but add require_extension_exists: true by default.

In this case there is no BC, but I and others will have ability to skip this requirement. And just render in profiler something like "Disabled due to extension not exists".

If this good idea, I can make pull request, no problem.

jonaswouters commented 9 years ago

Sure, pull request welcome.

ewgRa commented 9 years ago

Pull request for this #73

jonaswouters commented 9 years ago

Pull request accepted