init
[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 A network connection is not needed.
53
54 ### Not implemented
55
56 * Dependencies
57 * Package description files
58
59 ## Installation for extension maintainers
60
61 $ composer require m6w6/pharext
62
63 ### Prerequisites:
64
65 * make
66 * php + phar
67
68 ## Usage
69
70 $ ./bin/pharext --pecl --source ../pecl_http.git
71
72 Yields:
73
74 Creating phar ./pecl_http-2.4.0dev.ext.phar.54f6e987ae00f.tmp ... OK
75 Finalizing ./pecl_http-2.4.0dev.ext.phar ... OK
76
77 Note that the PECL source can infer package name and release version from the package.xml.
78
79 Another example using `git ls-files`:
80
81 $ ./bin/pharext -v -g -s ../raphf.git --name raphf --release 1.0.5
82
83 Yields:
84
85 Creating phar ./raphf-1.0.5.ext.phar.54f6ebd71f13b.tmp ...
86 Packaging .gitignore
87 Packaging CREDITS
88 Packaging Doxyfile
89 Packaging LICENSE
90 Packaging TODO
91 Packaging config.m4
92 Packaging config.w32
93 Packaging package.xml
94 Packaging php_raphf.c
95 Packaging php_raphf.h
96 Packaging raphf.png
97 Packaging tests/http001.phpt
98 Packaging tests/http002.phpt
99 Packaging tests/http003.phpt
100 Packaging tests/http004.phpt
101 OK
102 Finalizing ./raphf-1.0.5.ext.phar ... OK
103
104 Command help:
105
106 $ ./bin/pharext --help
107
108 Yields:
109
110 Usage:
111
112 $ ./bin/pharext [-h|-v|-q|-g|-p] -s <arg> -n <arg> -r <arg> [-d <arg>]
113
114 -h|--help Display this help
115 -v|--verbose More output
116 -q|--quiet Less output
117 -s|--source <arg> Extension source directory (REQUIRED)
118 -g|--git Use `git ls-files` instead of the standard ignore filter
119 -p|--pecl Use PECL package.xml instead of the standard ignore filter
120 -d|--dest <arg> Destination directory [.]
121 -n|--name <arg> Extension name (REQUIRED)
122 -r|--release <arg> Extension release version (REQUIRED)
123