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()
260 …_log_error(wrapper, options, "phar error: could not reopen phar \"%s\"", ZSTR_VAL(resource->host)); in phar_wrapper_open_url()
262 php_url_free(resource); in phar_wrapper_open_url()
287 php_url_free(resource); in phar_wrapper_open_url()
296 …if ((FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), host_len, internal_file, str… in phar_wrapper_open_url()
302 …tions, "phar error: \"%s\" is not a file in phar \"%s\"", internal_file, ZSTR_VAL(resource->host)); in phar_wrapper_open_url()
305 php_url_free(resource); in phar_wrapper_open_url()
309 php_url_free(resource); in phar_wrapper_open_url()
564 php_url *resource = NULL; in phar_wrapper_stat() local
571 if ((resource = phar_parse_url(wrapper, url, "r", flags|PHP_STREAM_URL_STAT_QUIET)) == NULL) { in phar_wrapper_stat()
576 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_stat()
577 php_url_free(resource); in phar_wrapper_stat()
581 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_stat()
582 php_url_free(resource); in phar_wrapper_stat()
586 host_len = ZSTR_LEN(resource->host); in phar_wrapper_stat()
589 internal_file = ZSTR_VAL(resource->path) + 1; /* strip leading "/" */ in phar_wrapper_stat()
591 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) { in phar_wrapper_stat()
592 php_url_free(resource); in phar_wrapper_stat()
604 php_url_free(resource); in phar_wrapper_stat()
608 php_url_free(resource); in phar_wrapper_stat()
615 php_url_free(resource); in phar_wrapper_stat()
620 php_url_free(resource); in phar_wrapper_stat()
656 php_url_free(resource); in phar_wrapper_stat()
662 php_url_free(resource); in phar_wrapper_stat()
672 php_url *resource; in phar_wrapper_unlink() local
679 if ((resource = phar_parse_url(wrapper, url, "rb", options)) == NULL) { in phar_wrapper_unlink()
685 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_unlink()
686 php_url_free(resource); in phar_wrapper_unlink()
691 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_unlink()
692 php_url_free(resource); in phar_wrapper_unlink()
697 host_len = ZSTR_LEN(resource->host); in phar_wrapper_unlink()
700 pphar = zend_hash_find_ptr(&(PHAR_G(phar_fname_map)), resource->host); in phar_wrapper_unlink()
702 php_url_free(resource); in phar_wrapper_unlink()
708 internal_file = estrndup(ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1); in phar_wrapper_unlink()
709 internal_file_len = ZSTR_LEN(resource->path) - 1; in phar_wrapper_unlink()
710 …if (FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), host_len, internal_file, inte… in phar_wrapper_unlink()
719 php_url_free(resource); in phar_wrapper_unlink()
727 …" in phar \"%s\", has open file pointers, cannot unlink", internal_file, ZSTR_VAL(resource->host)); in phar_wrapper_unlink()
729 php_url_free(resource); in phar_wrapper_unlink()
733 php_url_free(resource); in phar_wrapper_unlink()