}
/* }}} */
-/* {{ proto array Phar::getExtractList()
+/* {{{ proto array Phar::getExtractList()
* Return array of extract list
*/
PHP_METHOD(Phar, getExtractList)
zend_hash_apply_with_arguments(&PHAR_G(phar_plain_map), phar_get_extract_list, 1, return_value);
}
/* }}} */
-static int phar_file_type(HashTable *mimes, char *file, char **mime_type TSRMLS_DC)
+
+static int phar_file_type(HashTable *mimes, char *file, char **mime_type TSRMLS_DC) /* {{{ */
{
char *ext;
phar_mime_type *mime;
}
/* }}} */
-static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char *basename, int basename_len, char *request_uri, int request_uri_len TSRMLS_DC)
+static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char *basename, int basename_len, char *request_uri, int request_uri_len TSRMLS_DC) /* {{{ */
{
zval **_SERVER, **stuff;
char *path_info;
}
}
}
+/* }}} */
-static int phar_file_action(phar_entry_data *phar, char *mime_type, int code, char *entry, int entry_len, char *arch, int arch_len, char *basename, int basename_len, char *ru, int ru_len TSRMLS_DC)
+static int phar_file_action(phar_entry_data *phar, char *mime_type, int code, char *entry, int entry_len, char *arch, int arch_len, char *basename, int basename_len, char *ru, int ru_len TSRMLS_DC) /* {{{ */
{
char *name = NULL, buf[8192], *cwd;
zend_syntax_highlighter_ini syntax_highlighter_ini;
}
return -1;
}
+/* }}} */
-static void phar_do_403(char *entry, int entry_len TSRMLS_DC)
+static void phar_do_403(char *entry, int entry_len TSRMLS_DC) /* {{{ */
{
sapi_header_line ctr = {0};
PHPWRITE(entry, entry_len);
PHPWRITE(" Access Denied</h1>\n </body>\n</html>", sizeof(" Access Denied</h1>\n </body>\n</html>") - 1);
}
+/* }}} */
-static void phar_do_404(char *fname, int fname_len, char *f404, int f404_len, char *entry, int entry_len TSRMLS_DC)
+static void phar_do_404(char *fname, int fname_len, char *f404, int f404_len, char *entry, int entry_len TSRMLS_DC) /* {{{ */
{
int hi;
phar_entry_data *phar;
PHPWRITE(" Not Found</h1>\n </body>\n</html>", sizeof(" Not Found</h1>\n </body>\n</html>") - 1);
}
}
+/* }}} */
-static void phar_postprocess_ru_web(char *fname, int fname_len, char **entry,
- int *entry_len, char **ru, int *ru_len TSRMLS_DC)
+static void phar_postprocess_ru_web(char *fname, int fname_len, char **entry, int *entry_len, char **ru, int *ru_len TSRMLS_DC) /* {{{ */
{
char *e = *entry + 1, *u = NULL, *saveu = NULL;
int e_len = *entry_len - 1, u_len = 0;
e_len -= u_len + 1;
} while (1);
}
+/* }}} */
/* {{{ proto void Phar::webPhar([string alias, [string index, [string f404, [array mimetypes, [callback rewrites]]]]])
* mapPhar for web-based phars. Reads the currently executed file (a phar)
ZVAL_STRINGL(params, entry, entry_len, 1);
zp[0] = ¶ms;
+#if PHP_VERSION_ID < 50300
+ if (FAILURE == zend_fcall_info_init(rewrite, &fci, &fcc, NULL TSRMLS_CC)) {
+#else
if (FAILURE == zend_fcall_info_init(rewrite, 0, &fci, &fcc, NULL, NULL TSRMLS_CC)) {
+#endif
zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "phar error: invalid rewrite callback");
if (free_pathinfo) {
efree(path_info);
#endif
RETURN_LONG(ret);
}
+/* }}} */
/* {{{ proto void Phar::mungServer(array munglist)
* Defines a list of up to 4 $_SERVER variables that should be modified for execution
}
/* }}} */
-/* {{ proto array Phar::createDefaultStub([string indexfile[, string webindexfile]])
+/* {{{ proto array Phar::createDefaultStub([string indexfile[, string webindexfile]])
* Return a stub that can be used to run a phar-based archive without the phar extension
* indexfile is the CLI startup filename, which defaults to "index.php", webindexfile
* is the web startup filename, and also defaults to "index.php"
}
RETURN_STRINGL(index, stub_len, 0);
}
+/* }}} */
/* {{{ proto mixed Phar::mapPhar([string alias, [int dataoffset]])
* Reads the currently executed file (a phar) and registers its manifest */
return; \
}
-static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC)
+static int phar_build(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */
{
zval **value;
zend_uchar key_type;
phar_entry_delref(data TSRMLS_CC);
return ZEND_HASH_APPLY_KEEP;
}
+/* }}} */
/* {{{ proto array Phar::buildFromIterator(Iterator iter[, string base_directory])
* Construct a phar archive from an iterator. The iterator must return a series of strings
}
return ZEND_HASH_APPLY_KEEP;
}
+/* }}} */
static void phar_convert_to_other(phar_archive_data *source, int convert, php_uint32 flags TSRMLS_DC) /* {{{ */
{
source->signature = 0;
}
}
+/* }}} */
/* {{{ proto bool Phar::convertToTar([int compression])
* Convert the phar archive to the tar file format. The optional parameter can be one of Phar::GZ
}
/* }}} */
-
/* {{{ proto bool Phar::convertToZip()
* Convert the phar archive to the zip file format
*/
}
/* }}} */
-
/* {{{ proto bool Phar::convertToPhar([int compression])
* Convert the phar archive to the phar file format. The optional parameter can be one of Phar::GZ
* or Phar::BZ2 to specify whole-file compression
RETURN_FALSE;
}
+/* }}} */
/* {{{ proto string Phar::getVersion()
* Return version info of Phar archive
RETURN_TRUE;
}
+/* }}} */
/* {{{ proto int Phar::offsetExists(string offset)
* determines whether a file exists in the phar