Lines Matching refs:resource
293 php_url *resource = NULL; in phar_wrapper_open_dir() local
302 if ((resource = phar_parse_url(wrapper, path, mode, options)) == NULL) { in phar_wrapper_open_dir()
308 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_open_dir()
309 if (resource->host && !resource->path) { in phar_wrapper_open_dir()
310 …ar://%s/ for root directory (always use full path to a new phar)", path, ZSTR_VAL(resource->host)); in phar_wrapper_open_dir()
311 php_url_free(resource); in phar_wrapper_open_dir()
314 php_url_free(resource); in phar_wrapper_open_dir()
319 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_open_dir()
320 php_url_free(resource); in phar_wrapper_open_dir()
325 host_len = ZSTR_LEN(resource->host); in phar_wrapper_open_dir()
327 internal_file = ZSTR_VAL(resource->path) + 1; /* strip leading "/" */ in phar_wrapper_open_dir()
329 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) { in phar_wrapper_open_dir()
334 …php_stream_wrapper_log_error(wrapper, options, "phar file \"%s\" is unknown", ZSTR_VAL(resource->h… in phar_wrapper_open_dir()
336 php_url_free(resource); in phar_wrapper_open_dir()
348 php_url_free(resource); in phar_wrapper_open_dir()
353 php_url_free(resource); in phar_wrapper_open_dir()
358 php_url_free(resource); in phar_wrapper_open_dir()
362 php_url_free(resource); in phar_wrapper_open_dir()
366 php_url_free(resource); in phar_wrapper_open_dir()
380 php_url_free(resource); in phar_wrapper_open_dir()
391 php_url_free(resource); in phar_wrapper_open_dir()
405 php_url *resource = NULL; in phar_wrapper_mkdir() local
426 if ((resource = phar_parse_url(wrapper, url_from, "w", options)) == NULL) { in phar_wrapper_mkdir()
431 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_mkdir()
432 php_url_free(resource); in phar_wrapper_mkdir()
437 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_mkdir()
438 php_url_free(resource); in phar_wrapper_mkdir()
443 host_len = ZSTR_LEN(resource->host); in phar_wrapper_mkdir()
445 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) { in phar_wrapper_mkdir()
446 …\"%s\", error retrieving phar information: %s", ZSTR_VAL(resource->path) + 1, ZSTR_VAL(resource->h… in phar_wrapper_mkdir()
448 php_url_free(resource); in phar_wrapper_mkdir()
452 …if ((e = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1,… in phar_wrapper_mkdir()
458 …"%s\" in phar \"%s\", directory already exists", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
459 php_url_free(resource); in phar_wrapper_mkdir()
464 …not create directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
466 php_url_free(resource); in phar_wrapper_mkdir()
470 …if (phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1, 0, &… in phar_wrapper_mkdir()
472 …ory \"%s\" in phar \"%s\", file already exists", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
473 php_url_free(resource); in phar_wrapper_mkdir()
478 …not create directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_mkdir()
480 php_url_free(resource); in phar_wrapper_mkdir()
491 entry.filename = estrdup(ZSTR_VAL(resource->path) + 1); in phar_wrapper_mkdir()
498 entry.filename_len = ZSTR_LEN(resource->path) - 1; in phar_wrapper_mkdir()
499 php_url_free(resource); in phar_wrapper_mkdir()
537 php_url *resource = NULL; in phar_wrapper_rmdir() local
561 if ((resource = phar_parse_url(wrapper, url, "w", options)) == NULL) { in phar_wrapper_rmdir()
566 if (!resource->scheme || !resource->host || !resource->path) { in phar_wrapper_rmdir()
567 php_url_free(resource); in phar_wrapper_rmdir()
572 if (!zend_string_equals_literal_ci(resource->scheme, "phar")) { in phar_wrapper_rmdir()
573 php_url_free(resource); in phar_wrapper_rmdir()
578 host_len = ZSTR_LEN(resource->host); in phar_wrapper_rmdir()
580 if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) { in phar_wrapper_rmdir()
581 … \"%s\", error retrieving phar information: %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_rmdir()
583 php_url_free(resource); in phar_wrapper_rmdir()
587 path_len = ZSTR_LEN(resource->path) - 1; in phar_wrapper_rmdir()
589 …if (!(entry = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, path_len, 2, &error, 1))… in phar_wrapper_rmdir()
591 …not remove directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_rmdir()
594 …"%s\" in phar \"%s\", directory does not exist", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->ho… in phar_wrapper_rmdir()
596 php_url_free(resource); in phar_wrapper_rmdir()
606 memcmp(ZSTR_VAL(str_key), ZSTR_VAL(resource->path)+1, path_len) == 0 && in phar_wrapper_rmdir()
613 php_url_free(resource); in phar_wrapper_rmdir()
623 memcmp(ZSTR_VAL(str_key), ZSTR_VAL(resource->path)+1, path_len) == 0 && in phar_wrapper_rmdir()
630 php_url_free(resource); in phar_wrapper_rmdir()
637 zend_hash_str_del(&phar->virtual_dirs, ZSTR_VAL(resource->path)+1, path_len); in phar_wrapper_rmdir()
647 php_url_free(resource); in phar_wrapper_rmdir()
653 php_url_free(resource); in phar_wrapper_rmdir()