Lines Matching refs:resource
291 php_url *resource = NULL; in phar_wrapper_open_dir() local
300 if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) { in phar_wrapper_open_dir()
306 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_open_dir()
307 if (resource->host && !resource->path) { in phar_wrapper_open_dir()
308 …ar://%s/ for root directory (always use full path to a new phar)", path, ZSTR_VAL(resource->host)); in phar_wrapper_open_dir()
309 php_url_free(resource); in phar_wrapper_open_dir()
312 php_url_free(resource); in phar_wrapper_open_dir()
317 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_open_dir()
318 php_url_free(resource); in phar_wrapper_open_dir()
323 host_len = ZSTR_LEN(resource->host); in phar_wrapper_open_dir()
325 internal_file = ZSTR_VAL(resource->path) + 1; /* strip leading "/" */ in phar_wrapper_open_dir()
327 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) { in phar_wrapper_open_dir()
332 …php_stream_wrapper_log_error(wrapper, options, "phar file \"%s\" is unknown", ZSTR_VAL(resource->h… in phar_wrapper_open_dir()
334 php_url_free(resource); in phar_wrapper_open_dir()
346 php_url_free(resource); in phar_wrapper_open_dir()
351 php_url_free(resource); in phar_wrapper_open_dir()
356 php_url_free(resource); in phar_wrapper_open_dir()
360 php_url_free(resource); in phar_wrapper_open_dir()
364 php_url_free(resource); in phar_wrapper_open_dir()
378 php_url_free(resource); in phar_wrapper_open_dir()
389 php_url_free(resource); in phar_wrapper_open_dir()
403 php_url *resource = NULL; in phar_wrapper_mkdir() local
424 if ((resource = phar_parse_url(wrapper, url_from, "w", options)) == NULL) { in phar_wrapper_mkdir()
429 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_mkdir()
430 php_url_free(resource); in phar_wrapper_mkdir()
435 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_mkdir()
436 php_url_free(resource); in phar_wrapper_mkdir()
441 host_len = ZSTR_LEN(resource->host); in phar_wrapper_mkdir()
443 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) { in phar_wrapper_mkdir()
444 …\"%s\", error retrieving phar information: %s", ZSTR_VAL(resource->path) + 1, ZSTR_VAL(resource->h… in phar_wrapper_mkdir()
446 php_url_free(resource); in phar_wrapper_mkdir()
450 …if ((e = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1,… in phar_wrapper_mkdir()
456 …"%s\" in phar \"%s\", directory already exists", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
457 php_url_free(resource); in phar_wrapper_mkdir()
462 …not create directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
464 php_url_free(resource); in phar_wrapper_mkdir()
468 …if (phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1, 0, &… in phar_wrapper_mkdir()
470 …ory \"%s\" in phar \"%s\", file already exists", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
471 php_url_free(resource); in phar_wrapper_mkdir()
476 …not create directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
478 php_url_free(resource); in phar_wrapper_mkdir()
489 entry.filename = estrdup(ZSTR_VAL(resource->path) + 1); in phar_wrapper_mkdir()
496 entry.filename_len = ZSTR_LEN(resource->path) - 1; in phar_wrapper_mkdir()
497 php_url_free(resource); in phar_wrapper_mkdir()
535 php_url *resource = NULL; in phar_wrapper_rmdir() local
559 if ((resource = phar_parse_url(wrapper, url, "w", options)) == NULL) { in phar_wrapper_rmdir()
564 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_rmdir()
565 php_url_free(resource); in phar_wrapper_rmdir()
570 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_rmdir()
571 php_url_free(resource); in phar_wrapper_rmdir()
576 host_len = ZSTR_LEN(resource->host); in phar_wrapper_rmdir()
578 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) { in phar_wrapper_rmdir()
579 … \"%s\", error retrieving phar information: %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_rmdir()
581 php_url_free(resource); in phar_wrapper_rmdir()
585 path_len = ZSTR_LEN(resource->path) - 1; in phar_wrapper_rmdir()
587 …if (!(entry = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, path_len, 2, &error, 1))… in phar_wrapper_rmdir()
589 …not remove directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_rmdir()
592 …"%s\" in phar \"%s\", directory does not exist", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_rmdir()
594 php_url_free(resource); in phar_wrapper_rmdir()
604 memcmp(ZSTR_VAL(str_key), ZSTR_VAL(resource->path)+1, path_len) == 0 && in phar_wrapper_rmdir()
611 php_url_free(resource); in phar_wrapper_rmdir()
621 memcmp(ZSTR_VAL(str_key), ZSTR_VAL(resource->path)+1, path_len) == 0 && in phar_wrapper_rmdir()
628 php_url_free(resource); in phar_wrapper_rmdir()
635 zend_hash_str_del(&phar->virtual_dirs, ZSTR_VAL(resource->path)+1, path_len); in phar_wrapper_rmdir()
645 php_url_free(resource); in phar_wrapper_rmdir()
651 php_url_free(resource); in phar_wrapper_rmdir()