Lines Matching refs:resource
62 php_url *resource; in phar_parse_url() local
86 resource = ecalloc(1, sizeof(php_url)); in phar_parse_url()
87 resource->scheme = ZSTR_INIT_LITERAL("phar", 0); in phar_parse_url()
88 resource->host = zend_string_init(arch, arch_len, 0); in phar_parse_url()
90 resource->path = zend_string_init(entry, entry_len, 0); in phar_parse_url()
94 if (resource) { in phar_parse_url()
96 fprintf(stderr, "Scheme: %s\n", ZSTR_VAL(resource->scheme)); in phar_parse_url()
99 fprintf(stderr, "Host: %s\n", ZSTR_VAL(resource->host)); in phar_parse_url()
101 fprintf(stderr, "Path: %s\n", ZSTR_VAL(resource->path)); in phar_parse_url()
109 …r_fname_map)) && NULL == (pphar = zend_hash_find_ptr(&(PHAR_G(phar_fname_map)), resource->host))) { in phar_parse_url()
116 php_url_free(resource); in phar_parse_url()
119 …if (phar_open_or_create_filename(ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), NULL, 0, 0, o… in phar_parse_url()
127 php_url_free(resource); in phar_parse_url()
132 …r, 0, "Cannot open cached phar '%s' as writeable, copy on write failed", ZSTR_VAL(resource->host)); in phar_parse_url()
138 php_url_free(resource); in phar_parse_url()
142 …if (phar_open_from_filename(ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), NULL, 0, options, … in phar_parse_url()
150 php_url_free(resource); in phar_parse_url()
154 return resource; in phar_parse_url()
168 php_url *resource = NULL; in phar_wrapper_open_url() local
172 if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) { in phar_wrapper_open_url()
177 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_open_url()
178 php_url_free(resource); in phar_wrapper_open_url()
183 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_open_url()
184 php_url_free(resource); in phar_wrapper_open_url()
192 internal_file = estrndup(ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1); in phar_wrapper_open_url()
194 …if (NULL == (idata = phar_get_or_create_entry_data(ZSTR_VAL(resource->host), ZSTR_LEN(resource->ho… in phar_wrapper_open_url()
199 … error: file \"%s\" could not be created in phar \"%s\"", internal_file, ZSTR_VAL(resource->host)); in phar_wrapper_open_url()
202 php_url_free(resource); in phar_wrapper_open_url()
209 php_url_free(resource); in phar_wrapper_open_url()
238 …if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), NULL, 0… in phar_wrapper_open_url()
239 …apper_log_error(wrapper, options, "file %s is not a valid phar archive", ZSTR_VAL(resource->host)); in phar_wrapper_open_url()
241 php_url_free(resource); in phar_wrapper_open_url()
245 …if ((FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), ".… in phar_wrapper_open_url()
252 php_url_free(resource); in phar_wrapper_open_url()
258 …_log_error(wrapper, options, "phar error: could not reopen phar \"%s\"", ZSTR_VAL(resource->host)); in phar_wrapper_open_url()
260 php_url_free(resource); in phar_wrapper_open_url()
285 php_url_free(resource); in phar_wrapper_open_url()
294 …if ((FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), in… in phar_wrapper_open_url()
300 …tions, "phar error: \"%s\" is not a file in phar \"%s\"", internal_file, ZSTR_VAL(resource->host)); in phar_wrapper_open_url()
303 php_url_free(resource); in phar_wrapper_open_url()
307 php_url_free(resource); in phar_wrapper_open_url()
561 php_url *resource = NULL; in phar_wrapper_stat() local
567 if ((resource = phar_parse_url(wrapper, url, "r", flags|PHP_STREAM_URL_STAT_QUIET)) == NULL) { in phar_wrapper_stat()
572 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_stat()
573 php_url_free(resource); in phar_wrapper_stat()
577 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_stat()
578 php_url_free(resource); in phar_wrapper_stat()
584 internal_file = ZSTR_VAL(resource->path) + 1; /* strip leading "/" */ in phar_wrapper_stat()
586 …if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), NULL, 0… in phar_wrapper_stat()
587 php_url_free(resource); in phar_wrapper_stat()
599 php_url_free(resource); in phar_wrapper_stat()
603 php_url_free(resource); in phar_wrapper_stat()
610 php_url_free(resource); in phar_wrapper_stat()
615 php_url_free(resource); in phar_wrapper_stat()
651 php_url_free(resource); in phar_wrapper_stat()
657 php_url_free(resource); in phar_wrapper_stat()
667 php_url *resource; in phar_wrapper_unlink() local
673 if ((resource = phar_parse_url(wrapper, url, "rb", options)) == NULL) { in phar_wrapper_unlink()
679 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_unlink()
680 php_url_free(resource); in phar_wrapper_unlink()
685 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_unlink()
686 php_url_free(resource); in phar_wrapper_unlink()
693 pphar = zend_hash_find_ptr(&(PHAR_G(phar_fname_map)), resource->host); in phar_wrapper_unlink()
695 php_url_free(resource); in phar_wrapper_unlink()
701 internal_file = estrndup(ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1); in phar_wrapper_unlink()
702 internal_file_len = ZSTR_LEN(resource->path) - 1; in phar_wrapper_unlink()
703 …if (FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), int… in phar_wrapper_unlink()
712 php_url_free(resource); in phar_wrapper_unlink()
720 …" in phar \"%s\", has open file pointers, cannot unlink", internal_file, ZSTR_VAL(resource->host)); in phar_wrapper_unlink()
722 php_url_free(resource); in phar_wrapper_unlink()
726 php_url_free(resource); in phar_wrapper_unlink()