add link to pharext download of the latest release
[pharext/pharext] / README.md
1 # pharext
2
3 Distribute your PHP extension as self-installable phar executable
4
5 ## About
6
7 ### Disclaimer
8
9 You don't need this package to install any `*.ext.phar` extension packages,
10 just run them with php:
11
12 $ ./pecl_http-2.4.0dev.ext.phar
13
14 Or, if the execute permission bit got lost somehow:
15
16 $ php pecl_http-2.4.0dev.ext.phar
17
18 Command help:
19
20 $ ./pecl_http-2.4.0dev.ext.phar -h
21
22 Yields:
23
24 Usage:
25
26 $ ./pecl_http-2.4.0dev.ext.phar [-h|-v|-q|-s] [-p|-n|-c <arg>]
27
28 -h|--help Display help
29 -v|--verbose More output
30 -q|--quiet Less output
31 -p|--prefix <arg> PHP installation directory [/usr]
32 -n|--common-name <arg> PHP common program name, e.g. php5 [php]
33 -c|--configure <arg> Additional extension configure flags
34 -s|--sudo [<arg>] Installation might need increased privileges [sudo -S %s]
35
36 If your installation destination needs escalated permissions, have a look at the `--sudo` option:
37
38 $ ./pecl_http-2.4.0dev.ext.phar --sudo
39 Running phpize ... OK
40 Running configure ... OK
41 Running make ... OK
42 Running install ... Password:············
43 Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20121212/
44 Installing header files: /usr/include/php/
45 OK
46
47 ### Prerequisites
48
49 The usual tools you need to build a PHP extension:
50 * php, phpize and php-config
51 * make, cc and autotools
52
53 A network connection is not needed.
54
55 ### Not implemented
56
57 * Dependencies
58 * Package description files
59
60 ## Download for extension maintainers
61
62 Download the pharext binary of the [latest release](https://github.com/m6w6/pharext/releases/latest).
63
64 ## Installation for extension maintainers
65
66 $ composer require --dev m6w6/pharext
67
68 ### Prerequisites:
69
70 * make
71 * php + phar
72
73 ## Usage
74
75 $ ./vendor/bin/pharext --pecl --source ../pecl_http.git
76
77 Yields:
78
79 Creating phar ./pecl_http-2.4.0dev.ext.phar.54f6e987ae00f.tmp ... OK
80 Finalizing ./pecl_http-2.4.0dev.ext.phar ... OK
81
82 Note that the PECL source can infer package name and release version from the package.xml.
83
84 Another example using `git ls-files`:
85
86 $ ./vendor/bin/pharext -v -g -s ../raphf.git --name raphf --release 1.0.5
87
88 Yields:
89
90 Creating phar ./raphf-1.0.5.ext.phar.54f6ebd71f13b.tmp ...
91 Packaging .gitignore
92 Packaging CREDITS
93 Packaging Doxyfile
94 Packaging LICENSE
95 Packaging TODO
96 Packaging config.m4
97 Packaging config.w32
98 Packaging package.xml
99 Packaging php_raphf.c
100 Packaging php_raphf.h
101 Packaging raphf.png
102 Packaging tests/http001.phpt
103 Packaging tests/http002.phpt
104 Packaging tests/http003.phpt
105 Packaging tests/http004.phpt
106 OK
107 Finalizing ./raphf-1.0.5.ext.phar ... OK
108
109 Command help:
110
111 $ ./vendor/bin/pharext --help
112
113 Yields:
114
115 Usage:
116
117 $ ./vendor/bin/pharext [-h|-v|-q|-g|-p] -s <arg> -n <arg> -r <arg> [-d <arg>]
118
119 -h|--help Display this help
120 -v|--verbose More output
121 -q|--quiet Less output
122 -s|--source <arg> Extension source directory (REQUIRED)
123 -g|--git Use `git ls-files` instead of the standard ignore filter
124 -p|--pecl Use PECL package.xml instead of the standard ignore filter
125 -d|--dest <arg> Destination directory [.]
126 -n|--name <arg> Extension name (REQUIRED)
127 -r|--release <arg> Extension release version (REQUIRED)
128
129 ## Rebuilding
130
131 $ make -C vendor/m6w6/pharext