Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jun 16, 2021. It is now read-only.

Commit 0d6c610

Browse files
author
zouyi
committed
copy from homebrew-php
1 parent abd2ad8 commit 0d6c610

File tree

769 files changed

+27179
-424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

769 files changed

+27179
-424
lines changed

Formula/adminer.rb

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
class Adminer < Formula
2+
desc "Full-featured database management tool written in PHP."
3+
homepage "https://www.adminer.org"
4+
url "https://github.com/vrana/adminer/releases/download/v4.6.2/adminer-4.6.2.php"
5+
sha256 "2b3e5e87ed1214288378fc272c1ba0497ec2f1128444e3a581eabd435f5575b9"
6+
7+
bottle do
8+
cellar :any_skip_relocation
9+
sha256 "9abd7ee3578c322c9710d7f2d095ebe7a844303a950ddccb7bb253c1254adfee" => :high_sierra
10+
sha256 "9abd7ee3578c322c9710d7f2d095ebe7a844303a950ddccb7bb253c1254adfee" => :sierra
11+
sha256 "9abd7ee3578c322c9710d7f2d095ebe7a844303a950ddccb7bb253c1254adfee" => :el_capitan
12+
end
13+
14+
def install
15+
pkgshare.install "adminer-"+version+".php" => "index.php"
16+
end
17+
18+
def caveats; <<~EOS
19+
Note that this formula will NOT install MySQL or any other
20+
database. It is not required since you might want to get
21+
connected to a remote database server.
22+
23+
Webserver configuration example (add this at the end of
24+
your /etc/apache2/httpd.conf for instance):
25+
26+
Alias /adminer #{HOMEBREW_PREFIX}/share/adminer
27+
<Directory "#{HOMEBREW_PREFIX}/share/adminer/">
28+
Options None
29+
AllowOverride None
30+
<IfModule mod_authz_core.c>
31+
Require all granted
32+
</IfModule>
33+
<IfModule !mod_authz_core.c>
34+
Order allow,deny
35+
Allow from all
36+
</IfModule>
37+
</Directory>
38+
39+
Then, open http://localhost/adminer
40+
EOS
41+
end
42+
43+
test do
44+
system "php", "-l", "#{pkgshare}/index.php"
45+
end
46+
end

Formula/arcanist.rb

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
require File.expand_path("../../Requirements/php-meta-requirement", __FILE__)
2+
3+
class Arcanist < Formula
4+
desc "Phabricator Arcanist Tool"
5+
homepage "https://secure.phabricator.com/book/phabricator/article/arcanist/"
6+
7+
stable do
8+
url "https://github.com/wikimedia/arcanist/archive/release/2018-02-15/1.tar.gz"
9+
sha256 "75888393e3f0ffb8a567a877b31903db8390b622f73ad501b8eb1bcafb4320fa"
10+
version "201802151"
11+
12+
resource "libphutil" do
13+
url "https://github.com/wikimedia/phabricator-libphutil/archive/release/2018-02-15/1.tar.gz"
14+
sha256 "a46f0721fa8166ed5edf24ecfe395d7d41e4728681969dded12c664c6fb2074e"
15+
version "201802151"
16+
end
17+
end
18+
bottle do
19+
cellar :any_skip_relocation
20+
sha256 "940958142203fbd922457fd2fb1e6d7461dace75ed991ecd4770dcf9e234821d" => :high_sierra
21+
sha256 "940958142203fbd922457fd2fb1e6d7461dace75ed991ecd4770dcf9e234821d" => :sierra
22+
sha256 "940958142203fbd922457fd2fb1e6d7461dace75ed991ecd4770dcf9e234821d" => :el_capitan
23+
end
24+
25+
head do
26+
url "https://github.com/phacility/arcanist.git"
27+
28+
resource "libphutil" do
29+
url "https://github.com/phacility/libphutil.git"
30+
end
31+
end
32+
33+
depends_on PhpMetaRequirement
34+
35+
def install
36+
libexec.install Dir["*"]
37+
38+
resource("libphutil").stage do
39+
(buildpath/"libphutil").install Dir["*"]
40+
end
41+
42+
prefix.install Dir["*"]
43+
44+
bin.install_symlink libexec/"bin/arc" => "arc"
45+
46+
cp libexec/"resources/shell/bash-completion", libexec/"resources/shell/arc-completion.zsh"
47+
bash_completion.install libexec/"resources/shell/bash-completion" => "arc"
48+
zsh_completion.install libexec/"resources/shell/arc-completion.zsh" => "_arc"
49+
end
50+
51+
test do
52+
system "#{bin}/arc", "help"
53+
end
54+
end

Formula/behat.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require File.expand_path("../../Abstract/abstract-php-phar", __FILE__)
2+
3+
class Behat < AbstractPhpPhar
4+
init
5+
desc "BDD framework for PHP to help you test business expectations"
6+
homepage "http://behat.org/"
7+
url "https://github.com/Behat/Behat/releases/download/v3.3.0/behat.phar"
8+
version "3.3.0"
9+
sha256 "d99fdf7e7d9459903ae2f9628e0459ab3357a1c93e0b55ad32f60e625c3cb9f7"
10+
head "https://github.com/Behat/Behat.git"
11+
12+
bottle do
13+
cellar :any_skip_relocation
14+
sha256 "09478ce163135b6fe50c095d3af4ea54755d4d98f8a28940a98c1334c42b8b4b" => :sierra
15+
sha256 "abf26ef96bc570728969dc05e11088cba6c20c68dccc77da55e801ffd4aa2abf" => :el_capitan
16+
sha256 "abf26ef96bc570728969dc05e11088cba6c20c68dccc77da55e801ffd4aa2abf" => :yosemite
17+
end
18+
19+
test do
20+
system bin/"behat", "--version"
21+
end
22+
end

Formula/boris.rb

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
require File.expand_path("../../language/php", __FILE__)
2+
require File.expand_path("../../Requirements/php-meta-requirement", __FILE__)
3+
4+
class Boris < Formula
5+
include Language::PHP::Composer
6+
7+
desc "Tiny REPL for PHP"
8+
homepage "https://github.com/borisrepl/boris/"
9+
url "https://github.com/borisrepl/boris/archive/v1.0.10.tar.gz"
10+
sha256 "06eb9e8efe5ceac00f49ba32731c65047435ab09ff57bbbec56c8c728861a2ee"
11+
head "https://github.com/borisrepl/boris.git"
12+
13+
bottle do
14+
cellar :any_skip_relocation
15+
sha256 "06ec5562b4f22fe3ad5e8ec82873975f028aecbb9afb5e539cfebca802302b73" => :sierra
16+
sha256 "0d80a4137e4a5924d1bea6549d5b20f90e08c15b3e33bf2c57af8fa19efc6a53" => :el_capitan
17+
sha256 "689ea4dd37b6a5019bbdb50f87e0ac9806d6a54aa318248aafa9949c45034b63" => :yosemite
18+
sha256 "e1ebb95b4a0107582b5460a9f1a4d9043e82578461db46ffbced3302caa2d721" => :mavericks
19+
end
20+
21+
depends_on PhpMetaRequirement
22+
23+
def install
24+
# ensure the required php modules are installed
25+
php_modules = Utils.popen_read("php -m")
26+
raise "php must be re-compiled, in order to have readline support" unless php_modules.include?("readline")
27+
raise "php must be re-compiled with pcntl support" unless php_modules.include?("pcntl")
28+
raise "php must be re-compiled with posix support" unless php_modules.include?("posix")
29+
30+
composer_install
31+
libexec.install Dir["*"]
32+
bin.install_symlink "#{libexec}/bin/boris"
33+
end
34+
35+
test do
36+
system "boris", "-h"
37+
end
38+
end

Formula/box.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
require File.expand_path("../../Abstract/abstract-php-phar", __FILE__)
2+
3+
class Box < AbstractPhpPhar
4+
init
5+
desc "application for building and managing Phars"
6+
homepage "https://box-project.github.io/box2/"
7+
url "https://github.com/box-project/box2/releases/download/2.7.5/box-2.7.5.phar"
8+
sha256 "28b4b798ad4dcf8fbf9cd68aaff495d4bbeaec4363f5f319a222829d9b6abdfe"
9+
10+
bottle do
11+
cellar :any_skip_relocation
12+
sha256 "cd2baa189580996769badeae4cee7139f8206edf6183979fdc70f34f544315b5" => :sierra
13+
sha256 "539441dc92d8af21c95045483e9169616f20a80d1192fe2c6fc8f0789ca697fb" => :el_capitan
14+
sha256 "cd2baa189580996769badeae4cee7139f8206edf6183979fdc70f34f544315b5" => :yosemite
15+
end
16+
17+
def phar_file
18+
"box-#{version}.phar"
19+
end
20+
21+
def phar_wrapper
22+
<<~EOS
23+
#!/usr/bin/env bash
24+
set -- $* && [ "${0##*/} $1" == "box build" ] && PHARRW="-d phar.readonly=Off"
25+
/usr/bin/env php -d allow_url_fopen=On -d detect_unicode=Off $PHARRW #{libexec}/#{@real_phar_file} $*
26+
EOS
27+
end
28+
29+
test do
30+
system "#{bin}/box", "--version"
31+
end
32+
end

Formula/brew-php-switcher.rb

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
class BrewPhpSwitcher < Formula
2+
desc "Switch Apache & CLI configs between PHP versions"
3+
homepage "https://github.com/philcook/php-switcher"
4+
url "https://github.com/philcook/brew-php-switcher/archive/v1.7.tar.gz"
5+
sha256 "06d91314e6694a5406fe3e70ccd0a606fb53cabf8bff09f8983b0036444f0285"
6+
head "https://github.com/philcook/brew-php-switcher.git"
7+
8+
bottle do
9+
cellar :any_skip_relocation
10+
sha256 "3eeb27a0a45004a29622133ad4db075808f21827928222f701b5b21f6f424421" => :high_sierra
11+
sha256 "3eeb27a0a45004a29622133ad4db075808f21827928222f701b5b21f6f424421" => :sierra
12+
sha256 "3eeb27a0a45004a29622133ad4db075808f21827928222f701b5b21f6f424421" => :el_capitan
13+
end
14+
15+
def install
16+
bin.install "phpswitch.sh"
17+
sh = libexec + "brew-php-switcher"
18+
sh.write("#!/usr/bin/env sh\n\nsh #{bin}/phpswitch.sh $*")
19+
chmod 0755, sh
20+
bin.install_symlink sh
21+
end
22+
23+
def caveats; <<~EOS
24+
To run brew php switcher do the following:
25+
"brew-php-switcher 53".
26+
27+
You can select php version 53, 54, 55, 56, 70 or 71.
28+
EOS
29+
end
30+
31+
test do
32+
system "#{bin}/brew-php-switcher"
33+
end
34+
end

Formula/codeception.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
require File.expand_path("../../Abstract/abstract-php-phar", __FILE__)
2+
3+
class Codeception < AbstractPhpPhar
4+
init
5+
desc "Testing Framework designed to work just out of the box"
6+
homepage "http://codeception.com/quickstart"
7+
url "http://codeception.com/releases/2.3.6/codecept.phar"
8+
sha256 "9e31417fba27d9365d04d2dd8eb44468b60024c131279f62ea0b4f7828ca303c"
9+
10+
bottle do
11+
cellar :any_skip_relocation
12+
sha256 "16f32533fa1b78e3b6953c6884aeeb5fa61f7af77ed4ada371aa360414b56283" => :high_sierra
13+
sha256 "16f32533fa1b78e3b6953c6884aeeb5fa61f7af77ed4ada371aa360414b56283" => :sierra
14+
sha256 "16f32533fa1b78e3b6953c6884aeeb5fa61f7af77ed4ada371aa360414b56283" => :el_capitan
15+
end
16+
17+
def phar_file
18+
"codecept.phar"
19+
end
20+
21+
def phar_bin
22+
"codecept"
23+
end
24+
25+
test do
26+
system "#{bin}/codecept", "--version"
27+
end
28+
end

Formula/composer.rb

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
require File.expand_path("../../Abstract/abstract-php-phar", __FILE__)
2+
3+
class Composer < AbstractPhpPhar
4+
desc "Dependency Manager for PHP"
5+
homepage "https://getcomposer.org"
6+
url "https://getcomposer.org/download/1.6.3/composer.phar"
7+
sha256 "52cb7bbbaee720471e3b34c8ae6db53a38f0b759c06078a80080db739e4dcab6"
8+
head "https://getcomposer.org/composer.phar"
9+
10+
bottle do
11+
cellar :any_skip_relocation
12+
rebuild 1
13+
sha256 "cd7d7688f5c54609012418e9f3f6e8e19d66428dbb3ef959f52b0257770571a3" => :high_sierra
14+
sha256 "cd7d7688f5c54609012418e9f3f6e8e19d66428dbb3ef959f52b0257770571a3" => :sierra
15+
sha256 "cd7d7688f5c54609012418e9f3f6e8e19d66428dbb3ef959f52b0257770571a3" => :el_capitan
16+
end
17+
18+
depends_on PharRequirement
19+
20+
test do
21+
system "#{bin}/composer", "--version"
22+
end
23+
24+
# The default behavior is to create a shell script that invokes the phar file.
25+
# Other tools, at least Ansible, expect the composer executable to be a PHP
26+
# script, so override this method. See
27+
# https://github.com/Homebrew/homebrew-php/issues/3590
28+
def phar_wrapper
29+
<<~EOS
30+
#!/usr/bin/env php
31+
<?php
32+
array_shift($argv);
33+
$arg_string = implode(' ', array_map('escapeshellarg', $argv));
34+
$arg_prefix = preg_match('/--(no-)?ansi/', $arg_string) ? '' : '--ansi ';
35+
$arg_string = $arg_prefix . $arg_string;
36+
passthru("/usr/bin/env php -d allow_url_fopen=On -d detect_unicode=Off #{libexec}/#{@real_phar_file} $arg_string", $return_var);
37+
exit($return_var);
38+
EOS
39+
end
40+
41+
def caveats
42+
<<-EOS
43+
composer no longer depends on the homebrew php formulae, since the last couple of macOS releases
44+
contain a php version compatible with composer. If you were previously relying on the composer
45+
formula to install php, please `brew install php71` or other appropriate Homebrew PHP version.
46+
EOS
47+
end
48+
end

Formula/[email protected]

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
require File.expand_path("../../Abstract/abstract-php-phar", __FILE__)
2+
3+
class ComposerAT12 < AbstractPhpPhar
4+
init
5+
desc "Dependency Manager for PHP"
6+
homepage "https://getcomposer.org"
7+
url "https://getcomposer.org/download/1.2.4/composer.phar"
8+
sha256 "3c900579659b79a4e528722e35bd160c86090e370e9cb41cc07c7a22c674c657"
9+
10+
bottle do
11+
cellar :any_skip_relocation
12+
rebuild 1
13+
sha256 "5a1a7f7a7dab7f266b32fbae5a5919305da8a37d03d49c095346f0538d51ca90" => :sierra
14+
sha256 "5a1a7f7a7dab7f266b32fbae5a5919305da8a37d03d49c095346f0538d51ca90" => :el_capitan
15+
sha256 "5a1a7f7a7dab7f266b32fbae5a5919305da8a37d03d49c095346f0538d51ca90" => :yosemite
16+
end
17+
18+
def phar_file
19+
"composer.phar"
20+
end
21+
22+
def phar_bin
23+
"composer-1.2"
24+
end
25+
26+
# The default behavior is to create a shell script that invokes the phar file.
27+
# Other tools, at least Ansible, expect the composer executable to be a PHP
28+
# script, so override this method. See
29+
# https://github.com/Homebrew/homebrew-php/issues/3590
30+
def phar_wrapper
31+
<<~EOS
32+
#!/usr/bin/env php
33+
<?php
34+
array_shift($argv);
35+
$arg_string = implode(' ', array_map('escapeshellarg', $argv));
36+
$arg_prefix = preg_match('/--(no-)?ansi/', $arg_string) ? '' : '--ansi ';
37+
$arg_string = $arg_prefix . $arg_string;
38+
passthru("/usr/bin/env php -d allow_url_fopen=On -d detect_unicode=Off #{libexec}/#{@real_phar_file} $arg_string", $return_var);
39+
exit($return_var);
40+
EOS
41+
end
42+
43+
def caveats
44+
<<~EOS
45+
This installs the older composer version #{version} as '#{phar_bin}'.
46+
EOS
47+
end
48+
49+
test do
50+
system "#{bin}/composer-1.2", "--version"
51+
end
52+
end

0 commit comments

Comments
 (0)