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