Lines Matching refs:entry
59 static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char *basename, int requ… in phar_mung_server_vars() argument
80 if (Z_STRLEN_PP(stuff) > entry_len && !memcmp(Z_STRVAL_PP(stuff), entry, entry_len)) { in phar_mung_server_vars()
93 Z_STRLEN_PP(stuff) = spprintf(&(Z_STRVAL_PP(stuff)), 4096, "phar://%s%s", fname, entry); in phar_mung_server_vars()
141 ZVAL_STRINGL(*stuff, entry, entry_len, 1); in phar_mung_server_vars()
154 Z_STRLEN_PP(stuff) = spprintf(&(Z_STRVAL_PP(stuff)), 4096, "phar://%s%s", fname, entry); in phar_mung_server_vars()
165 …chive_data *phar, phar_entry_info *info, char *mime_type, int code, char *entry, int entry_len, ch… in phar_file_action() argument
182 if (entry[0] == '/') { in phar_file_action()
183 name_len = spprintf(&name, 4096, "phar://%s%s", arch, entry); in phar_file_action()
185 name_len = spprintf(&name, 4096, "phar://%s/%s", arch, entry); in phar_file_action()
241 phar_mung_server_vars(arch, entry, entry_len, basename, ru_len TSRMLS_CC); in phar_file_action()
245 if (entry[0] == '/') { in phar_file_action()
246 name_len = spprintf(&name, 4096, "phar://%s%s", arch, entry); in phar_file_action()
248 name_len = spprintf(&name, 4096, "phar://%s/%s", arch, entry); in phar_file_action()
261 if ((cwd = zend_memrchr(entry, '/', entry_len))) { in phar_file_action()
263 if (entry == cwd) { in phar_file_action()
267 } else if (entry[0] == '/') { in phar_file_action()
268 PHAR_G(cwd_len) = cwd - (entry + 1); in phar_file_action()
269 PHAR_G(cwd) = estrndup(entry + 1, PHAR_G(cwd_len)); in phar_file_action()
271 PHAR_G(cwd_len) = cwd - entry; in phar_file_action()
272 PHAR_G(cwd) = estrndup(entry, PHAR_G(cwd_len)); in phar_file_action()
332 static void phar_do_403(char *entry, int entry_len TSRMLS_DC) /* {{{ */ in phar_do_403() argument
342 PHPWRITE(entry, entry_len); in phar_do_403()
347 …e_data *phar, char *fname, int fname_len, char *f404, int f404_len, char *entry, int entry_len TSR… in phar_do_404() argument
367 PHPWRITE(entry, entry_len); in phar_do_404()
375 static void phar_postprocess_ru_web(char *fname, int fname_len, char **entry, int *entry_len, char … in phar_postprocess_ru_web() argument
377 char *e = *entry + 1, *u = NULL, *u1 = NULL, *saveu = NULL; in phar_postprocess_ru_web()
442 char *fname, *arch, *entry; in PHP_METHOD() local
453 …", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 … in PHP_METHOD()
454 efree(entry); in PHP_METHOD()
476 char *fname, *arch = NULL, *entry = NULL, *path, *actual; in PHP_METHOD() local
491 …", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 … in PHP_METHOD()
492 efree(entry); in PHP_METHOD()
493 entry = NULL; in PHP_METHOD()
518 if (path && path == entry) { in PHP_METHOD()
519 efree(entry); in PHP_METHOD()
529 if (entry && path && path == entry) { in PHP_METHOD()
530 efree(entry); in PHP_METHOD()
546 …} else if (SUCCESS == phar_split_fname(path, path_len, &arch, &arch_len, &entry, &entry_len, 2, 0 … in PHP_METHOD()
547 path = entry; in PHP_METHOD()
568 char *fname, *basename, *path_info, *mime_type = NULL, *entry, *pt; local
622 entry = estrndup(Z_STRVAL_PP(z_path_info), entry_len);
625 memcpy(path_info + Z_STRLEN_PP(z_script_name), entry, entry_len + 1);
629 entry = estrndup("", 0);
647 entry = path_info;
648 entry_len = strlen(entry);
654 entry = estrndup("", 0);
671 entry = estrndup(pt + (fname_len - (basename - fname)), entry_len);
683 ZVAL_STRINGL(params, entry, entry_len, 1);
736 efree(entry);
739 entry = estrndup(Z_STRVAL_PP(fci.retval_ptr_ptr), Z_STRLEN_PP(fci.retval_ptr_ptr));
742 entry = Z_STRVAL_P(retval_ptr);
748 phar_do_403(entry, entry_len TSRMLS_CC);
769 phar_postprocess_ru_web(fname, fname_len, &entry, &entry_len, &ru, &ru_len TSRMLS_CC);
772 if (!entry_len || (entry_len == 1 && entry[0] == '/')) {
773 efree(entry);
776 entry = index_php;
778 if (entry[0] != '/') {
779 spprintf(&entry, 0, "/%s", index_php);
784 entry = estrndup("/index.php", sizeof("/index.php"));
789 (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0 TSRMLS_CC)) == NULL) {
790 phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len TSRMLS_CC);
814 ctr.line_len = spprintf(&(ctr.line), 4096, "Location: %s%s", path_info, entry + 1);
816 ctr.line_len = spprintf(&(ctr.line), 4096, "Location: %s%s", path_info, entry);
835 (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0 TSRMLS_CC)) == NULL) {
836 phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len TSRMLS_CC);
844 char *ext = zend_memrchr(entry, '.', entry_len);
880 code = phar_file_type(&PHAR_G(mime_types), entry, &mime_type TSRMLS_CC);
882 …ret = phar_file_action(phar, info, mime_type, code, entry, entry_len, fname, pt, ru, ru_len TSRMLS…
1154 char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname;
1186 …if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, !is_data, …
1210 if (entry) {
1211 efree(entry);
1244 efree(entry);
1257 if (entry) {
1258 fname_len = spprintf(&fname, 0, "phar://%s%s", phar_data->fname, entry);
1259 efree(entry);
1339 char *fname, *error, *zname, *arch, *entry; local
1365 …", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 …
1369 efree(entry);
1373 efree(entry);
1536 fname_len = spprintf(&fname, 0, "%s%c%s", test, DEFAULT_SLASH, intern->u.dir.entry.d_name);
2043 static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp TSRMLS_DC) /* {{{ */ argument
2049 if (FAILURE == phar_open_entry_fp(entry, &error, 1 TSRMLS_CC)) {
2052 …phar archive \"%s\", unable to open entry \"%s\" contents: %s", entry->phar->fname, entry->filenam…
2056 …ert phar archive \"%s\", unable to open entry \"%s\" contents", entry->phar->fname, entry->filenam…
2062 phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC);
2064 link = phar_get_link_source(entry TSRMLS_CC);
2067 link = entry;
2072 …ert phar archive \"%s\", unable to copy entry \"%s\" contents", entry->phar->fname, entry->filenam…
2076 if (entry->fp_type == PHAR_MOD) {
2078 entry->cfp = entry->fp;
2079 entry->fp = NULL;
2083 entry->fp_type = PHAR_FP;
2084 entry->offset = offset;
2287 phar_entry_info *entry, newentry; local
2347 if (FAILURE == zend_hash_get_current_data(&source->manifest, (void **) &entry)) {
2356 newentry = *entry;
2401 newentry.tar_type = (entry->is_dir ? TAR_DIR : TAR_FILE);
2691 phar_entry_info *entry; local
2709 …ESS == zend_hash_find(&phar_obj->arc.archive->manifest, fname, (uint) fname_len, (void**)&entry)) {
2710 if (entry->is_deleted) {
2714 entry->is_deleted = 1;
2715 entry->is_modified = 1;
3210 phar_entry_info *entry = (phar_entry_info *)pDest; local
3213 if (entry->is_deleted) {
3217 entry->old_flags = entry->flags;
3218 entry->flags &= ~PHAR_ENT_COMPRESSION_MASK;
3219 entry->flags |= compress;
3220 entry->is_modified = 1;
3227 phar_entry_info *entry = (phar_entry_info *)pDest; local
3229 if (entry->is_deleted) {
3234 if (entry->flags & PHAR_ENT_COMPRESSED_BZ2) {
3240 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) {
3618 phar_entry_info *entry; local
3627 …ESS == zend_hash_find(&phar_obj->arc.archive->manifest, fname, (uint) fname_len, (void**)&entry)) {
3628 if (entry->is_deleted) {
3656 phar_entry_info *entry; local
3664 …if (!(entry = phar_get_entry_info_dir(phar_obj->arc.archive, fname, fname_len, 1, &error, 0 TSRMLS…
3682 if (entry->is_temp_dir) {
3683 efree(entry->filename);
3684 efree(entry);
3838 phar_entry_info *entry; local
3851 …ESS == zend_hash_find(&phar_obj->arc.archive->manifest, fname, (uint) fname_len, (void**)&entry)) {
3852 if (entry->is_deleted) {
3863 zend_hash_find(&phar_obj->arc.archive->manifest, fname, (uint) fname_len, (void **)&entry);
3865 entry->is_modified = 0;
3866 entry->is_deleted = 1;
4185 static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len,… argument
4193 if (entry->is_mounted) {
4198 …if (entry->filename_len >= sizeof(".phar")-1 && !memcmp(entry->filename, ".phar", sizeof(".phar")-…
4202 len = spprintf(&fullpath, 0, "%s/%s", dest, entry->filename);
4208 if (entry->filename_len > 50) {
4209 tmp = estrndup(entry->filename, 50);
4213 …ract \"%s\" to \"%s...\", extracted filename is too long for filesystem", entry->filename, fullpat…
4220 spprintf(error, 4096, "Cannot extract \"%s\", internal error", entry->filename);
4226 … extract \"%s\" to \"%s\", openbasedir/safe mode restrictions in effect", entry->filename, fullpat…
4233 …spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", path already exists", entry->filename, ful…
4239 slash = zend_memrchr(entry->filename, '/', entry->filename_len);
4242 fullpath[dest_len + (slash - entry->filename) + 1] = '\0';
4248 if (entry->is_dir) {
4249 …if (!php_stream_mkdir(fullpath, entry->flags & PHAR_ENT_PERM_MASK, PHP_STREAM_MKDIR_RECURSIVE, NU…
4250 …spprintf(error, 4096, "Cannot extract \"%s\", could not create directory \"%s\"", entry->filename,…
4256 …spprintf(error, 4096, "Cannot extract \"%s\", could not create directory \"%s\"", entry->filename,…
4264 fullpath[dest_len + (slash - entry->filename) + 1] = '/';
4270 if (entry->is_dir) {
4282 …spprintf(error, 4096, "Cannot extract \"%s\", could not open for writing \"%s\"", entry->filename,…
4287 if (!phar_get_efp(entry, 0 TSRMLS_CC)) {
4288 if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
4290 …nnot extract \"%s\" to \"%s\", unable to open internal file pointer: %s", entry->filename, fullpat…
4292 … "Cannot extract \"%s\" to \"%s\", unable to open internal file pointer", entry->filename, fullpat…
4300 if (FAILURE == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
4301 … "Cannot extract \"%s\" to \"%s\", unable to seek internal file pointer", entry->filename, fullpat…
4307 …if (SUCCESS != phar_stream_copy_to_stream(phar_get_efp(entry, 0 TSRMLS_CC), fp, entry->uncompresse…
4308 …spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", copying contents failed", entry->filename,…
4315 mode = (mode_t) entry->flags & PHAR_ENT_PERM_MASK;
4318 …spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", setting file permissions failed", entry->f…
4336 phar_entry_info *entry; local
4422 …har_obj->arc.archive->manifest, Z_STRVAL_PP(zval_file), Z_STRLEN_PP(zval_file), (void **)&entry)) {
4426 if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
4441 …URE == zend_hash_find(&phar_obj->arc.archive->manifest, filename, filename_len, (void **)&entry)) {
4447 if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
4466 if (zend_hash_get_current_data(&phar->manifest, (void **)&entry) == FAILURE) {
4470 if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
4488 char *fname, *arch, *entry, *error; local
4501 if (entry_obj->ent.entry) {
4506 …e, "phar://", 7) || phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 …
4514 efree(entry);
4526 …if ((entry_info = phar_get_entry_info_dir(phar_data, entry, entry_len, 1, &error, 1 TSRMLS_CC)) ==…
4528 …"Cannot access phar file entry '%s' in archive '%s'%s%s", entry, arch, error ? ", " : "", error ? …
4530 efree(entry);
4535 efree(entry);
4537 entry_obj->ent.entry = entry_info;
4549 if (!entry_obj->ent.entry) { \
4562 if (entry_obj->ent.entry && entry_obj->ent.entry->is_temp_dir) {
4563 if (entry_obj->ent.entry->filename) {
4564 efree(entry_obj->ent.entry->filename);
4565 entry_obj->ent.entry->filename = NULL;
4568 efree(entry_obj->ent.entry);
4569 entry_obj->ent.entry = NULL;
4585 RETURN_LONG(entry_obj->ent.entry->compressed_filesize);
4604 RETURN_BOOL(entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSION_MASK);
4606 RETURN_BOOL(entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_GZ);
4608 RETURN_BOOL(entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_BZ2);
4627 if (entry_obj->ent.entry->is_dir) {
4633 if (entry_obj->ent.entry->is_crc_checked) {
4634 RETURN_LONG(entry_obj->ent.entry->crc32);
4653 RETURN_BOOL(entry_obj->ent.entry->is_crc_checked);
4668 RETURN_LONG(entry_obj->ent.entry->flags & ~(PHAR_ENT_PERM_MASK|PHAR_ENT_COMPRESSION_MASK));
4681 if (entry_obj->ent.entry->is_temp_dir) {
4683 …y directory (not an actual entry in the archive), cannot chmod", entry_obj->ent.entry->filename); \
4687 if (PHAR_G(readonly) && !entry_obj->ent.entry->phar->is_data) {
4688 … \"%s\", write operations are prohibited", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
4696 if (entry_obj->ent.entry->is_persistent) {
4697 phar_archive_data *phar = entry_obj->ent.entry->phar;
4704 …nd(&phar->manifest, entry_obj->ent.entry->filename, entry_obj->ent.entry->filename_len, (void **)&…
4707 entry_obj->ent.entry->flags &= ~PHAR_ENT_PERM_MASK;
4709 entry_obj->ent.entry->flags |= perms;
4710 entry_obj->ent.entry->old_flags = entry_obj->ent.entry->flags;
4711 entry_obj->ent.entry->phar->is_modified = 1;
4712 entry_obj->ent.entry->is_modified = 1;
4726 phar_flush(entry_obj->ent.entry->phar, 0, 0, 0, &error TSRMLS_CC);
4746 RETURN_BOOL(entry_obj->ent.entry->metadata != NULL);
4761 if (entry_obj->ent.entry->metadata) {
4762 if (entry_obj->ent.entry->is_persistent) {
4764 … char *buf = estrndup((char *) entry_obj->ent.entry->metadata, entry_obj->ent.entry->metadata_len);
4766 phar_parse_metadata(&buf, &ret, entry_obj->ent.entry->metadata_len TSRMLS_CC);
4770 RETURN_ZVAL(entry_obj->ent.entry->metadata, 1, 0);
4785 if (PHAR_G(readonly) && !entry_obj->ent.entry->phar->is_data) {
4790 if (entry_obj->ent.entry->is_temp_dir) {
4800 if (entry_obj->ent.entry->is_persistent) {
4801 phar_archive_data *phar = entry_obj->ent.entry->phar;
4808 …nd(&phar->manifest, entry_obj->ent.entry->filename, entry_obj->ent.entry->filename_len, (void **)&…
4810 if (entry_obj->ent.entry->metadata) {
4811 zval_ptr_dtor(&entry_obj->ent.entry->metadata);
4812 entry_obj->ent.entry->metadata = NULL;
4815 MAKE_STD_ZVAL(entry_obj->ent.entry->metadata);
4816 ZVAL_ZVAL(entry_obj->ent.entry->metadata, metadata, 1, 0);
4818 entry_obj->ent.entry->is_modified = 1;
4819 entry_obj->ent.entry->phar->is_modified = 1;
4820 phar_flush(entry_obj->ent.entry->phar, 0, 0, 0, &error TSRMLS_CC);
4842 if (PHAR_G(readonly) && !entry_obj->ent.entry->phar->is_data) {
4847 if (entry_obj->ent.entry->is_temp_dir) {
4853 if (entry_obj->ent.entry->metadata) {
4854 if (entry_obj->ent.entry->is_persistent) {
4855 phar_archive_data *phar = entry_obj->ent.entry->phar;
4862 …nd(&phar->manifest, entry_obj->ent.entry->filename, entry_obj->ent.entry->filename_len, (void **)&…
4864 zval_ptr_dtor(&entry_obj->ent.entry->metadata);
4865 entry_obj->ent.entry->metadata = NULL;
4866 entry_obj->ent.entry->is_modified = 1;
4867 entry_obj->ent.entry->phar->is_modified = 1;
4869 phar_flush(entry_obj->ent.entry->phar, 0, 0, 0, &error TSRMLS_CC);
4900 if (entry_obj->ent.entry->is_dir) {
4902 …ts, \"%s\" in phar \"%s\" is a directory", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
4906 link = phar_get_link_source(entry_obj->ent.entry TSRMLS_CC);
4909 link = entry_obj->ent.entry;
4914 …ieve contents, \"%s\" in phar \"%s\": %s", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
4921 …trieve contents of \"%s\" in phar \"%s\"", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
4948 if (entry_obj->ent.entry->is_tar) {
4954 if (entry_obj->ent.entry->is_dir) {
4960 if (PHAR_G(readonly) && !entry_obj->ent.entry->phar->is_data) {
4966 if (entry_obj->ent.entry->is_deleted) {
4972 if (entry_obj->ent.entry->is_persistent) {
4973 phar_archive_data *phar = entry_obj->ent.entry->phar;
4980 …nd(&phar->manifest, entry_obj->ent.entry->filename, entry_obj->ent.entry->filename_len, (void **)&…
4984 if (entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_GZ) {
4988 if ((entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_BZ2) != 0) {
4996 if (SUCCESS != phar_open_entry_fp(entry_obj->ent.entry, &error, 1 TSRMLS_CC)) {
4998 …"%s\" in order to compress with gzip: %s", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
5010 entry_obj->ent.entry->old_flags = entry_obj->ent.entry->flags;
5011 entry_obj->ent.entry->flags &= ~PHAR_ENT_COMPRESSION_MASK;
5012 entry_obj->ent.entry->flags |= PHAR_ENT_COMPRESSED_GZ;
5015 if (entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_BZ2) {
5019 if ((entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_GZ) != 0) {
5027 if (SUCCESS != phar_open_entry_fp(entry_obj->ent.entry, &error, 1 TSRMLS_CC)) {
5029 …%s\" in order to compress with bzip2: %s", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
5040 entry_obj->ent.entry->old_flags = entry_obj->ent.entry->flags;
5041 entry_obj->ent.entry->flags &= ~PHAR_ENT_COMPRESSION_MASK;
5042 entry_obj->ent.entry->flags |= PHAR_ENT_COMPRESSED_BZ2;
5049 entry_obj->ent.entry->phar->is_modified = 1;
5050 entry_obj->ent.entry->is_modified = 1;
5051 phar_flush(entry_obj->ent.entry->phar, 0, 0, 0, &error TSRMLS_CC);
5074 if (entry_obj->ent.entry->is_dir) {
5080 if ((entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSION_MASK) == 0) {
5084 if (PHAR_G(readonly) && !entry_obj->ent.entry->phar->is_data) {
5090 if (entry_obj->ent.entry->is_deleted) {
5096 if ((entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_GZ) != 0 && !PHAR_G(has_zlib)) {
5102 if ((entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_BZ2) != 0 && !PHAR_G(has_bz2)) {
5108 if (entry_obj->ent.entry->is_persistent) {
5109 phar_archive_data *phar = entry_obj->ent.entry->phar;
5116 …nd(&phar->manifest, entry_obj->ent.entry->filename, entry_obj->ent.entry->filename_len, (void **)&…
5118 if (!entry_obj->ent.entry->fp) {
5119 if (FAILURE == phar_open_archive_fp(entry_obj->ent.entry->phar TSRMLS_CC)) {
5120 …not open phar archive \"%s\" for reading", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
5123 entry_obj->ent.entry->fp_type = PHAR_FP;
5126 entry_obj->ent.entry->old_flags = entry_obj->ent.entry->flags;
5127 entry_obj->ent.entry->flags &= ~PHAR_ENT_COMPRESSION_MASK;
5128 entry_obj->ent.entry->phar->is_modified = 1;
5129 entry_obj->ent.entry->is_modified = 1;
5130 phar_flush(entry_obj->ent.entry->phar, 0, 0, 0, &error TSRMLS_CC);
5253 ZEND_ARG_INFO(0, entry)
5264 ZEND_ARG_INFO(0, entry)
5269 ZEND_ARG_INFO(0, entry)