Lines Matching refs:archive
1124 if (phar_obj->archive) { in PHP_METHOD()
1198 phar_obj->archive = phar_data; in PHP_METHOD()
1217 phar_obj->archive->is_data = is_data; in PHP_METHOD()
1220 …add_ptr(&PHAR_G(phar_persist_map), (const char *) phar_obj->archive, sizeof(phar_obj->archive), ph… in PHP_METHOD()
1342 if (!phar_obj->archive) { \
1358 if (phar_obj->archive && phar_obj->archive->is_persistent) { in PHP_METHOD()
1359 …sh_str_del(&PHAR_G(phar_persist_map), (const char *) phar_obj->archive, sizeof(phar_obj->archive)); in PHP_METHOD()
1618 …if (!(data = phar_get_or_create_entry_data(phar_obj->archive->fname, phar_obj->archive->fname_len,… in phar_build()
1708 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
1716 …thodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname); in PHP_METHOD()
1734 …thodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname); in PHP_METHOD()
1755 …adMethodCallException, 0, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname); in PHP_METHOD()
1773 …phar_ce_PharException, 0, "phar \"%s\" unable to create temporary file", phar_obj->archive->fname); in PHP_METHOD()
1777 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
1783 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
1794 phar_obj->archive->ufp = pass.fp; in PHP_METHOD()
1795 phar_flush(phar_obj->archive, 0, 0, 0, &error); in PHP_METHOD()
1834 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
1840 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
1841 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
1854 …har_ce_PharException, 0, "phar \"%s\": unable to create temporary file", phar_obj->archive->fname); in PHP_METHOD()
1859 phar_obj->archive->ufp = pass.fp; in PHP_METHOD()
1860 phar_flush(phar_obj->archive, 0, 0, 0, &error); in PHP_METHOD()
1883 RETURN_LONG(zend_hash_num_elements(&phar_obj->archive->manifest)); in PHP_METHOD()
1902 RETURN_BOOL(phar_obj->archive->is_tar); in PHP_METHOD()
1904 RETURN_BOOL(phar_obj->archive->is_zip); in PHP_METHOD()
1906 RETURN_BOOL(!phar_obj->archive->is_tar && !phar_obj->archive->is_zip); in PHP_METHOD()
2351 if (phar_obj->archive->is_tar) { in PHP_METHOD()
2353 } else if (phar_obj->archive->is_zip) { in PHP_METHOD()
2370 flags = phar_obj->archive->flags & PHAR_FILE_COMPRESSION_MASK; in PHP_METHOD()
2374 flags = phar_obj->archive->flags & PHAR_FILE_COMPRESSION_MASK; in PHP_METHOD()
2416 is_data = phar_obj->archive->is_data; in PHP_METHOD()
2417 phar_obj->archive->is_data = 0; in PHP_METHOD()
2418 ret = phar_convert_to_other(phar_obj->archive, format, ext, flags); in PHP_METHOD()
2419 phar_obj->archive->is_data = is_data; in PHP_METHOD()
2456 if (phar_obj->archive->is_tar) { in PHP_METHOD()
2458 } else if (phar_obj->archive->is_zip) { in PHP_METHOD()
2480 flags = phar_obj->archive->flags & PHAR_FILE_COMPRESSION_MASK; in PHP_METHOD()
2484 flags = phar_obj->archive->flags & PHAR_FILE_COMPRESSION_MASK; in PHP_METHOD()
2526 is_data = phar_obj->archive->is_data; in PHP_METHOD()
2527 phar_obj->archive->is_data = 1; in PHP_METHOD()
2528 ret = phar_convert_to_other(phar_obj->archive, (int)format, ext, flags); in PHP_METHOD()
2529 phar_obj->archive->is_data = is_data; in PHP_METHOD()
2550 if (phar_obj->archive->flags & PHAR_FILE_COMPRESSED_GZ) { in PHP_METHOD()
2554 if (phar_obj->archive->flags & PHAR_FILE_COMPRESSED_BZ2) { in PHP_METHOD()
2573 if (!phar_obj->archive->is_writeable) { in PHP_METHOD()
2577 if (SUCCESS != php_stream_stat_path(phar_obj->archive->fname, &ssb)) { in PHP_METHOD()
2578 if (phar_obj->archive->is_brandnew) { in PHP_METHOD()
2603 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
2609 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
2610 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
2613 if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint32_t) fname_len)) { in PHP_METHOD()
2614 …if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint32_t) fname_… in PHP_METHOD()
2621 phar_obj->archive->is_modified = 1; in PHP_METHOD()
2629 phar_flush(phar_obj->archive, NULL, 0, 0, &error); in PHP_METHOD()
2649 if (phar_obj->archive->alias && phar_obj->archive->alias != phar_obj->archive->fname) { in PHP_METHOD()
2650 RETURN_STRINGL(phar_obj->archive->alias, phar_obj->archive->alias_len); in PHP_METHOD()
2664 RETURN_STRINGL(phar_obj->archive->fname, phar_obj->archive->fname_len); in PHP_METHOD()
2684 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
2694 if (phar_obj->archive->is_data) { in PHP_METHOD()
2695 if (phar_obj->archive->is_tar) { in PHP_METHOD()
2705 …if (alias_len == phar_obj->archive->alias_len && memcmp(phar_obj->archive->alias, alias, alias_len… in PHP_METHOD()
2720 "Invalid alias \"%s\" specified for phar \"%s\"", alias, phar_obj->archive->fname); in PHP_METHOD()
2724 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
2725 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
2728 …phar_obj->archive->alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map))… in PHP_METHOD()
2729 …zend_hash_str_del(&(PHAR_G(phar_alias_map)), phar_obj->archive->alias, phar_obj->archive->alias_le… in PHP_METHOD()
2733 oldalias = phar_obj->archive->alias; in PHP_METHOD()
2734 oldalias_len = phar_obj->archive->alias_len; in PHP_METHOD()
2735 old_temp = phar_obj->archive->is_temporary_alias; in PHP_METHOD()
2738 phar_obj->archive->alias = estrndup(alias, alias_len); in PHP_METHOD()
2740 phar_obj->archive->alias = NULL; in PHP_METHOD()
2743 phar_obj->archive->alias_len = alias_len; in PHP_METHOD()
2744 phar_obj->archive->is_temporary_alias = 0; in PHP_METHOD()
2745 phar_flush(phar_obj->archive, NULL, 0, 0, &error); in PHP_METHOD()
2748 phar_obj->archive->alias = oldalias; in PHP_METHOD()
2749 phar_obj->archive->alias_len = oldalias_len; in PHP_METHOD()
2750 phar_obj->archive->is_temporary_alias = old_temp; in PHP_METHOD()
2753 zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), oldalias, oldalias_len, phar_obj->archive); in PHP_METHOD()
2759 zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len, phar_obj->archive); in PHP_METHOD()
2778 RETURN_STRING(phar_obj->archive->version); in PHP_METHOD()
2791 phar_obj->archive->donotflush = 1; in PHP_METHOD()
2804 RETURN_BOOL(phar_obj->archive->donotflush); in PHP_METHOD()
2819 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
2825 phar_obj->archive->donotflush = 0; in PHP_METHOD()
2826 phar_flush(phar_obj->archive, 0, 0, 0, &error); in PHP_METHOD()
2848 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
2854 if (phar_obj->archive->is_data) { in PHP_METHOD()
2855 if (phar_obj->archive->is_tar) { in PHP_METHOD()
2872 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
2873 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
2876 phar_flush(phar_obj->archive, (char *) zstub, len, 0, &error); in PHP_METHOD()
2887 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
2888 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
2891 phar_flush(phar_obj->archive, stub, stub_len, 0, &error); in PHP_METHOD()
2931 if (phar_obj->archive->is_data) { in PHP_METHOD()
2932 if (phar_obj->archive->is_tar) { in PHP_METHOD()
2942 if ((index || webindex) && (phar_obj->archive->is_tar || phar_obj->archive->is_zip)) { in PHP_METHOD()
2953 if (!phar_obj->archive->is_tar && !phar_obj->archive->is_zip) { in PHP_METHOD()
2968 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
2969 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
2972 phar_flush(phar_obj->archive, stub ? ZSTR_VAL(stub) : 0, stub ? ZSTR_LEN(stub) : 0, 1, &error); in PHP_METHOD()
3005 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3019 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
3020 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
3023 phar_obj->archive->sig_flags = (php_uint32)algo; in PHP_METHOD()
3024 phar_obj->archive->is_modified = 1; in PHP_METHOD()
3028 phar_flush(phar_obj->archive, 0, 0, 0, &error); in PHP_METHOD()
3050 if (phar_obj->archive->signature) { in PHP_METHOD()
3054 add_assoc_stringl(return_value, "hash", phar_obj->archive->signature, phar_obj->archive->sig_len); in PHP_METHOD()
3055 switch(phar_obj->archive->sig_flags) { in PHP_METHOD()
3078 unknown = strpprintf(0, "Unknown (%u)", phar_obj->archive->sig_flags); in PHP_METHOD()
3097 RETURN_BOOL(phar_obj->archive->is_modified); in PHP_METHOD()
3176 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3182 if (phar_obj->archive->is_zip) { in PHP_METHOD()
3215 if (phar_obj->archive->is_tar) { in PHP_METHOD()
3216 ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, flags); in PHP_METHOD()
3218 ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, flags); in PHP_METHOD()
3242 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3248 if (phar_obj->archive->is_zip) { in PHP_METHOD()
3254 if (phar_obj->archive->is_tar) { in PHP_METHOD()
3255 ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, PHAR_FILE_COMPRESSED_NONE); in PHP_METHOD()
3257 ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, PHAR_FILE_COMPRESSED_NONE); in PHP_METHOD()
3284 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3314 if (phar_obj->archive->is_tar) { in PHP_METHOD()
3320 if (!pharobj_cancompress(&phar_obj->archive->manifest)) { in PHP_METHOD()
3331 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
3332 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
3335 pharobj_set_compression(&phar_obj->archive->manifest, flags); in PHP_METHOD()
3336 phar_obj->archive->is_modified = 1; in PHP_METHOD()
3337 phar_flush(phar_obj->archive, 0, 0, 0, &error); in PHP_METHOD()
3358 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3364 if (!pharobj_cancompress(&phar_obj->archive->manifest)) { in PHP_METHOD()
3370 if (phar_obj->archive->is_tar) { in PHP_METHOD()
3373 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
3374 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
3377 pharobj_set_compression(&phar_obj->archive->manifest, PHAR_ENT_COMPRESSED_NONE); in PHP_METHOD()
3380 phar_obj->archive->is_modified = 1; in PHP_METHOD()
3381 phar_flush(phar_obj->archive, 0, 0, 0, &error); in PHP_METHOD()
3407 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3416 …ied to file \"%s\", cannot copy Phar meta-file in %s", oldfile, newfile, phar_obj->archive->fname); in PHP_METHOD()
3423 … to file \"%s\", cannot copy to Phar meta-file in %s", oldfile, newfile, phar_obj->archive->fname); in PHP_METHOD()
3427 …exists(&phar_obj->archive->manifest, oldfile, (uint32_t) oldfile_len) || NULL == (oldentry = zend_… in PHP_METHOD()
3429 … be copied to file \"%s\", file does not exist in %s", oldfile, newfile, phar_obj->archive->fname); in PHP_METHOD()
3433 if (zend_hash_str_exists(&phar_obj->archive->manifest, newfile, (uint32_t) newfile_len)) { in PHP_METHOD()
3434 …if (NULL != (temp = zend_hash_str_find_ptr(&phar_obj->archive->manifest, newfile, (uint32_t) newfi… in PHP_METHOD()
3436 … file \"%s\", file must not already exist in phar %s", oldfile, newfile, phar_obj->archive->fname); in PHP_METHOD()
3444 …, cannot be copied from \"%s\" in phar %s", newfile, pcr_error, oldfile, phar_obj->archive->fname); in PHP_METHOD()
3449 if (phar_obj->archive->is_persistent) { in PHP_METHOD()
3450 if (FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
3451 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
3455 oldentry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, oldfile, (uint32_t) oldfile_len); in PHP_METHOD()
3477 phar_obj->archive->is_modified = 1; in PHP_METHOD()
3478 phar_flush(phar_obj->archive, 0, 0, 0, &error); in PHP_METHOD()
3502 if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint32_t) fname_len)) { in PHP_METHOD()
3503 …if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint32_t) fname_… in PHP_METHOD()
3516 if (zend_hash_str_exists(&phar_obj->archive->virtual_dirs, fname, (uint32_t) fname_len)) { in PHP_METHOD()
3540 if (!(entry = phar_get_entry_info_dir(phar_obj->archive, fname, fname_len, 1, &error, 0))) { in PHP_METHOD()
3544 …annot get stub \".phar/stub.php\" directly in phar \"%s\", use getStub", phar_obj->archive->fname); in PHP_METHOD()
3549 …ot get alias \".phar/alias.txt\" directly in phar \"%s\", use getAlias", phar_obj->archive->fname); in PHP_METHOD()
3563 sfname = strpprintf(0, "phar://%s/%s", phar_obj->archive->fname, fname); in PHP_METHOD()
3715 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3721 …annot set stub \".phar/stub.php\" directly in phar \"%s\", use setStub", phar_obj->archive->fname); in PHP_METHOD()
3726 …ot set alias \".phar/alias.txt\" directly in phar \"%s\", use setAlias", phar_obj->archive->fname); in PHP_METHOD()
3735 phar_add_file(&(phar_obj->archive), fname, fname_len, cont_str, cont_len, zresource); in PHP_METHOD()
3752 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3757 if (zend_hash_str_exists(&phar_obj->archive->manifest, fname, (uint32_t) fname_len)) { in PHP_METHOD()
3758 …if (NULL != (entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint32_t) fname_… in PHP_METHOD()
3764 if (phar_obj->archive->is_persistent) { in PHP_METHOD()
3765 if (FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
3766 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
3770 entry = zend_hash_str_find_ptr(&phar_obj->archive->manifest, fname, (uint32_t) fname_len); in PHP_METHOD()
3775 phar_flush(phar_obj->archive, 0, 0, 0, &error); in PHP_METHOD()
3803 phar_mkdir(&phar_obj->archive, dirname, dirname_len); in PHP_METHOD()
3837 phar_add_file(&(phar_obj->archive), fname, fname_len, NULL, 0, &zresource); in PHP_METHOD()
3854 phar_add_file(&(phar_obj->archive), localname, localname_len, cont_str, cont_len, NULL); in PHP_METHOD()
3873 if (phar_obj->archive->is_tar || phar_obj->archive->is_zip) { in PHP_METHOD()
3875 …if (NULL != (stub = zend_hash_str_find_ptr(&(phar_obj->archive->manifest), ".phar/stub.php", sizeo… in PHP_METHOD()
3876 …if (phar_obj->archive->fp && !phar_obj->archive->is_brandnew && !(stub->flags & PHAR_ENT_COMPRESSI… in PHP_METHOD()
3877 fp = phar_obj->archive->fp; in PHP_METHOD()
3879 if (!(fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", 0, NULL))) { in PHP_METHOD()
3880 …e_UnexpectedValueException, 0, "phar error: unable to open phar \"%s\"", phar_obj->archive->fname); in PHP_METHOD()
3892 …unable to read stub of phar \"%s\" (cannot create %s filter)", phar_obj->archive->fname, phar_deco… in PHP_METHOD()
3912 len = phar_obj->archive->halt_offset; in PHP_METHOD()
3914 if (phar_obj->archive->fp && !phar_obj->archive->is_brandnew) { in PHP_METHOD()
3915 fp = phar_obj->archive->fp; in PHP_METHOD()
3917 fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", 0, NULL); in PHP_METHOD()
3931 if (fp != phar_obj->archive->fp) { in PHP_METHOD()
3945 if (fp != phar_obj->archive->fp) { in PHP_METHOD()
3964 …RETURN_BOOL(phar_metadata_tracker_has_data(&phar_obj->archive->metadata_tracker, phar_obj->archive… in PHP_METHOD()
3981 tracker = &phar_obj->archive->metadata_tracker; in PHP_METHOD()
3982 if (phar_metadata_tracker_has_data(tracker, phar_obj->archive->is_persistent)) { in PHP_METHOD()
3983 …phar_metadata_tracker_unserialize_or_copy(tracker, return_value, phar_obj->archive->is_persistent,… in PHP_METHOD()
4031 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
4036 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
4037 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
4041 ZEND_ASSERT(!phar_obj->archive->is_persistent); /* Should no longer be persistent */ in PHP_METHOD()
4042 …if (serialize_metadata_or_throw(&phar_obj->archive->metadata_tracker, phar_obj->archive->is_persis… in PHP_METHOD()
4046 phar_obj->archive->is_modified = 1; in PHP_METHOD()
4047 phar_flush(phar_obj->archive, 0, 0, 0, &error); in PHP_METHOD()
4067 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
4072 …if (!phar_metadata_tracker_has_data(&phar_obj->archive->metadata_tracker, phar_obj->archive->is_pe… in PHP_METHOD()
4076 phar_metadata_tracker_free(&phar_obj->archive->metadata_tracker, phar_obj->archive->is_persistent); in PHP_METHOD()
4077 phar_obj->archive->is_modified = 1; in PHP_METHOD()
4078 phar_flush(phar_obj->archive, 0, 0, 0, &error); in PHP_METHOD()
4272 static int extract_helper(phar_archive_data *archive, zend_string *search, char *pathto, size_t pat… in extract_helper() argument
4278 ZEND_HASH_MAP_FOREACH_PTR(&archive->manifest, entry) { in extract_helper()
4284 ZEND_HASH_MAP_FOREACH_PTR(&archive->manifest, entry) { in extract_helper()
4291 entry = zend_hash_find_ptr(&archive->manifest, search); in extract_helper()
4324 fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK, NULL); in PHP_METHOD()
4328 "Invalid argument, %s cannot be found", phar_obj->archive->fname); in PHP_METHOD()
4373 …switch (extract_helper(phar_obj->archive, Z_STR_P(zval_file), pathto, pathto_len, overwrite, &erro… in PHP_METHOD()
4376 phar_obj->archive->fname, error); in PHP_METHOD()
4382 ZSTR_VAL(Z_STR_P(zval_file)), phar_obj->archive->fname); in PHP_METHOD()
4389 ret = extract_helper(phar_obj->archive, filename, pathto, pathto_len, overwrite, &error); in PHP_METHOD()
4392 phar_obj->archive->fname, error); in PHP_METHOD()
4397 ZSTR_VAL(filename), phar_obj->archive->fname); in PHP_METHOD()