phar.1.in 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. .TH PHAR 1 "2021" "The PHP Group" "User Commands"
  2. .SH NAME
  3. phar, phar.phar \- PHAR (PHP archive) command line tool
  4. .SH SYNOPSIS
  5. .B phar
  6. <command> [options] ...
  7. .LP
  8. .SH DESCRIPTION
  9. The \fBPHAR\fP file format provides a way to put entire PHP applications into a single
  10. file called a "phar" (PHP Archive) for easy distribution and installation.
  11. .P
  12. With the \fBphar\fP command you can create, update or extract PHP archives.
  13. .P
  14. Commands:
  15. add compress delete extract help help-list info list meta-del
  16. meta-get meta-set pack sign stub-get stub-set tree version
  17. .SH add command
  18. Add entries to a PHAR package.
  19. .P
  20. Required arguments:
  21. .TP 15
  22. .PD
  23. .B -f \fIfile\fP
  24. Specifies the phar \fIfile\fP to work on.
  25. .TP
  26. .PD
  27. .B ...
  28. Any number of input files and directories. If -i is in
  29. use then ONLY files and matching the given regular
  30. expression are being packed. If -x is given then files
  31. matching that regular expression are NOT being packed.
  32. .P
  33. Optional arguments:
  34. .TP 15
  35. .PD
  36. .B \-a \fIalias\fP
  37. Provide an \fIalias\fP name for the phar file.
  38. .TP
  39. .PD
  40. .B \-c \fIalgo\fP
  41. Compression algorithm (see
  42. .SM
  43. .B COMPRESSION
  44. )
  45. .TP
  46. .PD
  47. .B \-i \fIregex\fP
  48. Specifies a regular expression for input files.
  49. .TP
  50. .PD
  51. .B \-l \fIlevel\fP
  52. Number of preceding subdirectories to strip from file entries
  53. .TP
  54. .PD
  55. .B \-x \fIregex\fP
  56. Regular expression for input files to exclude.
  57. .SH compress command
  58. Compress or uncompress all files or a selected entry.
  59. .P
  60. Required arguments:
  61. .TP 15
  62. .PD
  63. .B \-c \fIalgo\fP
  64. Compression algorithm (see
  65. .SM
  66. .B COMPRESSION
  67. )
  68. .TP
  69. .PD
  70. .B -f \fIfile\fP
  71. Specifies the phar \fIfile\fP to work on.
  72. .P
  73. Optional arguments:
  74. .TP 15
  75. .PD
  76. .B -e \fIentry\fP
  77. Name of \fIentry\fP to work on (must include PHAR internal
  78. directory name if any).
  79. .SH delete command
  80. Delete entry from a PHAR archive
  81. .P
  82. Required arguments:
  83. .TP 15
  84. .PD
  85. .B \-e \fIentry\fP
  86. Name of \fIentry\fP to work on (must include PHAR internal
  87. directory name if any).
  88. .TP
  89. .PD
  90. .B -f \fIfile\fP
  91. Specifies the phar \fIfile\fP to work on.
  92. .SH extract command
  93. Extract a PHAR package to a directory.
  94. .P
  95. Required arguments:
  96. .TP 15
  97. .PD
  98. .B -f \fIfile\fP
  99. Specifies the phar \fIfile\fP to work on.
  100. .P
  101. Optional arguments:
  102. .TP 15
  103. .PD
  104. .B -i \fIregex\fP
  105. Specifies a regular expression for input files.
  106. .TP
  107. .PD
  108. .B -x \fIregex\fP
  109. Regular expression for input files to exclude.
  110. .TP
  111. .PD
  112. .B ...
  113. Directory to extract to (defaults to '.').
  114. .SH help command
  115. This help or help for a selected command.
  116. .P
  117. Optional arguments:
  118. .TP 15
  119. .PD
  120. .B ...
  121. Optional command to retrieve help for.
  122. .SH help-list command
  123. Lists available commands.
  124. .SH info command
  125. Get information about a PHAR package.
  126. .P
  127. By using -k it is possible to return a single value.
  128. .P
  129. Required arguments:
  130. .TP 15
  131. .PD
  132. .B -f \fIfile\fP
  133. Specifies the phar \fIfile\fP to work on.
  134. .P
  135. Optional arguments:
  136. .TP 15
  137. .PD
  138. .B -k \fIindex\fP
  139. Subscription \fIindex\fP to work on.
  140. .SH list command
  141. List contents of a PHAR archive.
  142. .P
  143. Required arguments:
  144. .TP 15
  145. .PD
  146. .B -f \fIfile\fP
  147. Specifies the phar \fIfile\fP to work on.
  148. .P
  149. Optional arguments:
  150. .TP 15
  151. .PD
  152. .B -i \fIregex\fP
  153. Specifies a regular expression for input files.
  154. .TP
  155. .PD
  156. .B -x \fIregex\fP
  157. Regular expression for input files to exclude.
  158. .SH meta-del command
  159. Delete meta information of a PHAR entry or a PHAR package.
  160. .P
  161. If -k is given then the metadata is expected to be an array and the
  162. given index is being deleted.
  163. .P
  164. If something was deleted the return value is 0 otherwise it is 1.
  165. .P
  166. Required arguments:
  167. .TP 15
  168. .PD
  169. .B -f \fIfile\fP
  170. Specifies the phar \fIfile\fP to work on.
  171. .P
  172. Optional arguments:
  173. .TP 15
  174. .PD
  175. .B -e \fIentry\fP
  176. Name of \fIentry\fP to work on (must include PHAR internal
  177. directory name if any).
  178. .TP
  179. .PD
  180. .B -k \fIindex\fP
  181. Subscription \fIindex\fP to work on.
  182. .SH meta-get command
  183. Get meta information of a PHAR entry or a PHAR package in serialized from. If
  184. no output file is specified for meta data then stdout is being used.
  185. You can also specify a particular index using -k. In that case the
  186. metadata is expected to be an array and the value of the given index
  187. is returned using echo rather than using serialize. If that index does
  188. not exist or no meta data is present then the return value is 1.
  189. .P
  190. Required arguments:
  191. .TP 15
  192. .PD
  193. .B -f \fIfile\fP
  194. Specifies the phar \fIfile\fP to work on.
  195. .P
  196. Optional arguments:
  197. .TP 15
  198. .PD
  199. .B -e \fIentry\fP
  200. Name of \fIentry\fP to work on (must include PHAR internal
  201. directory name if any).
  202. .TP
  203. .PD
  204. .B -k \fIindex\fP
  205. Subscription \fIindex\fP to work on.
  206. .SH meta-set command
  207. Set meta data of a PHAR entry or a PHAR package using serialized input. If no
  208. input file is specified for meta data then stdin is being used. You can
  209. also specify a particular index using -k. In that case the metadata is
  210. expected to be an array and the value of the given index is being set.
  211. If the metadata is not present or empty a new array will be created.
  212. If the metadata is present and a flat value then the return value is
  213. 1. Also using -k the input is been taken directly rather then being
  214. serialized.
  215. .P
  216. Required arguments:
  217. .TP 15
  218. .PD
  219. .B -f \fIfile\fP
  220. Specifies the phar \fIfile\fP to work on.
  221. .TP
  222. .PD
  223. .B -m \fImeta\fP
  224. Meta data to store with entry (serialized php data).
  225. .P
  226. Optional arguments:
  227. .TP 15
  228. .PD
  229. .B -e \fIentry\fP
  230. Name of \fIentry\fP to work on (must include PHAR internal
  231. directory name if any).
  232. .TP
  233. .PD
  234. .B -k \fIindex\fP
  235. Subscription \fIindex\fP to work on.
  236. .SH pack command
  237. Pack files into a PHAR archive.
  238. .P
  239. When using -s <stub>, then the stub file is being excluded from the
  240. list of input files/dirs.To create an archive that contains PEAR class
  241. PHP_Archive then point -p argument to PHP/Archive.php.
  242. .P
  243. Required arguments:
  244. .TP 15
  245. .PD
  246. .B -f \fIfile\fP
  247. Specifies the phar \fIfile\fP to work on.
  248. .TP
  249. .PD
  250. .B ...
  251. Any number of input files and directories. If -i is in
  252. use then ONLY files and matching the given regular
  253. expression are being packed. If -x is given then files
  254. matching that regular expression are NOT being packed.
  255. .P
  256. Optional arguments:
  257. .TP 15
  258. .PD
  259. .B \-a \fIalias\fP
  260. Provide an \fIalias\fP name for the phar file.
  261. .TP
  262. .PD
  263. .B \-b \fIbang\fP
  264. Hash-bang line to start the archive (e.g. #!/usr/bin/php).
  265. The hash mark itself '#!' and the newline character are optional.
  266. .TP
  267. .PD
  268. .B \-c \fIalgo\fP
  269. Compression algorithm (see
  270. .SM
  271. .B COMPRESSION
  272. )
  273. .TP
  274. .PD
  275. .B \-h \fIhash\fP
  276. Selects the \fIhash\fP algorithm (see
  277. .SM
  278. .B HASH
  279. )
  280. .TP
  281. .PD
  282. .B \-i \fIregex\fP
  283. Specifies a regular expression for input files.
  284. .TP
  285. .PD
  286. .B \-l \fIlevel\fP
  287. Number of preceding subdirectories to strip from file entries
  288. .TP
  289. .PD
  290. .B \-p \fIloader\fP
  291. Location of PHP_Archive class file (pear list-files
  292. PHP_Archive).You can use '0' or '1' to locate it
  293. automatically using the mentioned pear command. When
  294. using '0' the command does not error out when the class
  295. file cannot be located. This switch also adds some code
  296. around the stub so that class PHP_Archive gets
  297. registered as phar:// stream wrapper if necessary. And
  298. finally this switch will add the file phar.inc from
  299. this package and load it to ensure class Phar is
  300. present.
  301. .TP
  302. .PD
  303. .B \-s \fIstub\fP
  304. Select the \fIstub\fP file.
  305. .TP
  306. .PD
  307. .B \-x \fIregex\fP
  308. Regular expression for input files to exclude.
  309. .TP
  310. .PD
  311. .B \-y \fIkey\fP
  312. Private \fIkey\fP for OpenSSL signing.
  313. .SH sign command
  314. Set signature hash algorithm.
  315. .P
  316. Required arguments:
  317. .TP 15
  318. .PD
  319. .B -f \fIfile\fP
  320. Specifies the phar \fIfile\fP to work on.
  321. .TP
  322. .PD
  323. .B \-h \fIhash\fP
  324. Selects the \fIhash\fP algorithm (see
  325. .SM
  326. .B HASH
  327. )
  328. .P
  329. Optional arguments:
  330. .TP 15
  331. .PD
  332. .B \-y \fIkey\fP
  333. Private \fIkey\fP for OpenSSL signing.
  334. .SH stub-get command
  335. Get the stub of a PHAR file. If no output file is specified as stub then stdout
  336. is being used.
  337. .P
  338. Required arguments:
  339. .TP 15
  340. .PD
  341. .B -f \fIfile\fP
  342. Specifies the phar \fIfile\fP to work on.
  343. .P
  344. Optional arguments:
  345. .TP 15
  346. .PD
  347. .B \-s \fIstub\fP
  348. Select the \fIstub\fP file.
  349. .SH stub-set command
  350. Set the stub of a PHAR file. If no input file is specified as stub then stdin
  351. is being used.
  352. .P
  353. Required arguments:
  354. .TP 15
  355. .PD
  356. .B -f \fIfile\fP
  357. Specifies the phar \fIfile\fP to work on.
  358. .P
  359. Optional arguments:
  360. .TP 15
  361. .PD
  362. .B \-b \fIbang\fP
  363. Hash-bang line to start the archive (e.g. #!/usr/bin/php).
  364. The hash mark itself '#!' and the newline character are optional.
  365. .TP
  366. .PD
  367. .B \-p \fIloader\fP
  368. Location of PHP_Archive class file (pear list-files
  369. PHP_Archive).You can use '0' or '1' to locate it
  370. automatically using the mentioned pear command. When
  371. using '0' the command does not error out when the class
  372. file cannot be located. This switch also adds some code
  373. around the stub so that class PHP_Archive gets
  374. registered as phar:// stream wrapper if necessary. And
  375. finally this switch will add the file phar.inc from
  376. this package and load it to ensure class Phar is
  377. present.
  378. .TP
  379. .PD
  380. .B \-s \fIstub\fP
  381. Select the \fIstub\fP file.
  382. .SH tree command
  383. Get a directory tree for a PHAR archive.
  384. .P
  385. Required arguments:
  386. .TP 15
  387. .PD
  388. .B -f \fIfile\fP
  389. Specifies the phar \fIfile\fP to work on.
  390. .P
  391. Optional arguments:
  392. .TP 15
  393. .PD
  394. .B \-i \fIregex\fP
  395. Specifies a regular expression for input files.
  396. .TP
  397. .PD
  398. .B \-x \fIregex\fP
  399. Regular expression for input files to exclude.
  400. .SH version command
  401. Get information about the PHAR environment and the tool version.
  402. .SH COMPRESSION
  403. Algorithms:
  404. .TP 15
  405. .PD
  406. .B 0
  407. No compression
  408. .TP
  409. .PD
  410. .B none
  411. No compression
  412. .TP
  413. .PD
  414. .B auto
  415. Automatically select compression algorithm
  416. .TP
  417. .PD
  418. .B gz
  419. GZip compression
  420. .TP
  421. .PD
  422. .B gzip
  423. GZip compression
  424. .TP
  425. .PD
  426. .B bz2
  427. BZip2 compression
  428. .TP
  429. .PD
  430. .B bzip2
  431. BZip2 compression
  432. .SH HASH
  433. Algorithms:
  434. .TP 15
  435. .PD
  436. .TP
  437. .PD
  438. .B md5
  439. MD5
  440. .TP
  441. .PD
  442. .B sha1
  443. SHA1
  444. .TP
  445. .PD
  446. .B sha256
  447. SHA256
  448. .TP
  449. .PD
  450. .B sha512
  451. SHA512
  452. .TP
  453. .PD
  454. .B openssl
  455. OpenSSL using SHA-1
  456. .TP
  457. .PD
  458. .B openssl_sha256
  459. OpenSSL using SHA-256
  460. .TP
  461. .PD
  462. .B openssl_sha512
  463. OpenSSL using SHA-512
  464. .SH SEE ALSO
  465. For a more or less complete description of PHAR look here:
  466. .PD 0
  467. .P
  468. .B http://php.net/phar
  469. .PD 1
  470. .P
  471. .SH BUGS
  472. You can view the list of known bugs or report any new bug you
  473. found at:
  474. .PD 0
  475. .P
  476. .B http://bugs.php.net
  477. .PD 1
  478. .SH AUTHORS
  479. The PHP Group: Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski.
  480. .P
  481. Work for the PHP archive was done by Gregory Beaver, Marcus Boerger.
  482. .P
  483. A List of active developers can be found here:
  484. .PD 0
  485. .P
  486. .B http://www.php.net/credits.php
  487. .PD 1
  488. .P
  489. And last but not least PHP was developed with the help of a huge amount of
  490. contributors all around the world.
  491. .SH VERSION INFORMATION
  492. This manpage describes \fBphar\fP, version @PHP_VERSION@.
  493. .SH COPYRIGHT
  494. Copyright \(co The PHP Group
  495. .LP
  496. This source file is subject to version 3.01 of the PHP license,
  497. that is bundled with this package in the file LICENSE, and is
  498. available through the world-wide-web at the following url:
  499. .PD 0
  500. .P
  501. .B https://www.php.net/license/3_01.txt
  502. .PD 1
  503. .P
  504. If you did not receive a copy of the PHP license and are unable to
  505. obtain it through the world-wide-web, please send a note to
  506. .B license@php.net
  507. so we can mail you a copy immediately.