phar               25 ext/phar/dirstream.c void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_dir);
phar              311 ext/phar/dirstream.c 	phar_archive_data *phar;
phar              342 ext/phar/dirstream.c 	if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
phar              360 ext/phar/dirstream.c 		ret = phar_make_dirstream(internal_file, &phar->manifest);
phar              365 ext/phar/dirstream.c 	if (!phar->manifest.u.flags) {
phar              370 ext/phar/dirstream.c 	if (NULL != (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, strlen(internal_file))) && !entry->is_dir) {
phar              380 ext/phar/dirstream.c 		return phar_make_dirstream(internal_file, &phar->manifest);
phar              385 ext/phar/dirstream.c 		zend_hash_internal_pointer_reset(&phar->manifest);
phar              386 ext/phar/dirstream.c 		while (FAILURE != zend_hash_has_more_elements(&phar->manifest)) {
phar              388 ext/phar/dirstream.c 					zend_hash_get_current_key(&phar->manifest, &str_key, &unused)) {
phar              394 ext/phar/dirstream.c 					return phar_make_dirstream(internal_file, &phar->manifest);
phar              398 ext/phar/dirstream.c 			if (SUCCESS != zend_hash_move_forward(&phar->manifest)) {
phar              415 ext/phar/dirstream.c 	phar_archive_data *phar = NULL;
phar              427 ext/phar/dirstream.c 	if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar              428 ext/phar/dirstream.c 		phar = NULL;
phar              434 ext/phar/dirstream.c 	if (PHAR_G(readonly) && (!phar || !phar->is_data)) {
phar              458 ext/phar/dirstream.c 	if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
phar              465 ext/phar/dirstream.c 	if ((e = phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 2, &error, 1))) {
phar              483 ext/phar/dirstream.c 	if (phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 0, &error, 1)) {
phar              500 ext/phar/dirstream.c 	if (phar->is_zip) {
phar              506 ext/phar/dirstream.c 	if (phar->is_tar) {
phar              514 ext/phar/dirstream.c 	entry.phar = phar;
phar              520 ext/phar/dirstream.c 	if (NULL == zend_hash_str_add_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
phar              521 ext/phar/dirstream.c 		php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", adding to manifest failed", entry.filename, phar->fname);
phar              527 ext/phar/dirstream.c 	phar_flush(phar, 0, 0, 0, &error);
phar              530 ext/phar/dirstream.c 		php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", entry.filename, phar->fname, error);
phar              531 ext/phar/dirstream.c 		zend_hash_str_del(&phar->manifest, entry.filename, entry.filename_len);
phar              536 ext/phar/dirstream.c 	phar_add_virtual_dirs(phar, entry.filename, entry.filename_len);
phar              547 ext/phar/dirstream.c 	phar_archive_data *phar = NULL;
phar              562 ext/phar/dirstream.c 	if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar              563 ext/phar/dirstream.c 		phar = NULL;
phar              569 ext/phar/dirstream.c 	if (PHAR_G(readonly) && (!phar || !phar->is_data)) {
phar              593 ext/phar/dirstream.c 	if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
phar              602 ext/phar/dirstream.c 	if (!(entry = phar_get_entry_info_dir(phar, resource->path + 1, path_len, 2, &error, 1))) {
phar              614 ext/phar/dirstream.c 		for (zend_hash_internal_pointer_reset(&phar->manifest);
phar              615 ext/phar/dirstream.c 			HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&phar->manifest, &str_key, &unused);
phar              616 ext/phar/dirstream.c 			zend_hash_move_forward(&phar->manifest)
phar              631 ext/phar/dirstream.c 		for (zend_hash_internal_pointer_reset(&phar->virtual_dirs);
phar              632 ext/phar/dirstream.c 			HASH_KEY_NON_EXISTENT != zend_hash_get_current_key(&phar->virtual_dirs, &str_key, &unused);
phar              633 ext/phar/dirstream.c 			zend_hash_move_forward(&phar->virtual_dirs)) {
phar              650 ext/phar/dirstream.c 		zend_hash_str_del(&phar->virtual_dirs, resource->path+1, path_len);
phar              656 ext/phar/dirstream.c 		phar_flush(phar, 0, 0, 0, &error);
phar              659 ext/phar/dirstream.c 			php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", entry->filename, phar->fname, error);
phar              133 ext/phar/func_interceptors.c 			phar_archive_data *phar;
phar              147 ext/phar/func_interceptors.c 			if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar              163 ext/phar/func_interceptors.c 					if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) {
phar              171 ext/phar/func_interceptors.c 					if (!zend_hash_str_exists(&(phar->manifest), entry, entry_len)) {
phar              255 ext/phar/func_interceptors.c 		phar_archive_data *phar;
phar              271 ext/phar/func_interceptors.c 		if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar              286 ext/phar/func_interceptors.c 				if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) {
phar              294 ext/phar/func_interceptors.c 				if (!zend_hash_str_exists(&(phar->manifest), entry, entry_len)) {
phar              356 ext/phar/func_interceptors.c 		phar_archive_data *phar;
phar              372 ext/phar/func_interceptors.c 		if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar              387 ext/phar/func_interceptors.c 				if (!zend_hash_str_exists(&(phar->manifest), entry + 1, entry_len - 1)) {
phar              395 ext/phar/func_interceptors.c 				if (!zend_hash_str_exists(&(phar->manifest), entry, entry_len)) {
phar              619 ext/phar/func_interceptors.c 		phar_archive_data *phar;
phar              636 ext/phar/func_interceptors.c 			phar = PHAR_G(last_phar);
phar              645 ext/phar/func_interceptors.c 			if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar              653 ext/phar/func_interceptors.c 				if (NULL != (data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
phar              659 ext/phar/func_interceptors.c 			if (NULL != (data = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len))) {
phar              663 ext/phar/func_interceptors.c 			if (zend_hash_str_exists(&(phar->virtual_dirs), entry, entry_len)) {
phar              673 ext/phar/func_interceptors.c 				sb.st_mtime.tv_sec = phar->max_timestamp;
phar              674 ext/phar/func_interceptors.c 				sb.st_atime.tv_sec = phar->max_timestamp;
phar              675 ext/phar/func_interceptors.c 				sb.st_ctime.tv_sec = phar->max_timestamp;
phar              677 ext/phar/func_interceptors.c 				sb.st_mtime = phar->max_timestamp;
phar              678 ext/phar/func_interceptors.c 				sb.st_atime = phar->max_timestamp;
phar              679 ext/phar/func_interceptors.c 				sb.st_ctime = phar->max_timestamp;
phar              697 ext/phar/func_interceptors.c 				if (NULL != (data = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
phar              707 ext/phar/func_interceptors.c 				if (zend_hash_str_exists(&(phar->virtual_dirs), entry + 1, entry_len - 1)) {
phar              719 ext/phar/func_interceptors.c 					sb.st_mtime.tv_sec = phar->max_timestamp;
phar              720 ext/phar/func_interceptors.c 					sb.st_atime.tv_sec = phar->max_timestamp;
phar              721 ext/phar/func_interceptors.c 					sb.st_ctime.tv_sec = phar->max_timestamp;
phar              723 ext/phar/func_interceptors.c 					sb.st_mtime = phar->max_timestamp;
phar              724 ext/phar/func_interceptors.c 					sb.st_atime = phar->max_timestamp;
phar              725 ext/phar/func_interceptors.c 					sb.st_ctime = phar->max_timestamp;
phar              779 ext/phar/func_interceptors.c 			if (!phar->is_writeable) {
phar              921 ext/phar/func_interceptors.c 			phar_archive_data *phar;
phar              928 ext/phar/func_interceptors.c 			if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar              933 ext/phar/func_interceptors.c 					if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
phar              941 ext/phar/func_interceptors.c 					if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len))) {
phar              988 ext/phar/func_interceptors.c 			phar_archive_data *phar;
phar              995 ext/phar/func_interceptors.c 			if (SUCCESS == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar             1000 ext/phar/func_interceptors.c 					if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry + 1, entry_len - 1))) {
phar             1008 ext/phar/func_interceptors.c 					if (NULL != (etemp = zend_hash_str_find_ptr(&(phar->manifest), entry, entry_len))) {
phar               29 ext/phar/phar.c ZEND_DECLARE_MODULE_GLOBALS(phar)
phar               38 ext/phar/phar.c 	phar_archive_data *phar = (phar_archive_data *)Z_PTR_P(zv);
phar               40 ext/phar/phar.c 	if (!phar->is_data) {
phar               41 ext/phar/phar.c 		phar->is_writeable = !keep;
phar              105 ext/phar/phar.c 	phar_archive_data *phar;
phar              138 ext/phar/phar.c 			if (SUCCESS == phar_open_from_filename(key, end - key, NULL, 0, 0, &phar, NULL)) {
phar              140 ext/phar/phar.c 				phar->phar_pos = i++;
phar              141 ext/phar/phar.c 				php_stream_close(phar->fp);
phar              142 ext/phar/phar.c 				phar->fp = NULL;
phar              161 ext/phar/phar.c 			if (SUCCESS == phar_open_from_filename(key, strlen(key), NULL, 0, 0, &phar, NULL)) {
phar              206 ext/phar/phar.c void phar_destroy_phar_data(phar_archive_data *phar) /* {{{ */
phar              208 ext/phar/phar.c 	if (phar->alias && phar->alias != phar->fname) {
phar              209 ext/phar/phar.c 		pefree(phar->alias, phar->is_persistent);
phar              210 ext/phar/phar.c 		phar->alias = NULL;
phar              213 ext/phar/phar.c 	if (phar->fname) {
phar              214 ext/phar/phar.c 		pefree(phar->fname, phar->is_persistent);
phar              215 ext/phar/phar.c 		phar->fname = NULL;
phar              218 ext/phar/phar.c 	if (phar->signature) {
phar              219 ext/phar/phar.c 		pefree(phar->signature, phar->is_persistent);
phar              220 ext/phar/phar.c 		phar->signature = NULL;
phar              223 ext/phar/phar.c 	if (phar->manifest.u.flags) {
phar              224 ext/phar/phar.c 		zend_hash_destroy(&phar->manifest);
phar              225 ext/phar/phar.c 		phar->manifest.u.flags = 0;
phar              228 ext/phar/phar.c 	if (phar->mounted_dirs.u.flags) {
phar              229 ext/phar/phar.c 		zend_hash_destroy(&phar->mounted_dirs);
phar              230 ext/phar/phar.c 		phar->mounted_dirs.u.flags = 0;
phar              233 ext/phar/phar.c 	if (phar->virtual_dirs.u.flags) {
phar              234 ext/phar/phar.c 		zend_hash_destroy(&phar->virtual_dirs);
phar              235 ext/phar/phar.c 		phar->virtual_dirs.u.flags = 0;
phar              238 ext/phar/phar.c 	if (Z_TYPE(phar->metadata) != IS_UNDEF) {
phar              239 ext/phar/phar.c 		if (phar->is_persistent) {
phar              240 ext/phar/phar.c 			if (phar->metadata_len) {
phar              242 ext/phar/phar.c 				free(Z_PTR(phar->metadata));
phar              244 ext/phar/phar.c 				zval_internal_ptr_dtor(&phar->metadata);
phar              247 ext/phar/phar.c 			zval_ptr_dtor(&phar->metadata);
phar              249 ext/phar/phar.c 		phar->metadata_len = 0;
phar              250 ext/phar/phar.c 		ZVAL_UNDEF(&phar->metadata);
phar              253 ext/phar/phar.c 	if (phar->fp) {
phar              254 ext/phar/phar.c 		php_stream_close(phar->fp);
phar              255 ext/phar/phar.c 		phar->fp = 0;
phar              258 ext/phar/phar.c 	if (phar->ufp) {
phar              259 ext/phar/phar.c 		php_stream_close(phar->ufp);
phar              260 ext/phar/phar.c 		phar->ufp = 0;
phar              263 ext/phar/phar.c 	pefree(phar, phar->is_persistent);
phar              270 ext/phar/phar.c int phar_archive_delref(phar_archive_data *phar) /* {{{ */
phar              272 ext/phar/phar.c 	if (phar->is_persistent) {
phar              276 ext/phar/phar.c 	if (--phar->refcount < 0) {
phar              278 ext/phar/phar.c 		|| zend_hash_str_del(&(PHAR_G(phar_fname_map)), phar->fname, phar->fname_len) != SUCCESS) {
phar              279 ext/phar/phar.c 			phar_destroy_phar_data(phar);
phar              282 ext/phar/phar.c 	} else if (!phar->refcount) {
phar              287 ext/phar/phar.c 		if (phar->fp && !(phar->flags & PHAR_FILE_COMPRESSION_MASK)) {
phar              292 ext/phar/phar.c 			php_stream_close(phar->fp);
phar              293 ext/phar/phar.c 			phar->fp = NULL;
phar              296 ext/phar/phar.c 		if (!zend_hash_num_elements(&phar->manifest)) {
phar              299 ext/phar/phar.c 			if (zend_hash_str_del(&(PHAR_G(phar_fname_map)), phar->fname, phar->fname_len) != SUCCESS) {
phar              300 ext/phar/phar.c 				phar_destroy_phar_data(phar);
phar              441 ext/phar/phar.c 		if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != idata->internal_file->fp) {
phar              451 ext/phar/phar.c 	phar_archive_delref(idata->phar);
phar              462 ext/phar/phar.c 	phar_archive_data *phar;
phar              464 ext/phar/phar.c 	phar = idata->phar;
phar              467 ext/phar/phar.c 		if (idata->fp && idata->fp != idata->phar->fp && idata->fp != idata->phar->ufp && idata->fp != idata->internal_file->fp) {
phar              470 ext/phar/phar.c 		zend_hash_str_del(&idata->phar->manifest, idata->internal_file->filename, idata->internal_file->filename_len);
phar              471 ext/phar/phar.c 		idata->phar->refcount--;
phar              478 ext/phar/phar.c 	if (!phar->donotflush) {
phar              479 ext/phar/phar.c 		phar_flush(phar, 0, 0, 0, error);
phar              534 ext/phar/phar.c 	phar_archive_data *phar;
phar              546 ext/phar/phar.c 	if (SUCCESS == phar_get_archive(&phar, unixfname, fname_len, alias, alias_len, error)
phar              547 ext/phar/phar.c 		&& ((alias && fname_len == phar->fname_len
phar              548 ext/phar/phar.c 		&& !strncmp(unixfname, phar->fname, fname_len)) || !alias)
phar              553 ext/phar/phar.c 	if (SUCCESS == phar_get_archive(&phar, fname, fname_len, alias, alias_len, error)
phar              554 ext/phar/phar.c 		&& ((alias && fname_len == phar->fname_len
phar              555 ext/phar/phar.c 		&& !strncmp(fname, phar->fname, fname_len)) || !alias)
phar              567 ext/phar/phar.c 			if (!phar->halt_offset && !phar->is_brandnew && (phar->is_tar || phar->is_zip)) {
phar              568 ext/phar/phar.c 				if (PHAR_G(readonly) && NULL == (stub = zend_hash_str_find_ptr(&(phar->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1))) {
phar              578 ext/phar/phar.c 			*pphar = phar;
phar              590 ext/phar/phar.c 		if (phar && error && !(options & REPORT_ERRORS)) {
phar             1055 ext/phar/phar.c 	entry.phar = mydata;
phar             2356 ext/phar/phar.c 		if (SUCCESS != phar_open_archive_fp(idata->phar)) {
phar             2357 ext/phar/phar.c 			spprintf(error, 0, "phar error: unable to open zip-based phar archive \"%s\" to verify local file header for file \"%s\"", idata->phar->fname, entry->filename);
phar             2364 ext/phar/phar.c 			spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (cannot read local file header for file \"%s\")", idata->phar->fname, entry->filename);
phar             2377 ext/phar/phar.c 				spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (cannot read local data descriptor for file \"%s\")", idata->phar->fname, entry->filename);
phar             2389 ext/phar/phar.c 			spprintf(error, 0, "phar error: internal corruption of zip-based phar \"%s\" (local header of file \"%s\" does not match central directory)", idata->phar->fname, entry->filename);
phar             2418 ext/phar/phar.c 		spprintf(error, 0, "phar error: internal corruption of phar \"%s\" (crc32 mismatch on file \"%s\")", idata->phar->fname, entry->filename);
phar             2495 ext/phar/phar.c int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int convert, char **error) /* {{{ */
phar             2516 ext/phar/phar.c 	if (phar->is_persistent) {
phar             2518 ext/phar/phar.c 			spprintf(error, 0, "internal error: attempt to flush cached zip-based phar \"%s\"", phar->fname);
phar             2527 ext/phar/phar.c 	if (!zend_hash_num_elements(&phar->manifest) && !user_stub) {
phar             2531 ext/phar/phar.c 	zend_hash_clean(&phar->virtual_dirs);
phar             2533 ext/phar/phar.c 	if (phar->is_zip) {
phar             2534 ext/phar/phar.c 		return phar_zip_flush(phar, user_stub, len, convert, error);
phar             2537 ext/phar/phar.c 	if (phar->is_tar) {
phar             2538 ext/phar/phar.c 		return phar_tar_flush(phar, user_stub, len, convert, error);
phar             2545 ext/phar/phar.c 	if (phar->fp && !phar->is_brandnew) {
phar             2546 ext/phar/phar.c 		oldfile = phar->fp;
phar             2550 ext/phar/phar.c 		oldfile = php_stream_open_wrapper(phar->fname, "rb", 0, NULL);
phar             2574 ext/phar/phar.c 					spprintf(error, 0, "unable to access resource to copy stub to new phar \"%s\"", phar->fname);
phar             2591 ext/phar/phar.c 					spprintf(error, 0, "unable to read resource to copy stub to new phar \"%s\"", phar->fname);
phar             2609 ext/phar/phar.c 				spprintf(error, 0, "illegal stub for phar \"%s\"", phar->fname);
phar             2626 ext/phar/phar.c 				spprintf(error, 0, "unable to create stub from string in new phar \"%s\"", phar->fname);
phar             2633 ext/phar/phar.c 		phar->halt_offset = len + 5;
phar             2640 ext/phar/phar.c 		if (!user_stub && phar->halt_offset && oldfile && !phar->is_brandnew) {
phar             2641 ext/phar/phar.c 			php_stream_copy_to_stream_ex(oldfile, newfile, phar->halt_offset, &written);
phar             2646 ext/phar/phar.c 			phar->halt_offset = ZSTR_LEN(newstub);
phar             2647 ext/phar/phar.c 			written = php_stream_write(newfile, ZSTR_VAL(newstub), phar->halt_offset);
phar             2649 ext/phar/phar.c 		if (phar->halt_offset != written) {
phar             2656 ext/phar/phar.c 					spprintf(error, 0, "unable to create stub in new phar \"%s\"", phar->fname);
phar             2658 ext/phar/phar.c 					spprintf(error, 0, "unable to copy stub of old phar to new phar \"%s\"", phar->fname);
phar             2676 ext/phar/phar.c 	zend_hash_apply(&phar->manifest, phar_flush_clean_deleted_apply);
phar             2680 ext/phar/phar.c 	if (Z_TYPE(phar->metadata) != IS_UNDEF) {
phar             2682 ext/phar/phar.c 		php_var_serialize(&main_metadata_str, &phar->metadata, &metadata_hash);
phar             2687 ext/phar/phar.c 	for (zend_hash_internal_pointer_reset(&phar->manifest);
phar             2688 ext/phar/phar.c 		zend_hash_has_more_elements(&phar->manifest) == SUCCESS;
phar             2689 ext/phar/phar.c 		zend_hash_move_forward(&phar->manifest)) {
phar             2690 ext/phar/phar.c 		if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
phar             2716 ext/phar/phar.c 		phar_add_virtual_dirs(phar, entry->filename, entry->filename_len);
phar             2750 ext/phar/phar.c 			newentry = phar_open_jit(phar, entry, error);
phar             2766 ext/phar/phar.c 				spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->fname);
phar             2790 ext/phar/phar.c 					spprintf(error, 0, "unable to gzip compress file \"%s\" to new phar \"%s\"", entry->filename, phar->fname);
phar             2794 ext/phar/phar.c 					spprintf(error, 0, "unable to bzip2 compress file \"%s\" to new phar \"%s\"", entry->filename, phar->fname);
phar             2821 ext/phar/phar.c 				spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->fname);
phar             2832 ext/phar/phar.c 				spprintf(error, 0, "unable to copy compressed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->fname);
phar             2859 ext/phar/phar.c 	restore_alias_len = phar->alias_len;
phar             2860 ext/phar/phar.c 	if (phar->is_temporary_alias) {
phar             2861 ext/phar/phar.c 		phar->alias_len = 0;
phar             2864 ext/phar/phar.c 	manifest_len = offset + phar->alias_len + sizeof(manifest) + (main_metadata_str.s ? ZSTR_LEN(main_metadata_str.s) : 0);
phar             2881 ext/phar/phar.c 	phar_set_32(manifest+14, phar->alias_len);
phar             2885 ext/phar/phar.c 	|| (size_t)phar->alias_len != php_stream_write(newfile, phar->alias, phar->alias_len)) {
phar             2892 ext/phar/phar.c 		phar->alias_len = restore_alias_len;
phar             2895 ext/phar/phar.c 			spprintf(error, 0, "unable to write manifest header of new phar \"%s\"", phar->fname);
phar             2901 ext/phar/phar.c 	phar->alias_len = restore_alias_len;
phar             2913 ext/phar/phar.c 		phar->alias_len = restore_alias_len;
phar             2916 ext/phar/phar.c 			spprintf(error, 0, "unable to write manifest meta-data of new phar \"%s\"", phar->fname);
phar             2927 ext/phar/phar.c 	for (zend_hash_internal_pointer_reset(&phar->manifest);
phar             2928 ext/phar/phar.c 		zend_hash_has_more_elements(&phar->manifest) == SUCCESS;
phar             2929 ext/phar/phar.c 		zend_hash_move_forward(&phar->manifest)) {
phar             2931 ext/phar/phar.c 		if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
phar             2956 ext/phar/phar.c 					spprintf(error, 0, "unable to write filename of directory \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->fname);
phar             2958 ext/phar/phar.c 					spprintf(error, 0, "unable to write filename of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->fname);
phar             2991 ext/phar/phar.c 				spprintf(error, 0, "unable to write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->fname);
phar             3016 ext/phar/phar.c 	for (zend_hash_internal_pointer_reset(&phar->manifest);
phar             3017 ext/phar/phar.c 		zend_hash_has_more_elements(&phar->manifest) == SUCCESS;
phar             3018 ext/phar/phar.c 		zend_hash_move_forward(&phar->manifest)) {
phar             3020 ext/phar/phar.c 		if ((entry = zend_hash_get_current_data_ptr(&phar->manifest)) == NULL) {
phar             3039 ext/phar/phar.c 					spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->fname);
phar             3051 ext/phar/phar.c 				spprintf(error, 0, "unable to seek to start of file \"%s\" while creating new phar \"%s\"", entry->filename, phar->fname);
phar             3067 ext/phar/phar.c 				spprintf(error, 0, "unable to write contents of file \"%s\" to new phar \"%s\"", entry->filename, phar->fname);
phar             3082 ext/phar/phar.c 			if (entry->fp_refcount == 0 && entry->fp != phar->fp && entry->fp != phar->ufp) {
phar             3099 ext/phar/phar.c 		if (phar->signature) {
phar             3100 ext/phar/phar.c 			efree(phar->signature);
phar             3101 ext/phar/phar.c 			phar->signature = NULL;
phar             3104 ext/phar/phar.c 		switch(phar->sig_flags) {
phar             3113 ext/phar/phar.c 					spprintf(error, 0, "unable to write contents of file \"%s\" to new phar \"%s\" with requested hash type", entry->filename, phar->fname);
phar             3121 ext/phar/phar.c 				if (FAILURE == phar_create_signature(phar, newfile, &digest, &digest_len, error)) {
phar             3139 ext/phar/phar.c 				if (phar->sig_flags == PHAR_SIG_OPENSSL) {
phar             3146 ext/phar/phar.c 		phar_set_32(sig_buf, phar->sig_flags);
phar             3154 ext/phar/phar.c 	if (phar->fp && free_fp) {
phar             3155 ext/phar/phar.c 		php_stream_close(phar->fp);
phar             3158 ext/phar/phar.c 	if (phar->ufp) {
phar             3160 ext/phar/phar.c 			php_stream_close(phar->ufp);
phar             3162 ext/phar/phar.c 		phar->ufp = NULL;
phar             3169 ext/phar/phar.c 	phar->internal_file_start = halt_offset + manifest_len + 4;
phar             3170 ext/phar/phar.c 	phar->halt_offset = halt_offset;
phar             3171 ext/phar/phar.c 	phar->is_brandnew = 0;
phar             3175 ext/phar/phar.c 	if (phar->donotflush) {
phar             3177 ext/phar/phar.c 		phar->fp = newfile;
phar             3179 ext/phar/phar.c 		phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, NULL);
phar             3180 ext/phar/phar.c 		if (!phar->fp) {
phar             3181 ext/phar/phar.c 			phar->fp = newfile;
phar             3183 ext/phar/phar.c 				spprintf(error, 4096, "unable to open new phar \"%s\" for writing", phar->fname);
phar             3188 ext/phar/phar.c 		if (phar->flags & PHAR_FILE_COMPRESSED_GZ) {
phar             3194 ext/phar/phar.c 			filter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp));
phar             3199 ext/phar/phar.c 					spprintf(error, 4096, "unable to compress all contents of phar \"%s\" using zlib, PHP versions older than 5.2.6 have a buggy zlib", phar->fname);
phar             3204 ext/phar/phar.c 			php_stream_filter_append(&phar->fp->writefilters, filter);
phar             3205 ext/phar/phar.c 			php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
phar             3208 ext/phar/phar.c 			php_stream_close(phar->fp);
phar             3210 ext/phar/phar.c 			phar->fp = newfile;
phar             3211 ext/phar/phar.c 		} else if (phar->flags & PHAR_FILE_COMPRESSED_BZ2) {
phar             3212 ext/phar/phar.c 			filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp));
phar             3213 ext/phar/phar.c 			php_stream_filter_append(&phar->fp->writefilters, filter);
phar             3214 ext/phar/phar.c 			php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
phar             3217 ext/phar/phar.c 			php_stream_close(phar->fp);
phar             3219 ext/phar/phar.c 			phar->fp = newfile;
phar             3221 ext/phar/phar.c 			php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
phar             3227 ext/phar/phar.c 	if (-1 == php_stream_seek(phar->fp, phar->halt_offset, SEEK_SET)) {
phar             3229 ext/phar/phar.c 			spprintf(error, 0, "unable to seek to __HALT_COMPILER(); in new phar \"%s\"", phar->fname);
phar             3242 ext/phar/phar.c ZEND_GET_MODULE(phar)
phar             3278 ext/phar/phar.c 	phar_archive_data *phar;
phar             3284 ext/phar/phar.c 		if (SUCCESS == phar_open_from_filename((char*)file_handle->filename, strlen(file_handle->filename), NULL, 0, 0, &phar, NULL)) {
phar             3285 ext/phar/phar.c 			if (phar->is_zip || phar->is_tar) {
phar             3302 ext/phar/phar.c 			} else if (phar->flags & PHAR_FILE_COMPRESSION_MASK) {
phar             3306 ext/phar/phar.c 				file_handle->handle.stream.handle  = phar;
phar             3311 ext/phar/phar.c 				phar->is_persistent ?
phar             3312 ext/phar/phar.c 					php_stream_rewind(PHAR_G(cached_fp)[phar->phar_pos].fp) :
phar             3313 ext/phar/phar.c 					php_stream_rewind(phar->fp);
phar             3348 ext/phar/phar.c PHP_GINIT_FUNCTION(phar) /* {{{ */
phar             3411 ext/phar/phar.c PHP_GSHUTDOWN_FUNCTION(phar) /* {{{ */
phar             3417 ext/phar/phar.c PHP_MINIT_FUNCTION(phar) /* {{{ */
phar             3436 ext/phar/phar.c PHP_MSHUTDOWN_FUNCTION(phar) /* {{{ */
phar             3491 ext/phar/phar.c PHP_RSHUTDOWN_FUNCTION(phar) /* {{{ */
phar             3538 ext/phar/phar.c PHP_MINFO_FUNCTION(phar) /* {{{ */
phar             3606 ext/phar/phar.c 	PHP_MINIT(phar),
phar             3607 ext/phar/phar.c 	PHP_MSHUTDOWN(phar),
phar             3609 ext/phar/phar.c 	PHP_RSHUTDOWN(phar),
phar             3610 ext/phar/phar.c 	PHP_MINFO(phar),
phar             3612 ext/phar/phar.c 	PHP_MODULE_GLOBALS(phar),   /* globals descriptor */
phar             3613 ext/phar/phar.c 	PHP_GINIT(phar),            /* globals ctor */
phar             3614 ext/phar/phar.c 	PHP_GSHUTDOWN(phar),        /* globals dtor */
phar              138 ext/phar/phar_internal.h ZEND_BEGIN_MODULE_GLOBALS(phar)
phar              195 ext/phar/phar_internal.h ZEND_END_MODULE_GLOBALS(phar)
phar              197 ext/phar/phar_internal.h ZEND_EXTERN_MODULE_GLOBALS(phar)
phar              198 ext/phar/phar_internal.h #define PHAR_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(phar, v)
phar              259 ext/phar/phar_internal.h 	phar_archive_data        *phar;
phar              347 ext/phar/phar_internal.h 		return entry->phar->fp;
phar              349 ext/phar/phar_internal.h 	return PHAR_G(cached_fp)[entry->phar->phar_pos].fp;
phar              355 ext/phar/phar_internal.h 		return entry->phar->ufp;
phar              357 ext/phar/phar_internal.h 	return PHAR_G(cached_fp)[entry->phar->phar_pos].ufp;
phar              362 ext/phar/phar_internal.h 	if (!entry->phar->is_persistent) {
phar              363 ext/phar/phar_internal.h 		entry->phar->fp =  fp;
phar              367 ext/phar/phar_internal.h 	PHAR_G(cached_fp)[entry->phar->phar_pos].fp = fp;
phar              372 ext/phar/phar_internal.h 	if (!entry->phar->is_persistent) {
phar              373 ext/phar/phar_internal.h 		entry->phar->ufp =  fp;
phar              377 ext/phar/phar_internal.h 	PHAR_G(cached_fp)[entry->phar->phar_pos].ufp = fp;
phar              380 ext/phar/phar_internal.h static inline php_stream *phar_get_pharfp(phar_archive_data *phar)
phar              382 ext/phar/phar_internal.h 	if (!phar->is_persistent) {
phar              383 ext/phar/phar_internal.h 		return phar->fp;
phar              385 ext/phar/phar_internal.h 	return PHAR_G(cached_fp)[phar->phar_pos].fp;
phar              388 ext/phar/phar_internal.h static inline php_stream *phar_get_pharufp(phar_archive_data *phar)
phar              390 ext/phar/phar_internal.h 	if (!phar->is_persistent) {
phar              391 ext/phar/phar_internal.h 		return phar->ufp;
phar              393 ext/phar/phar_internal.h 	return PHAR_G(cached_fp)[phar->phar_pos].ufp;
phar              396 ext/phar/phar_internal.h static inline void phar_set_pharfp(phar_archive_data *phar, php_stream *fp)
phar              398 ext/phar/phar_internal.h 	if (!phar->is_persistent) {
phar              399 ext/phar/phar_internal.h 		phar->fp =  fp;
phar              403 ext/phar/phar_internal.h 	PHAR_G(cached_fp)[phar->phar_pos].fp = fp;
phar              406 ext/phar/phar_internal.h static inline void phar_set_pharufp(phar_archive_data *phar, php_stream *fp)
phar              408 ext/phar/phar_internal.h 	if (!phar->is_persistent) {
phar              409 ext/phar/phar_internal.h 		phar->ufp =  fp;
phar              413 ext/phar/phar_internal.h 	PHAR_G(cached_fp)[phar->phar_pos].ufp = fp;
phar              425 ext/phar/phar_internal.h 	data = &(PHAR_G(cached_fp)[entry->phar->phar_pos].manifest[entry->manifest_pos]);
phar              435 ext/phar/phar_internal.h 	return PHAR_G(cached_fp)[entry->phar->phar_pos].manifest[entry->manifest_pos].fp_type;
phar              443 ext/phar/phar_internal.h 	if (PHAR_G(cached_fp)[entry->phar->phar_pos].manifest[entry->manifest_pos].fp_type == PHAR_FP) {
phar              444 ext/phar/phar_internal.h 		if (!PHAR_G(cached_fp)[entry->phar->phar_pos].manifest[entry->manifest_pos].offset) {
phar              445 ext/phar/phar_internal.h 			PHAR_G(cached_fp)[entry->phar->phar_pos].manifest[entry->manifest_pos].offset = entry->offset;
phar              448 ext/phar/phar_internal.h 	return PHAR_G(cached_fp)[entry->phar->phar_pos].manifest[entry->manifest_pos].offset;
phar              464 ext/phar/phar_internal.h 	phar_archive_data        *phar;
phar              529 ext/phar/phar_internal.h 	tmp_len = MIN(MAXPATHLEN, entry->filename_len + entry->phar->fname_len);
phar              531 ext/phar/phar_internal.h 	len1 = MIN(entry->phar->fname_len, tmp_len);
phar              532 ext/phar/phar_internal.h 	memcpy(tmp, entry->phar->fname, len1);
phar              544 ext/phar/phar_internal.h void phar_destroy_phar_data(phar_archive_data *phar);
phar              546 ext/phar/phar_internal.h int phar_open_entry_file(phar_archive_data *phar, phar_entry_info *entry, char **error);
phar              552 ext/phar/phar_internal.h int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len);
phar              556 ext/phar/phar_internal.h int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error);
phar              563 ext/phar/phar_internal.h void phar_remove_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len);
phar              564 ext/phar/phar_internal.h void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len);
phar              565 ext/phar/phar_internal.h int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *path, int path_len);
phar              568 ext/phar/phar_internal.h phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error);
phar              576 ext/phar/phar_internal.h int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error);
phar              578 ext/phar/phar_internal.h int phar_open_archive_fp(phar_archive_data *phar);
phar              585 ext/phar/phar_internal.h int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error);
phar              600 ext/phar/phar_internal.h int phar_archive_delref(phar_archive_data *phar);
phar              603 ext/phar/phar_internal.h phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security);
phar              604 ext/phar/phar_internal.h phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security);
phar              145 ext/phar/phar_object.c static int phar_file_action(phar_archive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, int entry_len, char *arch, char *basename, char *ru, int ru_len) /* {{{ */
phar              197 ext/phar/phar_object.c 				if (!phar_open_jit(phar, info, &error)) {
phar              325 ext/phar/phar_object.c static void phar_do_404(phar_archive_data *phar, char *fname, int fname_len, char *f404, size_t f404_len, char *entry, size_t entry_len) /* {{{ */
phar              330 ext/phar/phar_object.c 	if (phar && f404_len) {
phar              331 ext/phar/phar_object.c 		info = phar_get_entry_info(phar, f404, f404_len, NULL, 1);
phar              334 ext/phar/phar_object.c 			phar_file_action(phar, info, "text/html", PHAR_MIME_PHP, f404, f404_len, fname, NULL, NULL, 0);
phar              555 ext/phar/phar_object.c 	phar_archive_data *phar = NULL;
phar              752 ext/phar/phar_object.c 		if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) ||
phar              753 ext/phar/phar_object.c 			(info = phar_get_entry_info(phar, entry, entry_len, NULL, 0)) == NULL) {
phar              754 ext/phar/phar_object.c 			phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len);
phar              798 ext/phar/phar_object.c 	if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, NULL) ||
phar              799 ext/phar/phar_object.c 		(info = phar_get_entry_info(phar, entry, entry_len, NULL, 0)) == NULL) {
phar              800 ext/phar/phar_object.c 		phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len);
phar              856 ext/phar/phar_object.c 	phar_file_action(phar, info, mime_type, code, entry, entry_len, fname, pt, ru, ru_len);
phar             1080 ext/phar/phar_object.c 	phar_archive_data *phar = (phar_archive_data *) object->oth;
phar             1082 ext/phar/phar_object.c 	if (!phar->is_persistent) {
phar             1083 ext/phar/phar_object.c 		phar_archive_delref(phar);
phar             1308 ext/phar/phar_object.c 	phar_archive_data *phar;
phar             1319 ext/phar/phar_object.c 	if (FAILURE == phar_open_from_filename(fname, fname_len, NULL, 0, REPORT_ERRORS, &phar, &error)) {
phar             1343 ext/phar/phar_object.c 	if (phar->is_persistent) {
phar             1348 ext/phar/phar_object.c 	if (phar->refcount) {
phar             1353 ext/phar/phar_object.c 	fname = estrndup(phar->fname, phar->fname_len);
phar             1359 ext/phar/phar_object.c 	phar_archive_delref(phar);
phar             1962 ext/phar/phar_object.c 				"Cannot convert phar archive \"%s\", unable to open entry \"%s\" contents: %s", entry->phar->fname, entry->filename, error);
phar             1966 ext/phar/phar_object.c 				"Cannot convert phar archive \"%s\", unable to open entry \"%s\" contents", entry->phar->fname, entry->filename);
phar             1982 ext/phar/phar_object.c 			"Cannot convert phar archive \"%s\", unable to copy entry \"%s\" contents", entry->phar->fname, entry->filename);
phar             2002 ext/phar/phar_object.c 	phar_archive_data *phar = *sphar;
phar             2016 ext/phar/phar_object.c 		if (phar->is_zip) {
phar             2018 ext/phar/phar_object.c 			if (phar->is_data) {
phar             2024 ext/phar/phar_object.c 		} else if (phar->is_tar) {
phar             2026 ext/phar/phar_object.c 			switch (phar->flags) {
phar             2028 ext/phar/phar_object.c 					if (phar->is_data) {
phar             2035 ext/phar/phar_object.c 					if (phar->is_data) {
phar             2042 ext/phar/phar_object.c 					if (phar->is_data) {
phar             2050 ext/phar/phar_object.c 			switch (phar->flags) {
phar             2063 ext/phar/phar_object.c 		if (phar->is_data) {
phar             2064 ext/phar/phar_object.c 			zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
phar             2066 ext/phar/phar_object.c 			zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar converted from \"%s\" has invalid extension %s", phar->fname, ext);
phar             2075 ext/phar/phar_object.c 	oldpath = estrndup(phar->fname, phar->fname_len);
phar             2076 ext/phar/phar_object.c 	if ((oldname = zend_memrchr(phar->fname, '/', phar->fname_len))) {
phar             2079 ext/phar/phar_object.c 		oldname = phar->fname;
phar             2090 ext/phar/phar_object.c 	phar->fname_len = spprintf(&newpath, 0, "%s%s", basepath, newname);
phar             2091 ext/phar/phar_object.c 	phar->fname = newpath;
phar             2092 ext/phar/phar_object.c 	phar->ext = newpath + phar->fname_len - strlen(ext) - 1;
phar             2096 ext/phar/phar_object.c 	if (PHAR_G(manifest_cached) && NULL != (pphar = zend_hash_str_find_ptr(&cached_phars, newpath, phar->fname_len))) {
phar             2098 ext/phar/phar_object.c 		zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars, new phar name is in phar.cache_list", phar->fname);
phar             2102 ext/phar/phar_object.c 	if (NULL != (pphar = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), newpath, phar->fname_len))) {
phar             2103 ext/phar/phar_object.c 		if (pphar->fname_len == phar->fname_len && !memcmp(pphar->fname, phar->fname, phar->fname_len)) {
phar             2104 ext/phar/phar_object.c 			if (!zend_hash_num_elements(&phar->manifest)) {
phar             2105 ext/phar/phar_object.c 				pphar->is_tar = phar->is_tar;
phar             2106 ext/phar/phar_object.c 				pphar->is_zip = phar->is_zip;
phar             2107 ext/phar/phar_object.c 				pphar->is_data = phar->is_data;
phar             2108 ext/phar/phar_object.c 				pphar->flags = phar->flags;
phar             2109 ext/phar/phar_object.c 				pphar->fp = phar->fp;
phar             2110 ext/phar/phar_object.c 				phar->fp = NULL;
phar             2111 ext/phar/phar_object.c 				phar_destroy_phar_data(phar);
phar             2113 ext/phar/phar_object.c 				phar = pphar;
phar             2114 ext/phar/phar_object.c 				phar->refcount++;
phar             2121 ext/phar/phar_object.c 		zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars, a phar with that name already exists", phar->fname);
phar             2130 ext/phar/phar_object.c 	if (!phar->is_data) {
phar             2131 ext/phar/phar_object.c 		if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &(phar->ext_len), 1, 1, 1)) {
phar             2133 ext/phar/phar_object.c 			zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "phar \"%s\" has invalid extension %s", phar->fname, ext);
phar             2137 ext/phar/phar_object.c 		if (phar->alias) {
phar             2138 ext/phar/phar_object.c 			if (phar->is_temporary_alias) {
phar             2139 ext/phar/phar_object.c 				phar->alias = NULL;
phar             2140 ext/phar/phar_object.c 				phar->alias_len = 0;
phar             2142 ext/phar/phar_object.c 				phar->alias = estrndup(newpath, strlen(newpath));
phar             2143 ext/phar/phar_object.c 				phar->alias_len = strlen(newpath);
phar             2144 ext/phar/phar_object.c 				phar->is_temporary_alias = 1;
phar             2145 ext/phar/phar_object.c 				zend_hash_str_update_ptr(&(PHAR_G(phar_alias_map)), newpath, phar->fname_len, phar);
phar             2151 ext/phar/phar_object.c 		if (SUCCESS != phar_detect_phar_fname_ext(newpath, phar->fname_len, (const char **) &(phar->ext), &(phar->ext_len), 0, 1, 1)) {
phar             2153 ext/phar/phar_object.c 			zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "data phar \"%s\" has invalid extension %s", phar->fname, ext);
phar             2157 ext/phar/phar_object.c 		phar->alias = NULL;
phar             2158 ext/phar/phar_object.c 		phar->alias_len = 0;
phar             2161 ext/phar/phar_object.c 	if ((!pphar || phar == pphar) && NULL == zend_hash_str_update_ptr(&(PHAR_G(phar_fname_map)), newpath, phar->fname_len, phar)) {
phar             2163 ext/phar/phar_object.c 		zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to add newly converted phar \"%s\" to the list of phars", phar->fname);
phar             2167 ext/phar/phar_object.c 	phar_flush(phar, 0, 0, 1, &error);
phar             2178 ext/phar/phar_object.c 	if (phar->is_data) {
phar             2187 ext/phar/phar_object.c 		zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate phar object when converting archive \"%s\"", phar->fname);
phar             2191 ext/phar/phar_object.c 	ZVAL_STRINGL(&arg1, phar->fname, phar->fname_len);
phar             2201 ext/phar/phar_object.c 	phar_archive_data *phar;
phar             2209 ext/phar/phar_object.c 	phar = (phar_archive_data *) ecalloc(1, sizeof(phar_archive_data));
phar             2211 ext/phar/phar_object.c 	phar->flags = flags;
phar             2212 ext/phar/phar_object.c 	phar->is_data = source->is_data;
phar             2216 ext/phar/phar_object.c 			phar->is_tar = 1;
phar             2219 ext/phar/phar_object.c 			phar->is_zip = 1;
phar             2222 ext/phar/phar_object.c 			phar->is_data = 0;
phar             2226 ext/phar/phar_object.c 	zend_hash_init(&(phar->manifest), sizeof(phar_entry_info),
phar             2228 ext/phar/phar_object.c 	zend_hash_init(&phar->mounted_dirs, sizeof(char *),
phar             2230 ext/phar/phar_object.c 	zend_hash_init(&phar->virtual_dirs, sizeof(char *),
phar             2233 ext/phar/phar_object.c 	phar->fp = php_stream_fopen_tmpfile();
phar             2234 ext/phar/phar_object.c 	if (phar->fp == NULL) {
phar             2238 ext/phar/phar_object.c 	phar->fname = source->fname;
phar             2239 ext/phar/phar_object.c 	phar->fname_len = source->fname_len;
phar             2240 ext/phar/phar_object.c 	phar->is_temporary_alias = source->is_temporary_alias;
phar             2241 ext/phar/phar_object.c 	phar->alias = source->alias;
phar             2244 ext/phar/phar_object.c 		ZVAL_DUP(&phar->metadata, &source->metadata);
phar             2245 ext/phar/phar_object.c 		phar->metadata_len = 0;
phar             2265 ext/phar/phar_object.c 		if (FAILURE == phar_copy_file_contents(&newentry, phar->fp)) {
phar             2266 ext/phar/phar_object.c 			zend_hash_destroy(&(phar->manifest));
phar             2267 ext/phar/phar_object.c 			php_stream_close(phar->fp);
phar             2268 ext/phar/phar_object.c 			efree(phar);
phar             2280 ext/phar/phar_object.c 		newentry.is_zip = phar->is_zip;
phar             2281 ext/phar/phar_object.c 		newentry.is_tar = phar->is_tar;
phar             2288 ext/phar/phar_object.c 		newentry.phar = phar;
phar             2291 ext/phar/phar_object.c 		zend_hash_str_add_mem(&(phar->manifest), newentry.filename, newentry.filename_len, (void*)&newentry, sizeof(phar_entry_info));
phar             2292 ext/phar/phar_object.c 		phar_add_virtual_dirs(phar, newentry.filename, newentry.filename_len);
phar             2295 ext/phar/phar_object.c 	if ((ret = phar_rename_archive(&phar, ext, 0))) {
phar             2298 ext/phar/phar_object.c 		if(phar != NULL) {
phar             2299 ext/phar/phar_object.c 			zend_hash_destroy(&(phar->manifest));
phar             2300 ext/phar/phar_object.c 			zend_hash_destroy(&(phar->mounted_dirs));
phar             2301 ext/phar/phar_object.c 			zend_hash_destroy(&(phar->virtual_dirs));
phar             2302 ext/phar/phar_object.c 			if (phar->fp) {
phar             2303 ext/phar/phar_object.c 				php_stream_close(phar->fp);
phar             2305 ext/phar/phar_object.c 			efree(phar->fname);
phar             2306 ext/phar/phar_object.c 			efree(phar);
phar             3479 ext/phar/phar_object.c 	zend_hash_str_add_mem(&oldentry->phar->manifest, newfile, newfile_len, &newentry, sizeof(phar_entry_info));
phar             3623 ext/phar/phar_object.c 		if (pphar[0] != data->phar) {
phar             3624 ext/phar/phar_object.c 			*pphar = data->phar;
phar             3659 ext/phar/phar_object.c 		if (data->phar != *pphar) {
phar             3660 ext/phar/phar_object.c 			*pphar = data->phar;
phar             4364 ext/phar/phar_object.c 		phar_archive_data *phar;
phar             4366 ext/phar/phar_object.c 		phar = phar_obj->archive;
phar             4368 ext/phar/phar_object.c 		if (!zend_hash_num_elements(&(phar->manifest))) {
phar             4372 ext/phar/phar_object.c 		ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) {
phar             4375 ext/phar/phar_object.c 					"Extraction from phar \"%s\" failed: %s", phar->fname, error);
phar             4594 ext/phar/phar_object.c 	if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
phar             4595 ext/phar/phar_object.c 		zend_throw_exception_ex(phar_ce_PharException, 0, "Cannot modify permissions for file \"%s\" in phar \"%s\", write operations are prohibited", entry_obj->entry->filename, entry_obj->entry->phar->fname);
phar             4604 ext/phar/phar_object.c 		phar_archive_data *phar = entry_obj->entry->phar;
phar             4606 ext/phar/phar_object.c 		if (FAILURE == phar_copy_on_write(&phar)) {
phar             4607 ext/phar/phar_object.c 			zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
phar             4611 ext/phar/phar_object.c 		entry_obj->entry = zend_hash_str_find_ptr(&phar->manifest, entry_obj->entry->filename, entry_obj->entry->filename_len);
phar             4618 ext/phar/phar_object.c 	entry_obj->entry->phar->is_modified = 1;
phar             4633 ext/phar/phar_object.c 	phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
phar             4691 ext/phar/phar_object.c 	if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
phar             4707 ext/phar/phar_object.c 		phar_archive_data *phar = entry_obj->entry->phar;
phar             4709 ext/phar/phar_object.c 		if (FAILURE == phar_copy_on_write(&phar)) {
phar             4710 ext/phar/phar_object.c 			zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
phar             4714 ext/phar/phar_object.c 		entry_obj->entry = zend_hash_str_find_ptr(&phar->manifest, entry_obj->entry->filename, entry_obj->entry->filename_len);
phar             4724 ext/phar/phar_object.c 	entry_obj->entry->phar->is_modified = 1;
phar             4725 ext/phar/phar_object.c 	phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
phar             4747 ext/phar/phar_object.c 	if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
phar             4760 ext/phar/phar_object.c 			phar_archive_data *phar = entry_obj->entry->phar;
phar             4762 ext/phar/phar_object.c 			if (FAILURE == phar_copy_on_write(&phar)) {
phar             4763 ext/phar/phar_object.c 				zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
phar             4767 ext/phar/phar_object.c 			entry_obj->entry = zend_hash_str_find_ptr(&phar->manifest, entry_obj->entry->filename, entry_obj->entry->filename_len);
phar             4772 ext/phar/phar_object.c 		entry_obj->entry->phar->is_modified = 1;
phar             4774 ext/phar/phar_object.c 		phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
phar             4808 ext/phar/phar_object.c 			"Phar error: Cannot retrieve contents, \"%s\" in phar \"%s\" is a directory", entry_obj->entry->filename, entry_obj->entry->phar->fname);
phar             4820 ext/phar/phar_object.c 			"Phar error: Cannot retrieve contents, \"%s\" in phar \"%s\": %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error);
phar             4827 ext/phar/phar_object.c 			"Phar error: Cannot retrieve contents of \"%s\" in phar \"%s\"", entry_obj->entry->filename, entry_obj->entry->phar->fname);
phar             4866 ext/phar/phar_object.c 	if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
phar             4879 ext/phar/phar_object.c 		phar_archive_data *phar = entry_obj->entry->phar;
phar             4881 ext/phar/phar_object.c 		if (FAILURE == phar_copy_on_write(&phar)) {
phar             4882 ext/phar/phar_object.c 			zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
phar             4886 ext/phar/phar_object.c 		entry_obj->entry = zend_hash_str_find_ptr(&phar->manifest, entry_obj->entry->filename, entry_obj->entry->filename_len);
phar             4904 ext/phar/phar_object.c 						"Phar error: Cannot decompress bzip2-compressed file \"%s\" in phar \"%s\" in order to compress with gzip: %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error);
phar             4935 ext/phar/phar_object.c 						"Phar error: Cannot decompress gzip-compressed file \"%s\" in phar \"%s\" in order to compress with bzip2: %s", entry_obj->entry->filename, entry_obj->entry->phar->fname, error);
phar             4955 ext/phar/phar_object.c 	entry_obj->entry->phar->is_modified = 1;
phar             4957 ext/phar/phar_object.c 	phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
phar             4990 ext/phar/phar_object.c 	if (PHAR_G(readonly) && !entry_obj->entry->phar->is_data) {
phar             5015 ext/phar/phar_object.c 		phar_archive_data *phar = entry_obj->entry->phar;
phar             5017 ext/phar/phar_object.c 		if (FAILURE == phar_copy_on_write(&phar)) {
phar             5018 ext/phar/phar_object.c 			zend_throw_exception_ex(phar_ce_PharException, 0, "phar \"%s\" is persistent, unable to copy on write", phar->fname);
phar             5022 ext/phar/phar_object.c 		entry_obj->entry = zend_hash_str_find_ptr(&phar->manifest, entry_obj->entry->filename, entry_obj->entry->filename_len);
phar             5025 ext/phar/phar_object.c 		if (FAILURE == phar_open_archive_fp(entry_obj->entry->phar)) {
phar             5026 ext/phar/phar_object.c 			zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Cannot decompress entry \"%s\", phar error: Cannot open phar archive \"%s\" for reading", entry_obj->entry->filename, entry_obj->entry->phar->fname);
phar             5034 ext/phar/phar_object.c 	entry_obj->entry->phar->is_modified = 1;
phar             5036 ext/phar/phar_object.c 	phar_flush(entry_obj->entry->phar, 0, 0, 0, &error);
phar              104 ext/phar/stream.c 		phar_archive_data *pphar = NULL, *phar;
phar              116 ext/phar/stream.c 		if (phar_open_or_create_filename(resource->host, arch_len, NULL, 0, 0, options, &phar, &error) == FAILURE)
phar              127 ext/phar/stream.c 		if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) {
phar              160 ext/phar/stream.c 	phar_archive_data *phar;
phar              231 ext/phar/stream.c 				idata->phar->is_modified = 1;
phar              235 ext/phar/stream.c 			*opened_path = strpprintf(MAXPATHLEN, "phar://%s/%s", idata->phar->fname, idata->internal_file->filename);
phar              241 ext/phar/stream.c 			if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, NULL)) {
phar              247 ext/phar/stream.c 			if (phar->is_tar || phar->is_zip) {
phar              253 ext/phar/stream.c 					*opened_path = strpprintf(MAXPATHLEN, "%s", phar->fname);
phar              264 ext/phar/stream.c 				entry->phar = phar;
phar              266 ext/phar/stream.c 				entry->compressed_filesize = entry->uncompressed_filesize = phar->halt_offset;
phar              270 ext/phar/stream.c 				idata->fp = phar_get_pharfp(phar);
phar              271 ext/phar/stream.c 				idata->phar = phar;
phar              273 ext/phar/stream.c 				if (!phar->is_persistent) {
phar              274 ext/phar/stream.c 					++(entry->phar->refcount);
phar              279 ext/phar/stream.c 					*opened_path = strpprintf(MAXPATHLEN, "%s", phar->fname);
phar              301 ext/phar/stream.c 		fprintf(stderr, "Pharname:   %s\n", idata->phar->filename);
phar              323 ext/phar/stream.c 		if ((idata->phar->is_tar || idata->phar->is_zip) && idata->internal_file->filename_len == sizeof(".phar/stub.php")-1 && !strncmp(idata->internal_file->filename, ".phar/stub.php", sizeof(".phar/stub.php")-1)) {
phar              336 ext/phar/stream.c 		*opened_path = strpprintf(MAXPATHLEN, "phar://%s/%s", idata->phar->fname, idata->internal_file->filename);
phar              443 ext/phar/stream.c 		php_stream_wrapper_log_error(stream->wrapper, stream->flags, "phar error: Could not write %d characters to \"%s\" in phar \"%s\"", (int) count, data->internal_file->filename, data->phar->fname);
phar              468 ext/phar/stream.c 		ret = phar_flush(data->phar, 0, 0, 0, &error);
phar              484 ext/phar/stream.c void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_statbuf *ssb, zend_bool is_temp_dir)
phar              521 ext/phar/stream.c 		ssb->sb.st_mtime.tv_sec = phar->max_timestamp;
phar              522 ext/phar/stream.c 		ssb->sb.st_atime.tv_sec = phar->max_timestamp;
phar              523 ext/phar/stream.c 		ssb->sb.st_ctime.tv_sec = phar->max_timestamp;
phar              525 ext/phar/stream.c 		ssb->sb.st_mtime = phar->max_timestamp;
phar              526 ext/phar/stream.c 		ssb->sb.st_atime = phar->max_timestamp;
phar              527 ext/phar/stream.c 		ssb->sb.st_ctime = phar->max_timestamp;
phar              530 ext/phar/stream.c 	if (!phar->is_writeable) {
phar              561 ext/phar/stream.c 	phar_dostat(data->phar, data->internal_file, ssb, 0);
phar              574 ext/phar/stream.c 	phar_archive_data *phar;
phar              599 ext/phar/stream.c 	if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
phar              611 ext/phar/stream.c 		phar_dostat(phar, NULL, ssb, 1);
phar              615 ext/phar/stream.c 	if (!phar->manifest.u.flags) {
phar              621 ext/phar/stream.c 	if (NULL != (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) {
phar              622 ext/phar/stream.c 		phar_dostat(phar, entry, ssb, 0);
phar              626 ext/phar/stream.c 	if (zend_hash_str_exists(&(phar->virtual_dirs), internal_file, internal_file_len)) {
phar              627 ext/phar/stream.c 		phar_dostat(phar, NULL, ssb, 1);
phar              632 ext/phar/stream.c 	if (phar->mounted_dirs.u.flags && zend_hash_num_elements(&phar->mounted_dirs)) {
phar              635 ext/phar/stream.c 		ZEND_HASH_FOREACH_STR_KEY(&phar->mounted_dirs, str_key) {
phar              643 ext/phar/stream.c 				if (NULL == (entry = zend_hash_find_ptr(&phar->manifest, str_key))) {
phar              655 ext/phar/stream.c 				if (SUCCESS != phar_mount_entry(phar, test, test_len, internal_file, internal_file_len)) {
phar              660 ext/phar/stream.c 				if (NULL == (entry = zend_hash_str_find_ptr(&phar->manifest, internal_file, internal_file_len))) {
phar              663 ext/phar/stream.c 				phar_dostat(phar, entry, ssb, 0);
phar              756 ext/phar/stream.c 	phar_archive_data *phar, *pfrom, *pto;
phar              835 ext/phar/stream.c 	if (SUCCESS != phar_get_archive(&phar, resource_from->host, host_len, NULL, 0, &error)) {
phar              843 ext/phar/stream.c 	if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) {
phar              850 ext/phar/stream.c 	if (NULL != (entry = zend_hash_str_find_ptr(&(phar->manifest), resource_from->path+1, strlen(resource_from->path)-1))) {
phar              870 ext/phar/stream.c 		entry = zend_hash_str_add_mem(&(phar->manifest), resource_to->path+1, strlen(resource_to->path)-1, (void **)&new, sizeof(phar_entry_info));
phar              878 ext/phar/stream.c 			zend_hash_str_del(&(phar->manifest), entry->filename, strlen(entry->filename));
phar              886 ext/phar/stream.c 		is_dir = zend_hash_str_exists(&(phar->virtual_dirs), resource_from->path+1, strlen(resource_from->path)-1);
phar              905 ext/phar/stream.c 		ZEND_HASH_FOREACH_BUCKET(&phar->manifest, b) {
phar              930 ext/phar/stream.c 		zend_hash_rehash(&phar->manifest);
phar              932 ext/phar/stream.c 		ZEND_HASH_FOREACH_BUCKET(&phar->virtual_dirs, b) {
phar              948 ext/phar/stream.c 		zend_hash_rehash(&phar->virtual_dirs);
phar              950 ext/phar/stream.c 		ZEND_HASH_FOREACH_BUCKET(&phar->mounted_dirs, b) {
phar              966 ext/phar/stream.c 		zend_hash_rehash(&phar->mounted_dirs);
phar              970 ext/phar/stream.c 		phar_flush(phar, 0, 0, 0, &error);
phar              129 ext/phar/tar.c 	phar_archive_data *phar;
phar              130 ext/phar/tar.c 	int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error);
phar              137 ext/phar/tar.c 		*pphar = phar;
phar              140 ext/phar/tar.c 	phar->is_data = is_data;
phar              142 ext/phar/tar.c 	if (phar->is_tar) {
phar              146 ext/phar/tar.c 	if (phar->is_brandnew) {
phar              147 ext/phar/tar.c 		phar->is_tar = 1;
phar              148 ext/phar/tar.c 		phar->is_zip = 0;
phar              149 ext/phar/tar.c 		phar->internal_file_start = 0;
phar              184 ext/phar/tar.c 		entry->phar->metadata = entry->metadata;
phar              186 ext/phar/tar.c 	} else if (entry->filename_len >= sizeof(".phar/.metadata/") + sizeof("/.metadata.bin") - 1 && NULL != (mentry = zend_hash_str_find_ptr(&(entry->phar->manifest), entry->filename + sizeof(".phar/.metadata/") - 1, entry->filename_len - (sizeof("/.metadata.bin") - 1 + sizeof(".phar/.metadata/") - 1)))) {
phar              251 ext/phar/tar.c 	entry.phar = myphar;
phar              718 ext/phar/tar.c 	phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len);
phar              725 ext/phar/tar.c 				spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, filename \"%s\" is too long for tar file format", entry->phar->fname, entry->filename);
phar              735 ext/phar/tar.c 				spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, filename \"%s\" is too long for tar file format", entry->phar->fname, entry->filename);
phar              749 ext/phar/tar.c 			spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, filename \"%s\" is too large for tar file format", entry->phar->fname, entry->filename);
phar              756 ext/phar/tar.c 			spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, file modification time of file \"%s\" is too large for tar file format", entry->phar->fname, entry->filename);
phar              775 ext/phar/tar.c 			spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, checksum of file \"%s\" is too large for tar file format", entry->phar->fname, entry->filename);
phar              785 ext/phar/tar.c 			spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, header for  file \"%s\" could not be written", entry->phar->fname, entry->filename);
phar              800 ext/phar/tar.c 				spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, contents of file \"%s\" could not be written, seek failed", entry->phar->fname, entry->filename);
phar              807 ext/phar/tar.c 				spprintf(fp->error, 4096, "tar-based phar \"%s\" cannot be created, contents of file \"%s\" could not be written", entry->phar->fname, entry->filename);
phar              831 ext/phar/tar.c 	if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp) {
phar              880 ext/phar/tar.c 		zend_hash_str_del(&(entry->phar->manifest), entry->filename, entry->filename_len);
phar              897 ext/phar/tar.c 			return phar_tar_setmetadata(&entry->phar->metadata, entry, error);
phar              900 ext/phar/tar.c 		if (entry->filename_len >= sizeof(".phar/.metadata/") + sizeof("/.metadata.bin") - 1 && !zend_hash_str_exists(&(entry->phar->manifest), entry->filename + sizeof(".phar/.metadata/") - 1, entry->filename_len - (sizeof("/.metadata.bin") - 1 + sizeof(".phar/.metadata/") - 1))) {
phar              916 ext/phar/tar.c 		zend_hash_str_del(&(entry->phar->manifest), lookfor, lookfor_len);
phar              921 ext/phar/tar.c 	if (NULL != (metadata = zend_hash_str_find_ptr(&(entry->phar->manifest), lookfor, lookfor_len))) {
phar              930 ext/phar/tar.c 	newentry.phar = entry->phar;
phar              934 ext/phar/tar.c 	if (NULL == (metadata = zend_hash_str_add_mem(&(entry->phar->manifest), lookfor, lookfor_len, (void *)&newentry, sizeof(phar_entry_info)))) {
phar              944 ext/phar/tar.c int phar_tar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error) /* {{{ */
phar              960 ext/phar/tar.c 	entry.phar = phar;
phar              963 ext/phar/tar.c 	if (phar->is_persistent) {
phar              965 ext/phar/tar.c 			spprintf(error, 0, "internal error: attempt to flush cached tar-based phar \"%s\"", phar->fname);
phar              970 ext/phar/tar.c 	if (phar->is_data) {
phar              975 ext/phar/tar.c 	if (!phar->is_temporary_alias && phar->alias_len) {
phar              983 ext/phar/tar.c 		if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) {
phar              985 ext/phar/tar.c 				spprintf(error, 0, "unable to set alias in tar-based phar \"%s\"", phar->fname);
phar              990 ext/phar/tar.c 		entry.uncompressed_filesize = phar->alias_len;
phar              992 ext/phar/tar.c 		if (NULL == zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
phar              994 ext/phar/tar.c 				spprintf(error, 0, "unable to set alias in tar-based phar \"%s\"", phar->fname);
phar              999 ext/phar/tar.c 		zend_hash_str_del(&phar->manifest, ".phar/alias.txt", sizeof(".phar/alias.txt")-1);
phar             1009 ext/phar/tar.c 					spprintf(error, 0, "unable to access resource to copy stub to new tar-based phar \"%s\"", phar->fname);
phar             1036 ext/phar/tar.c 					spprintf(error, 0, "unable to read resource to copy stub to new tar-based phar \"%s\"", phar->fname);
phar             1049 ext/phar/tar.c 				spprintf(error, 0, "illegal stub for tar-based phar \"%s\"", phar->fname);
phar             1070 ext/phar/tar.c 				spprintf(error, 0, "unable to create stub from string in new tar-based phar \"%s\"", phar->fname);
phar             1081 ext/phar/tar.c 		zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info));
phar             1096 ext/phar/tar.c 				spprintf(error, 0, "unable to %s stub in%star-based phar \"%s\", failed", user_stub ? "overwrite" : "create", user_stub ? " " : " new ", phar->fname);
phar             1106 ext/phar/tar.c 			if (!zend_hash_str_exists(&phar->manifest, ".phar/stub.php", sizeof(".phar/stub.php")-1)) {
phar             1107 ext/phar/tar.c 				if (NULL == zend_hash_str_add_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
phar             1111 ext/phar/tar.c 						spprintf(error, 0, "unable to create stub in tar-based phar \"%s\"", phar->fname);
phar             1120 ext/phar/tar.c 			if (NULL == zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
phar             1124 ext/phar/tar.c 					spprintf(error, 0, "unable to overwrite stub in tar-based phar \"%s\"", phar->fname);
phar             1131 ext/phar/tar.c 	if (phar->fp && !phar->is_brandnew) {
phar             1132 ext/phar/tar.c 		oldfile = phar->fp;
phar             1136 ext/phar/tar.c 		oldfile = php_stream_open_wrapper(phar->fname, "rb", 0, NULL);
phar             1157 ext/phar/tar.c 	if (Z_TYPE(phar->metadata) != IS_UNDEF) {
phar             1159 ext/phar/tar.c 		if (NULL != (mentry = zend_hash_str_find_ptr(&(phar->manifest), ".phar/.metadata.bin", sizeof(".phar/.metadata.bin")-1))) {
phar             1160 ext/phar/tar.c 			if (ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata(&phar->metadata, mentry, error)) {
phar             1171 ext/phar/tar.c 			newentry.phar = phar;
phar             1175 ext/phar/tar.c 			if (NULL == (mentry = zend_hash_str_add_mem(&(phar->manifest), ".phar/.metadata.bin", sizeof(".phar/.metadata.bin")-1, (void *)&newentry, sizeof(phar_entry_info)))) {
phar             1176 ext/phar/tar.c 				spprintf(error, 0, "phar tar error: unable to add magic metadata file to manifest for phar archive \"%s\"", phar->fname);
phar             1183 ext/phar/tar.c 			if (ZEND_HASH_APPLY_KEEP != phar_tar_setmetadata(&phar->metadata, mentry, error)) {
phar             1184 ext/phar/tar.c 				zend_hash_str_del(&(phar->manifest), ".phar/.metadata.bin", sizeof(".phar/.metadata.bin")-1);
phar             1193 ext/phar/tar.c 	zend_hash_apply_with_argument(&phar->manifest, phar_tar_setupmetadata, (void *) &pass);
phar             1205 ext/phar/tar.c 	zend_hash_apply_with_argument(&phar->manifest, phar_tar_writeheaders, (void *) &pass);
phar             1208 ext/phar/tar.c 	if (!phar->is_data || phar->sig_flags) {
phar             1209 ext/phar/tar.c 		if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, error)) {
phar             1240 ext/phar/tar.c 		PHAR_SET_32(sigbuf, phar->sig_flags);
phar             1246 ext/phar/tar.c 				spprintf(error, 0, "phar error: unable to write signature to tar-based phar %s", phar->fname);
phar             1286 ext/phar/tar.c 	if (phar->fp && pass.free_fp) {
phar             1287 ext/phar/tar.c 		php_stream_close(phar->fp);
phar             1290 ext/phar/tar.c 	if (phar->ufp) {
phar             1292 ext/phar/tar.c 			php_stream_close(phar->ufp);
phar             1294 ext/phar/tar.c 		phar->ufp = NULL;
phar             1297 ext/phar/tar.c 	phar->is_brandnew = 0;
phar             1300 ext/phar/tar.c 	if (phar->donotflush) {
phar             1302 ext/phar/tar.c 		phar->fp = newfile;
phar             1304 ext/phar/tar.c 		phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, NULL);
phar             1305 ext/phar/tar.c 		if (!phar->fp) {
phar             1306 ext/phar/tar.c 			phar->fp = newfile;
phar             1308 ext/phar/tar.c 				spprintf(error, 0, "unable to open new phar \"%s\" for writing", phar->fname);
phar             1313 ext/phar/tar.c 		if (phar->flags & PHAR_FILE_COMPRESSED_GZ) {
phar             1324 ext/phar/tar.c 			filter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp));
phar             1329 ext/phar/tar.c 				php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
phar             1332 ext/phar/tar.c 					spprintf(error, 4096, "unable to compress all contents of phar \"%s\" using zlib, PHP versions older than 5.2.6 have a buggy zlib", phar->fname);
phar             1337 ext/phar/tar.c 			php_stream_filter_append(&phar->fp->writefilters, filter);
phar             1338 ext/phar/tar.c 			php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
phar             1341 ext/phar/tar.c 			php_stream_close(phar->fp);
phar             1343 ext/phar/tar.c 			phar->fp = newfile;
phar             1344 ext/phar/tar.c 		} else if (phar->flags & PHAR_FILE_COMPRESSED_BZ2) {
phar             1347 ext/phar/tar.c 			filter = php_stream_filter_create("bzip2.compress", NULL, php_stream_is_persistent(phar->fp));
phar             1348 ext/phar/tar.c 			php_stream_filter_append(&phar->fp->writefilters, filter);
phar             1349 ext/phar/tar.c 			php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
phar             1352 ext/phar/tar.c 			php_stream_close(phar->fp);
phar             1354 ext/phar/tar.c 			phar->fp = newfile;
phar             1356 ext/phar/tar.c 			php_stream_copy_to_stream_ex(newfile, phar->fp, PHP_STREAM_COPY_ALL, NULL);
phar               74 ext/phar/util.c 	if (NULL != (link_entry = zend_hash_str_find_ptr(&(entry->phar->manifest), entry->link, strlen(entry->link))) ||
phar               75 ext/phar/util.c 		NULL != (link_entry = zend_hash_str_find_ptr(&(entry->phar->manifest), link, strlen(link)))) {
phar              103 ext/phar/util.c 			phar_open_archive_fp(entry->phar);
phar              170 ext/phar/util.c int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len, char *path, int path_len) /* {{{ */
phar              188 ext/phar/util.c 	entry.phar = phar;
phar              230 ext/phar/util.c 		if (NULL == zend_hash_str_add_ptr(&phar->mounted_dirs, entry.filename, path_len, entry.filename)) {
phar              243 ext/phar/util.c 	if (NULL != zend_hash_str_add_mem(&phar->manifest, entry.filename, path_len, (void*)&entry, sizeof(phar_entry_info))) {
phar              258 ext/phar/util.c 	phar_archive_data *phar;
phar              263 ext/phar/util.c 		pphar = &phar;
phar              276 ext/phar/util.c 		phar = PHAR_G(last_phar);
phar              289 ext/phar/util.c 		if (FAILURE == phar_get_archive(&phar, arch, arch_len, NULL, 0, NULL)) {
phar              295 ext/phar/util.c 			*pphar = phar;
phar              302 ext/phar/util.c 			if (zend_hash_str_exists(&(phar->manifest), test + 1, try_len - 1)) {
phar              309 ext/phar/util.c 			if (zend_hash_str_exists(&(phar->manifest), test, try_len)) {
phar              354 ext/phar/util.c 	phar_archive_data *phar;
phar              371 ext/phar/util.c 	if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error)) {
phar              375 ext/phar/util.c 	if (for_write && PHAR_G(readonly) && !phar->is_data) {
phar              390 ext/phar/util.c 		if ((entry = phar_get_entry_info_dir(phar, path, path_len, allow_dir, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security)) == NULL) {
phar              391 ext/phar/util.c 			if (for_create && (!PHAR_G(readonly) || phar->is_data)) {
phar              397 ext/phar/util.c 		if ((entry = phar_get_entry_info(phar, path, path_len, for_create && !PHAR_G(readonly) && !phar->is_data ? NULL : error, security)) == NULL) {
phar              398 ext/phar/util.c 			if (for_create && (!PHAR_G(readonly) || phar->is_data)) {
phar              405 ext/phar/util.c 	if (for_write && phar->is_persistent) {
phar              406 ext/phar/util.c 		if (FAILURE == phar_copy_on_write(&phar)) {
phar              441 ext/phar/util.c 		(*ret)->phar = phar;
phar              447 ext/phar/util.c 		if (!phar->is_persistent) {
phar              448 ext/phar/util.c 			++(entry->phar->refcount);
phar              457 ext/phar/util.c 			if (FAILURE == phar_create_writeable_entry(phar, entry, error)) {
phar              472 ext/phar/util.c 				if (FAILURE == phar_create_writeable_entry(phar, entry, error)) {
phar              489 ext/phar/util.c 	(*ret)->phar = phar;
phar              506 ext/phar/util.c 	if (!phar->is_persistent) {
phar              508 ext/phar/util.c 		++(entry->phar->refcount);
phar              520 ext/phar/util.c 	phar_archive_data *phar;
phar              532 ext/phar/util.c 	if (FAILURE == phar_get_archive(&phar, fname, fname_len, NULL, 0, error)) {
phar              549 ext/phar/util.c 	if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) {
phar              586 ext/phar/util.c 	phar_add_virtual_dirs(phar, path, path_len);
phar              590 ext/phar/util.c 	etemp.phar = phar;
phar              592 ext/phar/util.c 	etemp.is_zip = phar->is_zip;
phar              594 ext/phar/util.c 	if (phar->is_tar) {
phar              595 ext/phar/util.c 		etemp.is_tar = phar->is_tar;
phar              599 ext/phar/util.c 	if (NULL == (entry = zend_hash_str_add_mem(&phar->manifest, etemp.filename, path_len, (void*)&etemp, sizeof(phar_entry_info)))) {
phar              602 ext/phar/util.c 			spprintf(error, 0, "phar error: unable to add new entry \"%s\" to phar \"%s\"", etemp.filename, phar->fname);
phar              616 ext/phar/util.c 	++(phar->refcount);
phar              617 ext/phar/util.c 	ret->phar = phar;
phar              630 ext/phar/util.c int phar_open_archive_fp(phar_archive_data *phar) /* {{{ */
phar              632 ext/phar/util.c 	if (phar_get_pharfp(phar)) {
phar              636 ext/phar/util.c 	if (php_check_open_basedir(phar->fname)) {
phar              640 ext/phar/util.c 	phar_set_pharfp(phar, php_stream_open_wrapper(phar->fname, "rb", IGNORE_URL|STREAM_MUST_SEEK|0, NULL));
phar              642 ext/phar/util.c 	if (!phar_get_pharfp(phar)) {
phar              684 ext/phar/util.c 			spprintf(error, 4096, "phar error: unable to copy contents of file \"%s\" to \"%s\" in phar archive \"%s\"", source->filename, dest->filename, source->phar->fname);
phar              698 ext/phar/util.c 	phar_archive_data *phar = entry->phar;
phar              727 ext/phar/util.c 	if (!phar_get_pharfp(phar)) {
phar              728 ext/phar/util.c 		if (FAILURE == phar_open_archive_fp(phar)) {
phar              729 ext/phar/util.c 			spprintf(error, 4096, "phar error: Cannot open phar archive \"%s\" for reading", phar->fname);
phar              736 ext/phar/util.c 		dummy.phar = phar;
phar              738 ext/phar/util.c 		dummy.fp = phar_get_pharfp(phar);
phar              748 ext/phar/util.c 			spprintf(error, 4096, "phar error: Cannot open temporary file for decompressing phar archive \"%s\" file \"%s\"", phar->fname, entry->filename);
phar              754 ext/phar/util.c 	dummy.phar = phar;
phar              756 ext/phar/util.c 	dummy.fp = phar_get_pharfp(phar);
phar              770 ext/phar/util.c 		spprintf(error, 4096, "phar error: unable to read phar \"%s\" (cannot create %s filter while decompressing file \"%s\")", phar->fname, phar_decompress_filter(entry, 1), entry->filename);
phar              783 ext/phar/util.c 			spprintf(error, 4096, "phar error: internal corruption of phar \"%s\" (actual filesize mismatch on file \"%s\")", phar->fname, entry->filename);
phar              794 ext/phar/util.c 		spprintf(error, 4096, "phar error: internal corruption of phar \"%s\" (actual filesize mismatch on file \"%s\")", phar->fname, entry->filename);
phar              811 ext/phar/util.c int phar_create_writeable_entry(phar_archive_data *phar, phar_entry_info *entry, char **error) /* {{{ */
phar              819 ext/phar/util.c 		phar->is_modified = 1;
phar              852 ext/phar/util.c 	phar->is_modified = 1;
phar              891 ext/phar/util.c 			spprintf(error, 4096, "phar error: cannot separate entry file \"%s\" contents in phar archive \"%s\" for write access", entry->filename, entry->phar->fname);
phar              913 ext/phar/util.c phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, char **error) /* {{{ */
phar              923 ext/phar/util.c 		spprintf(error, 4096, "phar error: cannot seek to start of file \"%s\" in phar \"%s\"", entry->filename, phar->fname);
phar              942 ext/phar/util.c int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len) /* {{{ */
phar              944 ext/phar/util.c 	if (phar->refcount || phar->is_persistent) {
phar              949 ext/phar/util.c 	if (zend_hash_str_del(&(PHAR_G(phar_fname_map)), phar->fname, phar->fname_len) != SUCCESS) {
phar             1209 ext/phar/util.c phar_entry_info *phar_get_entry_info(phar_archive_data *phar, char *path, int path_len, char **error, int security) /* {{{ */
phar             1211 ext/phar/util.c 	return phar_get_entry_info_dir(phar, path, path_len, 0, error, security);
phar             1219 ext/phar/util.c phar_entry_info *phar_get_entry_info_dir(phar_archive_data *phar, char *path, int path_len, char dir, char **error, int security) /* {{{ */
phar             1256 ext/phar/util.c 	if (!phar->manifest.u.flags) {
phar             1267 ext/phar/util.c 	if (NULL != (entry = zend_hash_str_find_ptr(&phar->manifest, path, path_len))) {
phar             1289 ext/phar/util.c 		if (zend_hash_str_exists(&phar->virtual_dirs, path, path_len)) {
phar             1296 ext/phar/util.c 			entry->phar = phar;
phar             1301 ext/phar/util.c 	if (phar->mounted_dirs.u.flags && zend_hash_num_elements(&phar->mounted_dirs)) {
phar             1304 ext/phar/util.c 		ZEND_HASH_FOREACH_STR_KEY(&phar->mounted_dirs, str_key) {
phar             1312 ext/phar/util.c 				if (NULL == (entry = zend_hash_find_ptr(&phar->manifest, str_key))) {
phar             1351 ext/phar/util.c 				if (SUCCESS != phar_mount_entry(phar, test, test_len, path, path_len)) {
phar             1361 ext/phar/util.c 				if (NULL == (entry = zend_hash_str_find_ptr(&phar->manifest, path, path_len))) {
phar             1758 ext/phar/util.c int phar_create_signature(phar_archive_data *phar, php_stream *fp, char **signature, int *signature_length, char **error) /* {{{ */
phar             1765 ext/phar/util.c 	if (phar->signature) {
phar             1766 ext/phar/util.c 		efree(phar->signature);
phar             1767 ext/phar/util.c 		phar->signature = NULL;
phar             1770 ext/phar/util.c 	switch(phar->sig_flags) {
phar             1806 ext/phar/util.c 				spprintf(error, 0, "unable to write to phar \"%s\" with requested hash type", phar->fname);
phar             1823 ext/phar/util.c 					spprintf(error, 0, "unable to write to phar \"%s\" with requested openssl signature", phar->fname);
phar             1846 ext/phar/util.c 					spprintf(error, 0, "unable to initialize openssl signature for phar \"%s\"", phar->fname);
phar             1855 ext/phar/util.c 						spprintf(error, 0, "unable to update the openssl signature for phar \"%s\"", phar->fname);
phar             1864 ext/phar/util.c 					spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname);
phar             1878 ext/phar/util.c 					spprintf(error, 0, "unable to write phar \"%s\" with requested openssl signature", phar->fname);
phar             1888 ext/phar/util.c 			phar->sig_flags = PHAR_SIG_SHA1;
phar             1921 ext/phar/util.c 	phar->sig_len = phar_hex_str((const char *)*signature, *signature_length, &phar->signature);
phar             1926 ext/phar/util.c void phar_add_virtual_dirs(phar_archive_data *phar, char *filename, int filename_len) /* {{{ */
phar             1932 ext/phar/util.c 		if (!filename_len || NULL == zend_hash_str_add_empty_element(&phar->virtual_dirs, filename, filename_len)) {
phar             1943 ext/phar/util.c 	entry->phar = (phar_archive_data *)argument;
phar             1982 ext/phar/util.c 	phar_archive_data *phar;
phar             1987 ext/phar/util.c 	phar = (phar_archive_data *) emalloc(sizeof(phar_archive_data));
phar             1988 ext/phar/util.c 	*phar = **pphar;
phar             1989 ext/phar/util.c 	phar->is_persistent = 0;
phar             1990 ext/phar/util.c 	fname = phar->fname;
phar             1991 ext/phar/util.c 	phar->fname = estrndup(phar->fname, phar->fname_len);
phar             1992 ext/phar/util.c 	phar->ext = phar->fname + (phar->ext - fname);
phar             1994 ext/phar/util.c 	if (phar->alias) {
phar             1995 ext/phar/util.c 		phar->alias = estrndup(phar->alias, phar->alias_len);
phar             1998 ext/phar/util.c 	if (phar->signature) {
phar             1999 ext/phar/util.c 		phar->signature = estrdup(phar->signature);
phar             2002 ext/phar/util.c 	if (Z_TYPE(phar->metadata) != IS_UNDEF) {
phar             2004 ext/phar/util.c 		if (phar->metadata_len) {
phar             2005 ext/phar/util.c 			char *buf = estrndup((char *) Z_PTR(phar->metadata), phar->metadata_len);
phar             2006 ext/phar/util.c 			phar_parse_metadata(&buf, &phar->metadata, phar->metadata_len);
phar             2009 ext/phar/util.c 			zval_copy_ctor(&phar->metadata);
phar             2016 ext/phar/util.c 	zend_hash_apply_with_argument(&newmanifest, phar_update_cached_entry, (void *)phar);
phar             2017 ext/phar/util.c 	phar->manifest = newmanifest;
phar             2018 ext/phar/util.c 	zend_hash_init(&phar->mounted_dirs, sizeof(char *),
phar             2020 ext/phar/util.c 	zend_hash_init(&phar->virtual_dirs, sizeof(char *),
phar             2022 ext/phar/util.c 	zend_hash_copy(&phar->virtual_dirs, &(*pphar)->virtual_dirs, NULL);
phar             2023 ext/phar/util.c 	*pphar = phar;
phar             2027 ext/phar/util.c 		if (objphar->archive->fname_len == phar->fname_len && !memcmp(objphar->archive->fname, phar->fname, phar->fname_len)) {
phar             2028 ext/phar/util.c 			objphar->archive = phar;
phar              290 ext/phar/zip.c 	entry.phar = mydata;
phar              746 ext/phar/zip.c 	phar_archive_data *phar;
phar              747 ext/phar/zip.c 	int ret = phar_create_or_parse_filename(fname, fname_len, alias, alias_len, is_data, options, &phar, error);
phar              754 ext/phar/zip.c 		*pphar = phar;
phar              757 ext/phar/zip.c 	phar->is_data = is_data;
phar              759 ext/phar/zip.c 	if (phar->is_zip) {
phar              763 ext/phar/zip.c 	if (phar->is_brandnew) {
phar              764 ext/phar/zip.c 		phar->internal_file_start = 0;
phar              765 ext/phar/zip.c 		phar->is_zip = 1;
phar              766 ext/phar/zip.c 		phar->is_tar = 0;
phar              812 ext/phar/zip.c 	phar_add_virtual_dirs(entry->phar, entry->filename, entry->filename_len);
phar              857 ext/phar/zip.c 			if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp) {
phar              866 ext/phar/zip.c 			spprintf(p->error, 0, "unable to open file contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar              877 ext/phar/zip.c 			spprintf(p->error, 0, "unable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar              904 ext/phar/zip.c 				spprintf(p->error, 0, "unable to gzip compress file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar              906 ext/phar/zip.c 				spprintf(p->error, 0, "unable to bzip2 compress file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar              917 ext/phar/zip.c 			spprintf(p->error, 0, "unable to create temporary file for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar              924 ext/phar/zip.c 			spprintf(p->error, 0, "unable to seek to start of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar              931 ext/phar/zip.c 			spprintf(p->error, 0, "unable to copy compressed file contents of file \"%s\" while creating new phar \"%s\"", entry->filename, entry->phar->fname);
phar              954 ext/phar/zip.c 				spprintf(p->error, 0, "unable to seek to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar              981 ext/phar/zip.c 		spprintf(p->error, 0, "unable to write local file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar              986 ext/phar/zip.c 		spprintf(p->error, 0, "unable to write central directory entry for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar              992 ext/phar/zip.c 			spprintf(p->error, 0, "unable to write filename to local directory entry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar              997 ext/phar/zip.c 			spprintf(p->error, 0, "unable to write filename to local directory entry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar             1002 ext/phar/zip.c 			spprintf(p->error, 0, "unable to write filename to central directory entry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar             1007 ext/phar/zip.c 			spprintf(p->error, 0, "unable to write filename to central directory entry for directory \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar             1012 ext/phar/zip.c 			spprintf(p->error, 0, "unable to write filename to local directory entry for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar             1017 ext/phar/zip.c 			spprintf(p->error, 0, "unable to write filename to central directory entry for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar             1023 ext/phar/zip.c 		spprintf(p->error, 0, "unable to write local extra permissions file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar             1028 ext/phar/zip.c 		spprintf(p->error, 0, "unable to write central extra permissions file header of file \"%s\" to zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar             1035 ext/phar/zip.c 				spprintf(p->error, 0, "unable to write compressed contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar             1049 ext/phar/zip.c 				spprintf(p->error, 0, "unable to write contents of file \"%s\" in zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar             1054 ext/phar/zip.c 		if (entry->fp_type == PHAR_MOD && entry->fp != entry->phar->fp && entry->fp != entry->phar->ufp && entry->fp_refcount == 0) {
phar             1075 ext/phar/zip.c 			spprintf(p->error, 0, "unable to copy contents of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar             1086 ext/phar/zip.c 			spprintf(p->error, 0, "unable to write metadata as file comment for file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
phar             1104 ext/phar/zip.c static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pass *pass,
phar             1108 ext/phar/zip.c 	if (!phar->is_data || phar->sig_flags) {
phar             1131 ext/phar/zip.c 		if (FAILURE == phar_create_signature(phar, newfile, &signature, &signature_length, pass->error)) {
phar             1152 ext/phar/zip.c 		PHAR_SET_32(sigbuf, phar->sig_flags);
phar             1158 ext/phar/zip.c 				spprintf(pass->error, 0, "phar error: unable to write signature to zip-based phar %s", phar->fname);
phar             1167 ext/phar/zip.c 		entry.phar = phar;
phar             1182 ext/phar/zip.c int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int defaultstub, char **error) /* {{{ */
phar             1204 ext/phar/zip.c 	entry.phar = phar;
phar             1207 ext/phar/zip.c 	if (phar->is_persistent) {
phar             1209 ext/phar/zip.c 			spprintf(error, 0, "internal error: attempt to flush cached zip-based phar \"%s\"", phar->fname);
phar             1214 ext/phar/zip.c 	if (phar->is_data) {
phar             1219 ext/phar/zip.c 	if (!phar->is_temporary_alias && phar->alias_len) {
phar             1225 ext/phar/zip.c 		if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) {
phar             1227 ext/phar/zip.c 				spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname);
phar             1232 ext/phar/zip.c 		entry.uncompressed_filesize = entry.compressed_filesize = phar->alias_len;
phar             1236 ext/phar/zip.c 		if (NULL == zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
phar             1238 ext/phar/zip.c 				spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname);
phar             1243 ext/phar/zip.c 		zend_hash_str_del(&phar->manifest, ".phar/alias.txt", sizeof(".phar/alias.txt")-1);
phar             1247 ext/phar/zip.c 	if (phar->alias_len) {
phar             1248 ext/phar/zip.c 		if (FAILURE == phar_get_archive(&phar, phar->fname, phar->fname_len, phar->alias, phar->alias_len, error)) {
phar             1259 ext/phar/zip.c 					spprintf(error, 0, "unable to access resource to copy stub to new zip-based phar \"%s\"", phar->fname);
phar             1288 ext/phar/zip.c 					spprintf(error, 0, "unable to read resource to copy stub to new zip-based phar \"%s\"", phar->fname);
phar             1301 ext/phar/zip.c 				spprintf(error, 0, "illegal stub for zip-based phar \"%s\"", phar->fname);
phar             1322 ext/phar/zip.c 				spprintf(error, 0, "unable to create stub from string in new zip-based phar \"%s\"", phar->fname);
phar             1334 ext/phar/zip.c 		if (NULL == zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
phar             1339 ext/phar/zip.c 				spprintf(error, 0, "unable to set stub in zip-based phar \"%s\"", phar->fname);
phar             1357 ext/phar/zip.c 				spprintf(error, 0, "unable to %s stub in%szip-based phar \"%s\", failed", user_stub ? "overwrite" : "create", user_stub ? " " : " new ", phar->fname);
phar             1367 ext/phar/zip.c 			if (!zend_hash_str_exists(&phar->manifest, ".phar/stub.php", sizeof(".phar/stub.php")-1)) {
phar             1368 ext/phar/zip.c 				if (NULL == zend_hash_str_add_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
phar             1372 ext/phar/zip.c 						spprintf(error, 0, "unable to create stub in zip-based phar \"%s\"", phar->fname);
phar             1381 ext/phar/zip.c 			if (NULL == zend_hash_str_update_mem(&phar->manifest, entry.filename, entry.filename_len, (void*)&entry, sizeof(phar_entry_info))) {
phar             1385 ext/phar/zip.c 					spprintf(error, 0, "unable to overwrite stub in zip-based phar \"%s\"", phar->fname);
phar             1392 ext/phar/zip.c 	if (phar->fp && !phar->is_brandnew) {
phar             1393 ext/phar/zip.c 		oldfile = phar->fp;
phar             1397 ext/phar/zip.c 		oldfile = php_stream_open_wrapper(phar->fname, "rb", 0, NULL);
phar             1411 ext/phar/zip.c 			spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to open temporary file", phar->fname);
phar             1426 ext/phar/zip.c 	if (!phar->is_data && !phar->sig_flags) {
phar             1427 ext/phar/zip.c 		phar->sig_flags = PHAR_SIG_SHA1;
phar             1429 ext/phar/zip.c 	if (phar->sig_flags) {
phar             1430 ext/phar/zip.c 		PHAR_SET_16(eocd.counthere, zend_hash_num_elements(&phar->manifest) + 1);
phar             1431 ext/phar/zip.c 		PHAR_SET_16(eocd.count, zend_hash_num_elements(&phar->manifest) + 1);
phar             1433 ext/phar/zip.c 		PHAR_SET_16(eocd.counthere, zend_hash_num_elements(&phar->manifest));
phar             1434 ext/phar/zip.c 		PHAR_SET_16(eocd.count, zend_hash_num_elements(&phar->manifest));
phar             1436 ext/phar/zip.c 	zend_hash_apply_with_argument(&phar->manifest, phar_zip_changed_apply, (void *) &pass);
phar             1438 ext/phar/zip.c 	if (Z_TYPE(phar->metadata) != IS_UNDEF) {
phar             1441 ext/phar/zip.c 		php_var_serialize(&main_metadata_str, &phar->metadata, &metadata_hash);
phar             1446 ext/phar/zip.c 			spprintf(error, 4096, "phar zip flush of \"%s\" failed: %s", phar->fname, temperr);
phar             1452 ext/phar/zip.c 		if (Z_TYPE(phar->metadata) != IS_UNDEF) {
phar             1462 ext/phar/zip.c 	if (FAILURE == phar_zip_applysignature(phar, &pass, &main_metadata_str)) {
phar             1478 ext/phar/zip.c 				spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write central-directory", phar->fname);
phar             1486 ext/phar/zip.c 	if (Z_TYPE(phar->metadata) != IS_UNDEF) {
phar             1492 ext/phar/zip.c 				spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write end of central-directory", phar->fname);
phar             1499 ext/phar/zip.c 				spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write metadata to zip comment", phar->fname);
phar             1509 ext/phar/zip.c 				spprintf(error, 4096, "phar zip flush of \"%s\" failed: unable to write end of central-directory", phar->fname);
phar             1515 ext/phar/zip.c 	if (phar->fp && pass.free_fp) {
phar             1516 ext/phar/zip.c 		php_stream_close(phar->fp);
phar             1519 ext/phar/zip.c 	if (phar->ufp) {
phar             1521 ext/phar/zip.c 			php_stream_close(phar->ufp);
phar             1523 ext/phar/zip.c 		phar->ufp = NULL;
phar             1527 ext/phar/zip.c 	phar->is_brandnew = 0;
phar             1529 ext/phar/zip.c 	if (phar->donotflush) {
phar             1531 ext/phar/zip.c 		phar->fp = pass.filefp;
phar             1533 ext/phar/zip.c 		phar->fp = php_stream_open_wrapper(phar->fname, "w+b", IGNORE_URL|STREAM_MUST_SEEK|REPORT_ERRORS, NULL);
phar             1534 ext/phar/zip.c 		if (!phar->fp) {
phar             1538 ext/phar/zip.c 			phar->fp = pass.filefp;
phar             1540 ext/phar/zip.c 				spprintf(error, 4096, "unable to open new phar \"%s\" for writing", phar->fname);
phar             1545 ext/phar/zip.c 		php_stream_copy_to_stream_ex(pass.filefp, phar->fp, PHP_STREAM_COPY_ALL, NULL);