Lines Matching refs:resource

291 	php_url *resource = NULL;  in phar_wrapper_open_dir()  local
299 if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) { in phar_wrapper_open_dir()
305 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_open_dir()
306 if (resource->host && !resource->path) { in phar_wrapper_open_dir()
307 …ar://%s/ for root directory (always use full path to a new phar)", path, ZSTR_VAL(resource->host)); in phar_wrapper_open_dir()
308 php_url_free(resource); in phar_wrapper_open_dir()
311 php_url_free(resource); in phar_wrapper_open_dir()
316 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_open_dir()
317 php_url_free(resource); in phar_wrapper_open_dir()
322 size_t host_len = ZSTR_LEN(resource->host); in phar_wrapper_open_dir()
324 internal_file = ZSTR_VAL(resource->path) + 1; /* strip leading "/" */ in phar_wrapper_open_dir()
326 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) { in phar_wrapper_open_dir()
331 …php_stream_wrapper_log_error(wrapper, options, "phar file \"%s\" is unknown", ZSTR_VAL(resource->h… in phar_wrapper_open_dir()
333 php_url_free(resource); in phar_wrapper_open_dir()
345 php_url_free(resource); in phar_wrapper_open_dir()
350 php_url_free(resource); in phar_wrapper_open_dir()
355 php_url_free(resource); in phar_wrapper_open_dir()
359 php_url_free(resource); in phar_wrapper_open_dir()
363 php_url_free(resource); in phar_wrapper_open_dir()
377 php_url_free(resource); in phar_wrapper_open_dir()
388 php_url_free(resource); in phar_wrapper_open_dir()
402 php_url *resource = NULL; in phar_wrapper_mkdir() local
422 if ((resource = phar_parse_url(wrapper, url_from, "w", options)) == NULL) { in phar_wrapper_mkdir()
427 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_mkdir()
428 php_url_free(resource); in phar_wrapper_mkdir()
433 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_mkdir()
434 php_url_free(resource); in phar_wrapper_mkdir()
439 size_t host_len = ZSTR_LEN(resource->host); in phar_wrapper_mkdir()
441 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) { in phar_wrapper_mkdir()
442 …\"%s\", error retrieving phar information: %s", ZSTR_VAL(resource->path) + 1, ZSTR_VAL(resource->h… in phar_wrapper_mkdir()
444 php_url_free(resource); in phar_wrapper_mkdir()
448 …if ((e = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1,… in phar_wrapper_mkdir()
454 …"%s\" in phar \"%s\", directory already exists", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
455 php_url_free(resource); in phar_wrapper_mkdir()
460 …not create directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
462 php_url_free(resource); in phar_wrapper_mkdir()
466 …if (phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1, 0, &… in phar_wrapper_mkdir()
468 …ory \"%s\" in phar \"%s\", file already exists", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
469 php_url_free(resource); in phar_wrapper_mkdir()
474 …not create directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
476 php_url_free(resource); in phar_wrapper_mkdir()
487 entry.filename = estrdup(ZSTR_VAL(resource->path) + 1); in phar_wrapper_mkdir()
494 entry.filename_len = ZSTR_LEN(resource->path) - 1; in phar_wrapper_mkdir()
495 php_url_free(resource); in phar_wrapper_mkdir()
533 php_url *resource = NULL; in phar_wrapper_rmdir() local
555 if ((resource = phar_parse_url(wrapper, url, "w", options)) == NULL) { in phar_wrapper_rmdir()
560 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_rmdir()
561 php_url_free(resource); in phar_wrapper_rmdir()
566 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_rmdir()
567 php_url_free(resource); in phar_wrapper_rmdir()
572 size_t host_len = ZSTR_LEN(resource->host); in phar_wrapper_rmdir()
574 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) { in phar_wrapper_rmdir()
575 … \"%s\", error retrieving phar information: %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_rmdir()
577 php_url_free(resource); in phar_wrapper_rmdir()
581 size_t path_len = ZSTR_LEN(resource->path) - 1; in phar_wrapper_rmdir()
583 …if (!(entry = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, path_len, 2, &error, 1))… in phar_wrapper_rmdir()
585 …not remove directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_rmdir()
588 …"%s\" in phar \"%s\", directory does not exist", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_rmdir()
590 php_url_free(resource); in phar_wrapper_rmdir()
600 memcmp(ZSTR_VAL(str_key), ZSTR_VAL(resource->path)+1, path_len) == 0 && in phar_wrapper_rmdir()
607 php_url_free(resource); in phar_wrapper_rmdir()
617 memcmp(ZSTR_VAL(str_key), ZSTR_VAL(resource->path)+1, path_len) == 0 && in phar_wrapper_rmdir()
624 php_url_free(resource); in phar_wrapper_rmdir()
631 zend_hash_str_del(&phar->virtual_dirs, ZSTR_VAL(resource->path)+1, path_len); in phar_wrapper_rmdir()
641 php_url_free(resource); in phar_wrapper_rmdir()
647 php_url_free(resource); in phar_wrapper_rmdir()