Lines Matching refs:phar
74 …if (NULL != (link_entry = zend_hash_str_find_ptr(&(entry->phar->manifest), entry->link, strlen(ent… in phar_get_link_source()
75 NULL != (link_entry = zend_hash_str_find_ptr(&(entry->phar->manifest), link, strlen(link)))) { in phar_get_link_source()
103 phar_open_archive_fp(entry->phar); in phar_get_efp()
170 int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *path, int pat… in phar_mount_entry() argument
188 entry.phar = phar; in phar_mount_entry()
223 …if (NULL == zend_hash_str_add_ptr(&phar->mounted_dirs, entry.filename, path_len, entry.filename)) { in phar_mount_entry()
236 …if (NULL != zend_hash_str_add_mem(&phar->manifest, entry.filename, path_len, (void*)&entry, sizeof… in phar_mount_entry()
251 phar_archive_data *phar; in phar_find_in_include_path() local
256 pphar = &phar; in phar_find_in_include_path()
269 phar = PHAR_G(last_phar); in phar_find_in_include_path()
282 if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) { in phar_find_in_include_path()
288 *pphar = phar; in phar_find_in_include_path()
295 if (zend_hash_str_exists(&(phar->manifest), test + 1, try_len - 1)) { in phar_find_in_include_path()
302 if (zend_hash_str_exists(&(phar->manifest), test, try_len)) { in phar_find_in_include_path()
347 phar_archive_data *phar; in phar_get_entry_data() local
364 if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error)) { in phar_get_entry_data()
368 if (for_write && PHAR_G(readonly) && !phar->is_data) { in phar_get_entry_data()
383 …if ((entry = phar_get_entry_info_dir(phar, path, path_len, allow_dir, for_create && !PHAR_G(readon… in phar_get_entry_data()
384 if (for_create && (!PHAR_G(readonly) || phar->is_data)) { in phar_get_entry_data()
390 …if ((entry = phar_get_entry_info(phar, path, path_len, for_create && !PHAR_G(readonly) && !phar->i… in phar_get_entry_data()
391 if (for_create && (!PHAR_G(readonly) || phar->is_data)) { in phar_get_entry_data()
398 if (for_write && phar->is_persistent) { in phar_get_entry_data()
399 if (FAILURE == phar_copy_on_write(&phar)) { in phar_get_entry_data()
434 (*ret)->phar = phar; in phar_get_entry_data()
440 if (!phar->is_persistent) { in phar_get_entry_data()
441 ++(entry->phar->refcount); in phar_get_entry_data()
450 if (FAILURE == phar_create_writeable_entry(phar, entry, error)) { in phar_get_entry_data()
465 if (FAILURE == phar_create_writeable_entry(phar, entry, error)) { in phar_get_entry_data()
482 (*ret)->phar = phar; in phar_get_entry_data()
499 if (!phar->is_persistent) { in phar_get_entry_data()
501 ++(entry->phar->refcount); in phar_get_entry_data()
513 phar_archive_data *phar; in phar_get_or_create_entry_data() local
525 if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error)) { in phar_get_or_create_entry_data()
542 if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) { in phar_get_or_create_entry_data()
579 phar_add_virtual_dirs(phar, path, path_len); in phar_get_or_create_entry_data()
583 etemp.phar = phar; in phar_get_or_create_entry_data()
585 etemp.is_zip = phar->is_zip; in phar_get_or_create_entry_data()
587 if (phar->is_tar) { in phar_get_or_create_entry_data()
588 etemp.is_tar = phar->is_tar; in phar_get_or_create_entry_data()
592 …if (NULL == (entry = zend_hash_str_add_mem(&phar->manifest, etemp.filename, path_len, (void*)&etem… in phar_get_or_create_entry_data()
595 …rror, 0, "phar error: unable to add new entry \"%s\" to phar \"%s\"", etemp.filename, phar->fname); in phar_get_or_create_entry_data()
609 ++(phar->refcount); in phar_get_or_create_entry_data()
610 ret->phar = phar; in phar_get_or_create_entry_data()
623 int phar_open_archive_fp(phar_archive_data *phar) /* {{{ */ in phar_open_archive_fp() argument
625 if (phar_get_pharfp(phar)) { in phar_open_archive_fp()
629 if (php_check_open_basedir(phar->fname)) { in phar_open_archive_fp()
633 …phar_set_pharfp(phar, php_stream_open_wrapper(phar->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, NU… in phar_open_archive_fp()
635 if (!phar_get_pharfp(phar)) { in phar_open_archive_fp()
677 …e \"%s\" to \"%s\" in phar archive \"%s\"", source->filename, dest->filename, source->phar->fname); in phar_copy_entry_fp()
691 phar_archive_data *phar = entry->phar; in phar_open_entry_fp() local
720 if (!phar_get_pharfp(phar)) { in phar_open_entry_fp()
721 if (FAILURE == phar_open_archive_fp(phar)) { in phar_open_entry_fp()
722 spprintf(error, 4096, "phar error: Cannot open phar archive \"%s\" for reading", phar->fname); in phar_open_entry_fp()
729 dummy.phar = phar; in phar_open_entry_fp()
731 dummy.fp = phar_get_pharfp(phar); in phar_open_entry_fp()
741 …t open temporary file for decompressing phar archive \"%s\" file \"%s\"", phar->fname, entry->file… in phar_open_entry_fp()
747 dummy.phar = phar; in phar_open_entry_fp()
749 dummy.fp = phar_get_pharfp(phar); in phar_open_entry_fp()
763 …d phar \"%s\" (cannot create %s filter while decompressing file \"%s\")", phar->fname, phar_decomp… in phar_open_entry_fp()
776 …nal corruption of phar \"%s\" (actual filesize mismatch on file \"%s\")", phar->fname, entry->file… in phar_open_entry_fp()
787 …nal corruption of phar \"%s\" (actual filesize mismatch on file \"%s\")", phar->fname, entry->file… in phar_open_entry_fp()
804 int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error) /* {… in phar_create_writeable_entry() argument
812 phar->is_modified = 1; in phar_create_writeable_entry()
845 phar->is_modified = 1; in phar_create_writeable_entry()
884 …ile \"%s\" contents in phar archive \"%s\" for write access", entry->filename, entry->phar->fname); in phar_separate_entry_fp()
906 phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error) /* {… in phar_open_jit() argument
916 …6, "phar error: cannot seek to start of file \"%s\" in phar \"%s\"", entry->filename, phar->fname); in phar_open_jit()
935 int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len) /* {{{ */ in phar_free_alias() argument
937 if (phar->refcount || phar->is_persistent) { in phar_free_alias()
942 if (zend_hash_str_del(&(PHAR_G(phar_fname_map)), phar->fname, phar->fname_len) != SUCCESS) { in phar_free_alias()
1202 phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **erro… in phar_get_entry_info() argument
1204 return phar_get_entry_info_dir(phar, path, path_len, 0, error, security); in phar_get_entry_info()
1212 phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char di… in phar_get_entry_info_dir() argument
1249 if (!phar->manifest.u.flags) { in phar_get_entry_info_dir()
1260 if (NULL != (entry = zend_hash_str_find_ptr(&phar->manifest, path, path_len))) { in phar_get_entry_info_dir()
1282 if (zend_hash_str_exists(&phar->virtual_dirs, path, path_len)) { in phar_get_entry_info_dir()
1289 entry->phar = phar; in phar_get_entry_info_dir()
1294 if (phar->mounted_dirs.u.flags && zend_hash_num_elements(&phar->mounted_dirs)) { in phar_get_entry_info_dir()
1297 ZEND_HASH_FOREACH_STR_KEY(&phar->mounted_dirs, str_key) { in phar_get_entry_info_dir()
1305 if (NULL == (entry = zend_hash_find_ptr(&phar->manifest, str_key))) { in phar_get_entry_info_dir()
1344 if (SUCCESS != phar_mount_entry(phar, test, test_len, path, path_len)) { in phar_get_entry_info_dir()
1354 if (NULL == (entry = zend_hash_str_find_ptr(&phar->manifest, path, path_len))) { in phar_get_entry_info_dir()
1780 int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature… in phar_create_signature() argument
1787 if (phar->signature) { in phar_create_signature()
1788 efree(phar->signature); in phar_create_signature()
1789 phar->signature = NULL; in phar_create_signature()
1792 switch(phar->sig_flags) { in phar_create_signature()
1828 spprintf(error, 0, "unable to write to phar \"%s\" with requested hash type", phar->fname); in phar_create_signature()
1845 …spprintf(error, 0, "unable to write to phar \"%s\" with requested openssl signature", phar->fname); in phar_create_signature()
1868 spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname); in phar_create_signature()
1877 spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname); in phar_create_signature()
1886 … spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname); in phar_create_signature()
1900 … spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname); in phar_create_signature()
1910 phar->sig_flags = PHAR_SIG_SHA1; in phar_create_signature()
1943 phar->sig_len = phar_hex_str((const char *)*signature, *signature_length, &phar->signature); in phar_create_signature()
1948 void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len) /* {{{ */ in phar_add_virtual_dirs() argument
1954 …if (!filename_len || NULL == zend_hash_str_add_empty_element(&phar->virtual_dirs, filename, filena… in phar_add_virtual_dirs()
1965 entry->phar = (phar_archive_data *)argument; in phar_update_cached_entry()
2004 phar_archive_data *phar; in phar_copy_cached_phar() local
2009 phar = (phar_archive_data *) emalloc(sizeof(phar_archive_data)); in phar_copy_cached_phar()
2010 *phar = **pphar; in phar_copy_cached_phar()
2011 phar->is_persistent = 0; in phar_copy_cached_phar()
2012 fname = phar->fname; in phar_copy_cached_phar()
2013 phar->fname = estrndup(phar->fname, phar->fname_len); in phar_copy_cached_phar()
2014 phar->ext = phar->fname + (phar->ext - fname); in phar_copy_cached_phar()
2016 if (phar->alias) { in phar_copy_cached_phar()
2017 phar->alias = estrndup(phar->alias, phar->alias_len); in phar_copy_cached_phar()
2020 if (phar->signature) { in phar_copy_cached_phar()
2021 phar->signature = estrdup(phar->signature); in phar_copy_cached_phar()
2024 if (Z_TYPE(phar->metadata) != IS_UNDEF) { in phar_copy_cached_phar()
2026 if (phar->metadata_len) { in phar_copy_cached_phar()
2027 char *buf = estrndup((char *) Z_PTR(phar->metadata), phar->metadata_len); in phar_copy_cached_phar()
2028 phar_parse_metadata(&buf, &phar->metadata, phar->metadata_len); in phar_copy_cached_phar()
2031 zval_copy_ctor(&phar->metadata); in phar_copy_cached_phar()
2038 zend_hash_apply_with_argument(&newmanifest, phar_update_cached_entry, (void *)phar); in phar_copy_cached_phar()
2039 phar->manifest = newmanifest; in phar_copy_cached_phar()
2040 zend_hash_init(&phar->mounted_dirs, sizeof(char *), in phar_copy_cached_phar()
2042 zend_hash_init(&phar->virtual_dirs, sizeof(char *), in phar_copy_cached_phar()
2044 zend_hash_copy(&phar->virtual_dirs, &(*pphar)->virtual_dirs, NULL); in phar_copy_cached_phar()
2045 *pphar = phar; in phar_copy_cached_phar()
2049 …if (objphar->archive->fname_len == phar->fname_len && !memcmp(objphar->archive->fname, phar->fname… in phar_copy_cached_phar()
2050 objphar->archive = phar; in phar_copy_cached_phar()