From 5109a7f6216a6ca40e0460480d15a2c20328ebad Mon Sep 17 00:00:00 2001 From: Fabian Vogler Date: Sat, 21 May 2016 15:21:23 +0200 Subject: [PATCH] Remove support for XHProf Not maintained anymore, alternatives exist --- .gitignore | 1 - composer.json | 1 - composer.lock | 48 +++-------------------------------- config.php.docker | 1 - config.php.sample | 3 --- lib/Transport/Application.php | 6 ----- var/xhprof/.gitkeep | 0 web/api.php | 12 --------- 8 files changed, 3 insertions(+), 69 deletions(-) delete mode 100755 var/xhprof/.gitkeep diff --git a/.gitignore b/.gitignore index 40230cb..85c7038 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /config.php /var/cache/ /var/logs/ -/var/xhprof/ /vendor/ diff --git a/composer.json b/composer.json index d55ad0d..8ebf31d 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,6 @@ "predis/predis": "~1.0", "twig/twig": "~1.23", "monolog/monolog": "~1.17", - "facebook/xhprof": "dev-master", "symfony/serializer": "~2.3|3.0.*", "ekino/newrelic-bundle": "~1.3" }, diff --git a/composer.lock b/composer.lock index d6c7ab7..b6eedf5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "f2930931266da359aa4b2b2bd3c2e42a", - "content-hash": "ede5049c813f97b692cc49b5cbb73e5b", + "hash": "4d1c2c18f1cd7400164fa3fdc85c88b5", + "content-hash": "d681940500f68e610c7a9cce6ae3ab92", "packages": [ { "name": "ekino/newrelic-bundle", @@ -62,46 +62,6 @@ ], "time": "2015-11-12 08:59:07" }, - { - "name": "facebook/xhprof", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/lox/xhprof.git", - "reference": "d9bfac3d543e017eff1351d2bd795240d747a079" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/lox/xhprof/zipball/d9bfac3d543e017eff1351d2bd795240d747a079", - "reference": "d9bfac3d543e017eff1351d2bd795240d747a079", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "bin": [ - "bin/xhprofile" - ], - "type": "library", - "autoload": { - "files": [ - "xhprof_lib/utils/xhprof_lib.php", - "xhprof_lib/utils/xhprof_runs.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "XHProf: A Hierarchical Profiler for PHP", - "homepage": "http://pecl.php.net/package/xhprof", - "keywords": [ - "performance", - "profiling" - ], - "abandoned": "lox/xhprof", - "time": "2015-08-23 09:14:39" - }, { "name": "ircmaxell/password-compat", "version": "v1.0.4", @@ -2182,9 +2142,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "facebook/xhprof": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/config.php.docker b/config.php.docker index 0ac0151..25429ca 100644 --- a/config.php.docker +++ b/config.php.docker @@ -4,7 +4,6 @@ $app['debug'] = false; $app['http_cache'] = false; $app['buzz.client'] = new Buzz\Client\Curl(); $app['monolog.level'] = Monolog\Logger::ERROR; -$app['xhprof'] = false; $app['redis.config'] = array('host' => 'redis', 'port' => 6379); $app['stats.config'] = array('enabled' => true); $app['rate_limiting.config'] = array('enabled' => true, 'limit' => 300); diff --git a/config.php.sample b/config.php.sample index 23e1106..1066dbe 100644 --- a/config.php.sample +++ b/config.php.sample @@ -12,9 +12,6 @@ $app['buzz.client'] = null; // new Buzz\Client\Curl(); // Log level $app['monolog.level'] = Monolog\Logger::ERROR; -// XHProf for profiling -$app['xhprof'] = false; - // Redis for statistics and rate limiting $app['redis.config'] = false; // array('host' => 'localhost', 'port' => 6379); diff --git a/lib/Transport/Application.php b/lib/Transport/Application.php index 7ba4de4..3648257 100644 --- a/lib/Transport/Application.php +++ b/lib/Transport/Application.php @@ -28,7 +28,6 @@ public function __construct() $app['http_cache'] = false; $app['buzz.client'] = null; $app['monolog.level'] = \Monolog\Logger::ERROR; - $app['xhprof'] = false; $app['redis.config'] = false; // array('host' => 'localhost', 'port' => 6379); $app['stats.config'] = array('enabled' => false); $app['rate_limiting.config'] = array('enabled' => false, 'limit' => 150); @@ -85,11 +84,6 @@ public function __construct() $app['monolog']->addInfo('- ' . $request->getClientIp() . ' ' . $request->headers->get('referer') . ' ' . $request->server->get('HTTP_USER_AGENT')); }); - // XHProf - if ($app['xhprof']) { - xhprof_enable(); - } - // if hosted behind a reverse proxy if ($app['proxy']) { $proxies = array($_SERVER['REMOTE_ADDR']); diff --git a/var/xhprof/.gitkeep b/var/xhprof/.gitkeep deleted file mode 100755 index e69de29..0000000 diff --git a/web/api.php b/web/api.php index 160d5fc..5ba1e87 100644 --- a/web/api.php +++ b/web/api.php @@ -15,15 +15,3 @@ } else { $app->run(); } - -// save XHProf run -if ($app['xhprof']) { - - $data = xhprof_disable(); - - include_once __DIR__.'/../vendor/facebook/xhprof/xhprof_lib/utils/xhprof_lib.php'; - include_once __DIR__.'/../vendor/facebook/xhprof/xhprof_lib/utils/xhprof_runs.php'; - - $xhprof = new XHProfRuns_Default(__DIR__.'/../var/xhprof'); - $run_id = $xhprof->save_run($data, 'transport'); -}