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 = zend_string_init("phar", 4, 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
173 if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) { in phar_wrapper_open_url()
178 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_open_url()
179 php_url_free(resource); in phar_wrapper_open_url()
184 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_open_url()
185 php_url_free(resource); in phar_wrapper_open_url()
190 host_len = ZSTR_LEN(resource->host); in phar_wrapper_open_url()
194 internal_file = estrndup(ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1); in phar_wrapper_open_url()
196 …if (NULL == (idata = phar_get_or_create_entry_data(ZSTR_VAL(resource->host), host_len, internal_fi… in phar_wrapper_open_url()
201 … error: file \"%s\" could not be created in phar \"%s\"", internal_file, ZSTR_VAL(resource->host)); in phar_wrapper_open_url()
204 php_url_free(resource); in phar_wrapper_open_url()
211 php_url_free(resource); in phar_wrapper_open_url()
240 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, NULL)) { in phar_wrapper_open_url()
241 …apper_log_error(wrapper, options, "file %s is not a valid phar archive", ZSTR_VAL(resource->host)); in phar_wrapper_open_url()
243 php_url_free(resource); in phar_wrapper_open_url()
247 …if ((FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), host_len, ".phar/stub.php", … in phar_wrapper_open_url()
254 php_url_free(resource); in phar_wrapper_open_url()
276 php_url_free(resource); in phar_wrapper_open_url()
285 …if ((FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), host_len, internal_file, str… in phar_wrapper_open_url()
291 …tions, "phar error: \"%s\" is not a file in phar \"%s\"", internal_file, ZSTR_VAL(resource->host)); in phar_wrapper_open_url()
294 php_url_free(resource); in phar_wrapper_open_url()
298 php_url_free(resource); in phar_wrapper_open_url()
553 php_url *resource = NULL; in phar_wrapper_stat() local
560 if ((resource = phar_parse_url(wrapper, url, "r", flags|PHP_STREAM_URL_STAT_QUIET)) == NULL) { in phar_wrapper_stat()
565 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_stat()
566 php_url_free(resource); in phar_wrapper_stat()
570 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_stat()
571 php_url_free(resource); in phar_wrapper_stat()
575 host_len = ZSTR_LEN(resource->host); in phar_wrapper_stat()
578 internal_file = ZSTR_VAL(resource->path) + 1; /* strip leading "/" */ in phar_wrapper_stat()
580 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) { in phar_wrapper_stat()
581 php_url_free(resource); in phar_wrapper_stat()
593 php_url_free(resource); in phar_wrapper_stat()
597 php_url_free(resource); in phar_wrapper_stat()
604 php_url_free(resource); in phar_wrapper_stat()
609 php_url_free(resource); in phar_wrapper_stat()
645 php_url_free(resource); in phar_wrapper_stat()
651 php_url_free(resource); in phar_wrapper_stat()
661 php_url *resource; in phar_wrapper_unlink() local
668 if ((resource = phar_parse_url(wrapper, url, "rb", options)) == NULL) { in phar_wrapper_unlink()
674 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_unlink()
675 php_url_free(resource); in phar_wrapper_unlink()
680 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_unlink()
681 php_url_free(resource); in phar_wrapper_unlink()
686 host_len = ZSTR_LEN(resource->host); in phar_wrapper_unlink()
689 pphar = zend_hash_find_ptr(&(PHAR_G(phar_fname_map)), resource->host); in phar_wrapper_unlink()
691 php_url_free(resource); in phar_wrapper_unlink()
697 internal_file = estrndup(ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1); in phar_wrapper_unlink()
698 internal_file_len = ZSTR_LEN(resource->path) - 1; in phar_wrapper_unlink()
699 …if (FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), host_len, internal_file, inte… in phar_wrapper_unlink()
708 php_url_free(resource); in phar_wrapper_unlink()
716 …" in phar \"%s\", has open file pointers, cannot unlink", internal_file, ZSTR_VAL(resource->host)); in phar_wrapper_unlink()
718 php_url_free(resource); in phar_wrapper_unlink()
722 php_url_free(resource); in phar_wrapper_unlink()