Lines Matching refs:archive
1141 if (phar_obj->archive) { in PHP_METHOD()
1215 phar_obj->archive = phar_data; in PHP_METHOD()
1234 phar_obj->archive->is_data = is_data; in PHP_METHOD()
1237 …add_ptr(&PHAR_G(phar_persist_map), (const char *) phar_obj->archive, sizeof(phar_obj->archive), ph… in PHP_METHOD()
1362 if (!phar_obj->archive) { \
1378 if (phar_obj->archive && phar_obj->archive->is_persistent) { in PHP_METHOD()
1379 …sh_str_del(&PHAR_G(phar_persist_map), (const char *) phar_obj->archive, sizeof(phar_obj->archive)); in PHP_METHOD()
1638 …if (!(data = phar_get_or_create_entry_data(phar_obj->archive->fname, phar_obj->archive->fname_len,… in phar_build()
1728 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
1736 …thodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname); in PHP_METHOD()
1754 …thodCallException, 0, "Unable to instantiate directory iterator for %s", phar_obj->archive->fname); in PHP_METHOD()
1775 …adMethodCallException, 0, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname); in PHP_METHOD()
1793 …phar_ce_PharException, 0, "phar \"%s\" unable to create temporary file", phar_obj->archive->fname); in PHP_METHOD()
1797 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
1803 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
1814 phar_obj->archive->ufp = pass.fp; in PHP_METHOD()
1815 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
1854 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
1860 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
1861 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
1874 …har_ce_PharException, 0, "phar \"%s\": unable to create temporary file", phar_obj->archive->fname); in PHP_METHOD()
1879 phar_obj->archive->ufp = pass.fp; in PHP_METHOD()
1880 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
1903 RETURN_LONG(zend_hash_num_elements(&phar_obj->archive->manifest)); in PHP_METHOD()
1922 RETURN_BOOL(phar_obj->archive->is_tar); in PHP_METHOD()
1924 RETURN_BOOL(phar_obj->archive->is_zip); in PHP_METHOD()
1926 RETURN_BOOL(!phar_obj->archive->is_tar && !phar_obj->archive->is_zip); in PHP_METHOD()
2373 if (phar_obj->archive->is_tar) { in PHP_METHOD()
2375 } else if (phar_obj->archive->is_zip) { in PHP_METHOD()
2392 flags = phar_obj->archive->flags & PHAR_FILE_COMPRESSION_MASK; in PHP_METHOD()
2396 flags = phar_obj->archive->flags & PHAR_FILE_COMPRESSION_MASK; in PHP_METHOD()
2438 is_data = phar_obj->archive->is_data; in PHP_METHOD()
2439 phar_obj->archive->is_data = 0; in PHP_METHOD()
2440 ret = phar_convert_to_other(phar_obj->archive, format, ext, flags); in PHP_METHOD()
2441 phar_obj->archive->is_data = is_data; in PHP_METHOD()
2478 if (phar_obj->archive->is_tar) { in PHP_METHOD()
2480 } else if (phar_obj->archive->is_zip) { in PHP_METHOD()
2502 flags = phar_obj->archive->flags & PHAR_FILE_COMPRESSION_MASK; in PHP_METHOD()
2506 flags = phar_obj->archive->flags & PHAR_FILE_COMPRESSION_MASK; in PHP_METHOD()
2548 is_data = phar_obj->archive->is_data; in PHP_METHOD()
2549 phar_obj->archive->is_data = 1; in PHP_METHOD()
2550 ret = phar_convert_to_other(phar_obj->archive, (int)format, ext, flags); in PHP_METHOD()
2551 phar_obj->archive->is_data = is_data; in PHP_METHOD()
2572 if (phar_obj->archive->flags & PHAR_FILE_COMPRESSED_GZ) { in PHP_METHOD()
2576 if (phar_obj->archive->flags & PHAR_FILE_COMPRESSED_BZ2) { in PHP_METHOD()
2595 if (!phar_obj->archive->is_writeable) { in PHP_METHOD()
2599 if (SUCCESS != php_stream_stat_path(phar_obj->archive->fname, &ssb)) { in PHP_METHOD()
2600 if (phar_obj->archive->is_brandnew) { in PHP_METHOD()
2624 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
2630 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
2631 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
2634 if (NULL != (entry = zend_hash_find_ptr(&phar_obj->archive->manifest, file_name))) { in PHP_METHOD()
2641 phar_obj->archive->is_modified = 1; in PHP_METHOD()
2648 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
2668 if (phar_obj->archive->alias && phar_obj->archive->alias != phar_obj->archive->fname) { in PHP_METHOD()
2669 RETURN_STRINGL(phar_obj->archive->alias, phar_obj->archive->alias_len); in PHP_METHOD()
2683 RETURN_STRINGL(phar_obj->archive->fname, phar_obj->archive->fname_len); in PHP_METHOD()
2704 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
2714 if (phar_obj->archive->is_data) { in PHP_METHOD()
2715 if (phar_obj->archive->is_tar) { in PHP_METHOD()
2725 if (zend_string_equals_cstr(new_alias, phar_obj->archive->alias, phar_obj->archive->alias_len)) { in PHP_METHOD()
2740 "Invalid alias \"%s\" specified for phar \"%s\"", ZSTR_VAL(new_alias), phar_obj->archive->fname); in PHP_METHOD()
2744 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
2745 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
2748 …phar_obj->archive->alias_len && NULL != (fd_ptr = zend_hash_str_find_ptr(&(PHAR_G(phar_alias_map))… in PHP_METHOD()
2749 …zend_hash_str_del(&(PHAR_G(phar_alias_map)), phar_obj->archive->alias, phar_obj->archive->alias_le… in PHP_METHOD()
2753 oldalias = phar_obj->archive->alias; in PHP_METHOD()
2754 oldalias_len = phar_obj->archive->alias_len; in PHP_METHOD()
2755 old_temp = phar_obj->archive->is_temporary_alias; in PHP_METHOD()
2757 phar_obj->archive->alias = estrndup(ZSTR_VAL(new_alias), ZSTR_LEN(new_alias)); in PHP_METHOD()
2758 phar_obj->archive->alias_len = ZSTR_LEN(new_alias); in PHP_METHOD()
2759 phar_obj->archive->is_temporary_alias = 0; in PHP_METHOD()
2760 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
2763 phar_obj->archive->alias = oldalias; in PHP_METHOD()
2764 phar_obj->archive->alias_len = oldalias_len; in PHP_METHOD()
2765 phar_obj->archive->is_temporary_alias = old_temp; in PHP_METHOD()
2768 zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), oldalias, oldalias_len, phar_obj->archive); in PHP_METHOD()
2774 zend_hash_add_ptr(&(PHAR_G(phar_alias_map)), new_alias, phar_obj->archive); in PHP_METHOD()
2793 RETURN_STRING(phar_obj->archive->version); in PHP_METHOD()
2806 phar_obj->archive->donotflush = 1; in PHP_METHOD()
2819 RETURN_BOOL(phar_obj->archive->donotflush); in PHP_METHOD()
2834 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
2840 phar_obj->archive->donotflush = 0; in PHP_METHOD()
2841 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
2863 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
2869 if (phar_obj->archive->is_data) { in PHP_METHOD()
2870 if (phar_obj->archive->is_tar) { in PHP_METHOD()
2889 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
2890 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
2902 …Exception, 0, "unable to read resource to copy stub to new phar \"%s\"", phar_obj->archive->fname); in PHP_METHOD()
2906 phar_flush_ex(phar_obj->archive, stub_file_content, /* is_default_stub */ false, &error); in PHP_METHOD()
2919 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
2920 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
2923 phar_flush_ex(phar_obj->archive, stub, /* is_default_stub */ false, &error); in PHP_METHOD()
2963 if (phar_obj->archive->is_data) { in PHP_METHOD()
2964 if (phar_obj->archive->is_tar) { in PHP_METHOD()
2974 if ((index || webindex) && (phar_obj->archive->is_tar || phar_obj->archive->is_zip)) { in PHP_METHOD()
2985 if (!phar_obj->archive->is_tar && !phar_obj->archive->is_zip) { in PHP_METHOD()
3000 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
3001 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
3004 phar_flush_ex(phar_obj->archive, stub, /* is_default_stub */ true, &error); in PHP_METHOD()
3037 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3051 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
3052 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
3055 phar_obj->archive->sig_flags = (uint32_t)algo; in PHP_METHOD()
3056 phar_obj->archive->is_modified = 1; in PHP_METHOD()
3060 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
3082 if (phar_obj->archive->signature) { in PHP_METHOD()
3086 add_assoc_stringl(return_value, "hash", phar_obj->archive->signature, phar_obj->archive->sig_len); in PHP_METHOD()
3087 switch(phar_obj->archive->sig_flags) { in PHP_METHOD()
3110 unknown = strpprintf(0, "Unknown (%u)", phar_obj->archive->sig_flags); in PHP_METHOD()
3129 RETURN_BOOL(phar_obj->archive->is_modified); in PHP_METHOD()
3208 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3214 if (phar_obj->archive->is_zip) { in PHP_METHOD()
3247 if (phar_obj->archive->is_tar) { in PHP_METHOD()
3248 ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, flags); in PHP_METHOD()
3250 ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, flags); in PHP_METHOD()
3274 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3280 if (phar_obj->archive->is_zip) { in PHP_METHOD()
3286 if (phar_obj->archive->is_tar) { in PHP_METHOD()
3287 ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_TAR, ext, PHAR_FILE_COMPRESSED_NONE); in PHP_METHOD()
3289 ret = phar_convert_to_other(phar_obj->archive, PHAR_FORMAT_PHAR, ext, PHAR_FILE_COMPRESSED_NONE); in PHP_METHOD()
3316 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3346 if (phar_obj->archive->is_tar) { in PHP_METHOD()
3352 if (!pharobj_cancompress(&phar_obj->archive->manifest)) { in PHP_METHOD()
3363 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
3364 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
3367 pharobj_set_compression(&phar_obj->archive->manifest, flags); in PHP_METHOD()
3368 phar_obj->archive->is_modified = 1; in PHP_METHOD()
3369 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
3390 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3396 if (!pharobj_cancompress(&phar_obj->archive->manifest)) { in PHP_METHOD()
3402 if (phar_obj->archive->is_tar) { in PHP_METHOD()
3405 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
3406 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
3409 pharobj_set_compression(&phar_obj->archive->manifest, PHAR_ENT_COMPRESSED_NONE); in PHP_METHOD()
3412 phar_obj->archive->is_modified = 1; in PHP_METHOD()
3413 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
3439 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3448 …nnot copy Phar meta-file in %s", ZSTR_VAL(old_file), ZSTR_VAL(new_file), phar_obj->archive->fname); in PHP_METHOD()
3455 …t copy to Phar meta-file in %s", ZSTR_VAL(old_file), ZSTR_VAL(new_file), phar_obj->archive->fname); in PHP_METHOD()
3459 …if (NULL == (oldentry = zend_hash_find_ptr(&phar_obj->archive->manifest, old_file)) || oldentry->i… in PHP_METHOD()
3461 …s\", file does not exist in %s", ZSTR_VAL(old_file), ZSTR_VAL(new_file), phar_obj->archive->fname); in PHP_METHOD()
3465 …if (NULL != (temp = zend_hash_find_ptr(&phar_obj->archive->manifest, new_file)) && !temp->is_delet… in PHP_METHOD()
3467 …t not already exist in phar %s", ZSTR_VAL(old_file), ZSTR_VAL(new_file), phar_obj->archive->fname); in PHP_METHOD()
3475 …m \"%s\" in phar %s", ZSTR_VAL(new_file), pcr_error, ZSTR_VAL(old_file), phar_obj->archive->fname); in PHP_METHOD()
3479 if (phar_obj->archive->is_persistent) { in PHP_METHOD()
3480 if (FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
3481 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
3485 oldentry = zend_hash_find_ptr(&phar_obj->archive->manifest, old_file); in PHP_METHOD()
3507 phar_obj->archive->is_modified = 1; in PHP_METHOD()
3508 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
3531 if (zend_hash_exists(&phar_obj->archive->manifest, file_name)) { in PHP_METHOD()
3532 if (NULL != (entry = zend_hash_find_ptr(&phar_obj->archive->manifest, file_name))) { in PHP_METHOD()
3549 RETURN_BOOL(zend_hash_exists(&phar_obj->archive->virtual_dirs, file_name)); in PHP_METHOD()
3568 …if (!(entry = phar_get_entry_info_dir(phar_obj->archive, ZSTR_VAL(file_name), ZSTR_LEN(file_name),… in PHP_METHOD()
3572 …annot get stub \".phar/stub.php\" directly in phar \"%s\", use getStub", phar_obj->archive->fname); in PHP_METHOD()
3577 …ot get alias \".phar/alias.txt\" directly in phar \"%s\", use getAlias", phar_obj->archive->fname); in PHP_METHOD()
3591 …zend_string *sfname = strpprintf(0, "phar://%s/%s", phar_obj->archive->fname, ZSTR_VAL(file_name)); in PHP_METHOD()
3756 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3762 …annot set stub \".phar/stub.php\" directly in phar \"%s\", use setStub", phar_obj->archive->fname); in PHP_METHOD()
3767 …ot set alias \".phar/alias.txt\" directly in phar \"%s\", use setAlias", phar_obj->archive->fname); in PHP_METHOD()
3776 phar_add_file(&(phar_obj->archive), file_name, file_content, zresource); in PHP_METHOD()
3793 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
3798 if (zend_hash_exists(&phar_obj->archive->manifest, file_name)) { in PHP_METHOD()
3799 if (NULL != (entry = zend_hash_find_ptr(&phar_obj->archive->manifest, file_name))) { in PHP_METHOD()
3805 if (phar_obj->archive->is_persistent) { in PHP_METHOD()
3806 if (FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
3807 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
3811 entry = zend_hash_find_ptr(&phar_obj->archive->manifest, file_name); in PHP_METHOD()
3816 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
3843 phar_mkdir(&phar_obj->archive, dir_name); in PHP_METHOD()
3876 phar_add_file(&(phar_obj->archive), file_name, NULL, &zresource); in PHP_METHOD()
3893 phar_add_file(&(phar_obj->archive), local_name, file_content, NULL); in PHP_METHOD()
3912 if (phar_obj->archive->is_tar || phar_obj->archive->is_zip) { in PHP_METHOD()
3914 …if (NULL != (stub = zend_hash_str_find_ptr(&(phar_obj->archive->manifest), ".phar/stub.php", sizeo… in PHP_METHOD()
3915 …if (phar_obj->archive->fp && !phar_obj->archive->is_brandnew && !(stub->flags & PHAR_ENT_COMPRESSI… in PHP_METHOD()
3916 fp = phar_obj->archive->fp; in PHP_METHOD()
3918 if (!(fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", 0, NULL))) { in PHP_METHOD()
3919 …e_UnexpectedValueException, 0, "phar error: unable to open phar \"%s\"", phar_obj->archive->fname); in PHP_METHOD()
3931 …unable to read stub of phar \"%s\" (cannot create %s filter)", phar_obj->archive->fname, phar_deco… in PHP_METHOD()
3951 len = phar_obj->archive->halt_offset; in PHP_METHOD()
3953 if (phar_obj->archive->fp && !phar_obj->archive->is_brandnew) { in PHP_METHOD()
3954 fp = phar_obj->archive->fp; in PHP_METHOD()
3956 fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", 0, NULL); in PHP_METHOD()
3970 if (fp != phar_obj->archive->fp) { in PHP_METHOD()
3984 if (fp != phar_obj->archive->fp) { in PHP_METHOD()
4003 …RETURN_BOOL(phar_metadata_tracker_has_data(&phar_obj->archive->metadata_tracker, phar_obj->archive… in PHP_METHOD()
4020 tracker = &phar_obj->archive->metadata_tracker; in PHP_METHOD()
4021 if (phar_metadata_tracker_has_data(tracker, phar_obj->archive->is_persistent)) { in PHP_METHOD()
4022 …phar_metadata_tracker_unserialize_or_copy(tracker, return_value, phar_obj->archive->is_persistent,… in PHP_METHOD()
4070 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
4075 if (phar_obj->archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->archive))) { in PHP_METHOD()
4076 …_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar_obj->archive->fname); in PHP_METHOD()
4080 ZEND_ASSERT(!phar_obj->archive->is_persistent); /* Should no longer be persistent */ in PHP_METHOD()
4081 …if (serialize_metadata_or_throw(&phar_obj->archive->metadata_tracker, phar_obj->archive->is_persis… in PHP_METHOD()
4085 phar_obj->archive->is_modified = 1; in PHP_METHOD()
4086 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
4106 if (PHAR_G(readonly) && !phar_obj->archive->is_data) { in PHP_METHOD()
4111 …if (!phar_metadata_tracker_has_data(&phar_obj->archive->metadata_tracker, phar_obj->archive->is_pe… in PHP_METHOD()
4115 phar_metadata_tracker_free(&phar_obj->archive->metadata_tracker, phar_obj->archive->is_persistent); in PHP_METHOD()
4116 phar_obj->archive->is_modified = 1; in PHP_METHOD()
4117 phar_flush(phar_obj->archive, &error); in PHP_METHOD()
4311 static int extract_helper(phar_archive_data *archive, zend_string *search, char *pathto, size_t pat… in extract_helper() argument
4317 ZEND_HASH_MAP_FOREACH_PTR(&archive->manifest, entry) { in extract_helper()
4323 ZEND_HASH_MAP_FOREACH_PTR(&archive->manifest, entry) { in extract_helper()
4330 entry = zend_hash_find_ptr(&archive->manifest, search); in extract_helper()
4363 fp = php_stream_open_wrapper(phar_obj->archive->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK, NULL); in PHP_METHOD()
4367 "Invalid argument, %s cannot be found", phar_obj->archive->fname); in PHP_METHOD()
4412 …switch (extract_helper(phar_obj->archive, Z_STR_P(zval_file), pathto, pathto_len, overwrite, &erro… in PHP_METHOD()
4415 phar_obj->archive->fname, error); in PHP_METHOD()
4421 ZSTR_VAL(Z_STR_P(zval_file)), phar_obj->archive->fname); in PHP_METHOD()
4428 ret = extract_helper(phar_obj->archive, filename, pathto, pathto_len, overwrite, &error); in PHP_METHOD()
4431 phar_obj->archive->fname, error); in PHP_METHOD()
4436 ZSTR_VAL(filename), phar_obj->archive->fname); in PHP_METHOD()