Skip to content

Instantly share code, notes, and snippets.

@penyaskito
Forked from hannesl/xhprof.rb
Last active January 31, 2020 11:54
Show Gist options
  • Select an option

  • Save penyaskito/b82473e659d93188ce7bd3eb1df3b3f4 to your computer and use it in GitHub Desktop.

Select an option

Save penyaskito/b82473e659d93188ce7bd3eb1df3b3f4 to your computer and use it in GitHub Desktop.
A Homebrew formula for installing the latest Xhprof from Github.
require 'formula'
class Xhprof <Formula
url 'https://github.com/facebook/xhprof.git'
homepage 'http://mirror.facebook.net/facebook/xhprof/doc.html'
version 'master'
depends_on 'pcre'
def install
Dir.chdir "extension" do
system "PHP_AUTOCONF=/usr/local/bin/autoconf PHP_AUTOHEADER=/usr/local/bin/autoheader phpize"
system "PHP_AUTOCONF=/usr/local/bin/autoconf PHP_AUTOHEADER=/usr/local/bin/autoheader ./configure", "--prefix=#{prefix}"
system "PHP_AUTOCONF=/usr/local/bin/autoconf PHP_AUTOHEADER=/usr/local/bin/autoheader make"
prefix.install %w(modules/xhprof.so)
end
prefix.install %w(xhprof_html xhprof_lib)
end
def caveats; <<-EOS.undent
To finish installing XHProf:
* Add the following lines to php.ini:
[xhprof]
extension="#{prefix}/xhprof.so"
* Restart your webserver
EOS
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment