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
183 if (entry[0] == '/') { in phar_file_action()
184 name_len = spprintf(&name, 4096, "phar://%s%s", arch, entry); in phar_file_action()
186 name_len = spprintf(&name, 4096, "phar://%s/%s", arch, entry); in phar_file_action()
242 phar_mung_server_vars(arch, entry, entry_len, basename, ru_len TSRMLS_CC); in phar_file_action()
246 if (entry[0] == '/') { in phar_file_action()
247 name_len = spprintf(&name, 4096, "phar://%s%s", arch, entry); in phar_file_action()
249 name_len = spprintf(&name, 4096, "phar://%s/%s", arch, entry); in phar_file_action()
262 if ((cwd = zend_memrchr(entry, '/', entry_len))) { in phar_file_action()
264 if (entry == cwd) { in phar_file_action()
268 } else if (entry[0] == '/') { in phar_file_action()
269 PHAR_G(cwd_len) = cwd - (entry + 1); in phar_file_action()
270 PHAR_G(cwd) = estrndup(entry + 1, PHAR_G(cwd_len)); in phar_file_action()
272 PHAR_G(cwd_len) = cwd - entry; in phar_file_action()
273 PHAR_G(cwd) = estrndup(entry, PHAR_G(cwd_len)); in phar_file_action()
333 static void phar_do_403(char *entry, int entry_len TSRMLS_DC) /* {{{ */ in phar_do_403() argument
343 PHPWRITE(entry, entry_len); in phar_do_403()
348 …e_data *phar, char *fname, int fname_len, char *f404, int f404_len, char *entry, int entry_len TSR… in phar_do_404() argument
368 PHPWRITE(entry, entry_len); in phar_do_404()
376 static void phar_postprocess_ru_web(char *fname, int fname_len, char **entry, int *entry_len, char … in phar_postprocess_ru_web() argument
378 char *e = *entry + 1, *u = NULL, *u1 = NULL, *saveu = NULL; in phar_postprocess_ru_web()
443 char *fname, *arch, *entry; in PHP_METHOD() local
454 …", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 … in PHP_METHOD()
455 efree(entry); in PHP_METHOD()
477 char *fname, *arch = NULL, *entry = NULL, *path, *actual; in PHP_METHOD() local
492 …", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 … in PHP_METHOD()
493 efree(entry); in PHP_METHOD()
494 entry = NULL; in PHP_METHOD()
519 if (path && path == entry) { in PHP_METHOD()
520 efree(entry); in PHP_METHOD()
530 if (entry && path && path == entry) { in PHP_METHOD()
531 efree(entry); in PHP_METHOD()
547 …} else if (SUCCESS == phar_split_fname(path, path_len, &arch, &arch_len, &entry, &entry_len, 2, 0 … in PHP_METHOD()
548 path = entry; in PHP_METHOD()
569 char *fname, *path_info, *mime_type = NULL, *entry, *pt; local
625 entry = estrndup(Z_STRVAL_PP(z_path_info), entry_len);
628 memcpy(path_info + Z_STRLEN_PP(z_script_name), entry, entry_len + 1);
632 entry = estrndup("", 0);
650 entry = path_info;
651 entry_len = strlen(entry);
657 entry = estrndup("", 0);
674 entry = estrndup(pt + (fname_len - (basename - fname)), entry_len);
686 ZVAL_STRINGL(params, entry, entry_len, 1);
739 efree(entry);
742 entry = estrndup(Z_STRVAL_PP(fci.retval_ptr_ptr), Z_STRLEN_PP(fci.retval_ptr_ptr));
745 entry = Z_STRVAL_P(retval_ptr);
751 phar_do_403(entry, entry_len TSRMLS_CC);
772 phar_postprocess_ru_web(fname, fname_len, &entry, &entry_len, &ru, &ru_len TSRMLS_CC);
775 if (!entry_len || (entry_len == 1 && entry[0] == '/')) {
776 efree(entry);
779 entry = index_php;
781 if (entry[0] != '/') {
782 spprintf(&entry, 0, "/%s", index_php);
787 entry = estrndup("/index.php", sizeof("/index.php"));
792 (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0 TSRMLS_CC)) == NULL) {
793 phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len TSRMLS_CC);
817 ctr.line_len = spprintf(&(ctr.line), 4096, "Location: %s%s", path_info, entry + 1);
819 ctr.line_len = spprintf(&(ctr.line), 4096, "Location: %s%s", path_info, entry);
838 (info = phar_get_entry_info(phar, entry, entry_len, NULL, 0 TSRMLS_CC)) == NULL) {
839 phar_do_404(phar, fname, fname_len, f404, f404_len, entry, entry_len TSRMLS_CC);
847 const char *ext = zend_memrchr(entry, '.', entry_len);
883 code = phar_file_type(&PHAR_G(mime_types), entry, &mime_type TSRMLS_CC);
885 …ret = phar_file_action(phar, info, mime_type, code, entry, entry_len, fname, pt, ru, ru_len TSRMLS…
1157 char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname;
1189 …if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, !is_data, …
1213 if (entry) {
1214 efree(entry);
1247 efree(entry);
1260 if (entry) {
1261 fname_len = spprintf(&fname, 0, "phar://%s%s", phar_data->fname, entry);
1262 efree(entry);
1342 char *fname, *error, *zname, *arch, *entry; local
1368 …", 7) && SUCCESS == phar_split_fname(zname, zname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 …
1372 efree(entry);
1376 efree(entry);
1539 fname_len = spprintf(&fname, 0, "%s%c%s", test, DEFAULT_SLASH, intern->u.dir.entry.d_name);
2046 static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp TSRMLS_DC) /* {{{ */ argument
2052 if (FAILURE == phar_open_entry_fp(entry, &error, 1 TSRMLS_CC)) {
2055 …phar archive \"%s\", unable to open entry \"%s\" contents: %s", entry->phar->fname, entry->filenam…
2059 …ert phar archive \"%s\", unable to open entry \"%s\" contents", entry->phar->fname, entry->filenam…
2065 phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC);
2067 link = phar_get_link_source(entry TSRMLS_CC);
2070 link = entry;
2075 …ert phar archive \"%s\", unable to copy entry \"%s\" contents", entry->phar->fname, entry->filenam…
2079 if (entry->fp_type == PHAR_MOD) {
2081 entry->cfp = entry->fp;
2082 entry->fp = NULL;
2086 entry->fp_type = PHAR_FP;
2087 entry->offset = offset;
2293 phar_entry_info *entry, newentry; local
2353 if (FAILURE == zend_hash_get_current_data(&source->manifest, (void **) &entry)) {
2362 newentry = *entry;
2407 newentry.tar_type = (entry->is_dir ? TAR_DIR : TAR_FILE);
2701 phar_entry_info *entry; local
2719 …ESS == zend_hash_find(&phar_obj->arc.archive->manifest, fname, (uint) fname_len, (void**)&entry)) {
2720 if (entry->is_deleted) {
2724 entry->is_deleted = 1;
2725 entry->is_modified = 1;
3220 phar_entry_info *entry = (phar_entry_info *)pDest; local
3223 if (entry->is_deleted) {
3227 entry->old_flags = entry->flags;
3228 entry->flags &= ~PHAR_ENT_COMPRESSION_MASK;
3229 entry->flags |= compress;
3230 entry->is_modified = 1;
3237 phar_entry_info *entry = (phar_entry_info *)pDest; local
3239 if (entry->is_deleted) {
3244 if (entry->flags & PHAR_ENT_COMPRESSED_BZ2) {
3250 if (entry->flags & PHAR_ENT_COMPRESSED_GZ) {
3628 phar_entry_info *entry; local
3637 …ESS == zend_hash_find(&phar_obj->arc.archive->manifest, fname, (uint) fname_len, (void**)&entry)) {
3638 if (entry->is_deleted) {
3666 phar_entry_info *entry; local
3674 …if (!(entry = phar_get_entry_info_dir(phar_obj->arc.archive, fname, fname_len, 1, &error, 0 TSRMLS…
3692 if (entry->is_temp_dir) {
3693 efree(entry->filename);
3694 efree(entry);
3848 phar_entry_info *entry; local
3861 …ESS == zend_hash_find(&phar_obj->arc.archive->manifest, fname, (uint) fname_len, (void**)&entry)) {
3862 if (entry->is_deleted) {
3873 zend_hash_find(&phar_obj->arc.archive->manifest, fname, (uint) fname_len, (void **)&entry);
3875 entry->is_modified = 0;
3876 entry->is_deleted = 1;
4195 static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len,… argument
4207 if (entry->is_mounted) {
4212 …if (entry->filename_len >= sizeof(".phar")-1 && !memcmp(entry->filename, ".phar", sizeof(".phar")-…
4220 if (virtual_file_ex(&new_state, entry->filename, NULL, CWD_EXPAND TSRMLS_CC) != 0 ||
4222 if (EINVAL == errno && entry->filename_len > 50) {
4223 char *tmp = estrndup(entry->filename, 50);
4227 spprintf(error, 4096, "Cannot extract \"%s\", internal error", entry->filename);
4253 if (entry->filename_len > 50) {
4254 tmp = estrndup(entry->filename, 50);
4258 …ract \"%s\" to \"%s...\", extracted filename is too long for filesystem", entry->filename, fullpat…
4266 spprintf(error, 4096, "Cannot extract \"%s\", internal error", entry->filename);
4273 … extract \"%s\" to \"%s\", openbasedir/safe mode restrictions in effect", entry->filename, fullpat…
4281 …spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", path already exists", entry->filename, ful…
4297 if (entry->is_dir) {
4298 …if (!php_stream_mkdir(fullpath, entry->flags & PHAR_ENT_PERM_MASK, PHP_STREAM_MKDIR_RECURSIVE, NU…
4299 …spprintf(error, 4096, "Cannot extract \"%s\", could not create directory \"%s\"", entry->filename,…
4306 …spprintf(error, 4096, "Cannot extract \"%s\", could not create directory \"%s\"", entry->filename,…
4323 if (entry->is_dir) {
4335 …spprintf(error, 4096, "Cannot extract \"%s\", could not open for writing \"%s\"", entry->filename,…
4340 if (!phar_get_efp(entry, 0 TSRMLS_CC)) {
4341 if (FAILURE == phar_open_entry_fp(entry, error, 1 TSRMLS_CC)) {
4343 …nnot extract \"%s\" to \"%s\", unable to open internal file pointer: %s", entry->filename, fullpat…
4345 … "Cannot extract \"%s\" to \"%s\", unable to open internal file pointer", entry->filename, fullpat…
4353 if (FAILURE == phar_seek_efp(entry, 0, SEEK_SET, 0, 0 TSRMLS_CC)) {
4354 … "Cannot extract \"%s\" to \"%s\", unable to seek internal file pointer", entry->filename, fullpat…
4360 …if (SUCCESS != phar_stream_copy_to_stream(phar_get_efp(entry, 0 TSRMLS_CC), fp, entry->uncompresse…
4361 …spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", copying contents failed", entry->filename,…
4368 mode = (mode_t) entry->flags & PHAR_ENT_PERM_MASK;
4371 …spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", setting file permissions failed", entry->f…
4389 phar_entry_info *entry; local
4475 …har_obj->arc.archive->manifest, Z_STRVAL_PP(zval_file), Z_STRLEN_PP(zval_file), (void **)&entry)) {
4479 if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
4494 …URE == zend_hash_find(&phar_obj->arc.archive->manifest, filename, filename_len, (void **)&entry)) {
4500 if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
4519 if (zend_hash_get_current_data(&phar->manifest, (void **)&entry) == FAILURE) {
4523 if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error TSRMLS_CC)) {
4541 char *fname, *arch, *entry, *error; local
4554 if (entry_obj->ent.entry) {
4559 …e, "phar://", 7) || phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 …
4567 efree(entry);
4579 …if ((entry_info = phar_get_entry_info_dir(phar_data, entry, entry_len, 1, &error, 1 TSRMLS_CC)) ==…
4581 …"Cannot access phar file entry '%s' in archive '%s'%s%s", entry, arch, error ? ", " : "", error ? …
4583 efree(entry);
4588 efree(entry);
4590 entry_obj->ent.entry = entry_info;
4602 if (!entry_obj->ent.entry) { \
4615 if (entry_obj->ent.entry && entry_obj->ent.entry->is_temp_dir) {
4616 if (entry_obj->ent.entry->filename) {
4617 efree(entry_obj->ent.entry->filename);
4618 entry_obj->ent.entry->filename = NULL;
4621 efree(entry_obj->ent.entry);
4622 entry_obj->ent.entry = NULL;
4638 RETURN_LONG(entry_obj->ent.entry->compressed_filesize);
4657 RETURN_BOOL(entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSION_MASK);
4659 RETURN_BOOL(entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_GZ);
4661 RETURN_BOOL(entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_BZ2);
4680 if (entry_obj->ent.entry->is_dir) {
4686 if (entry_obj->ent.entry->is_crc_checked) {
4687 RETURN_LONG(entry_obj->ent.entry->crc32);
4706 RETURN_BOOL(entry_obj->ent.entry->is_crc_checked);
4721 RETURN_LONG(entry_obj->ent.entry->flags & ~(PHAR_ENT_PERM_MASK|PHAR_ENT_COMPRESSION_MASK));
4734 if (entry_obj->ent.entry->is_temp_dir) {
4736 …y directory (not an actual entry in the archive), cannot chmod", entry_obj->ent.entry->filename); \
4740 if (PHAR_G(readonly) && !entry_obj->ent.entry->phar->is_data) {
4741 … \"%s\", write operations are prohibited", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
4749 if (entry_obj->ent.entry->is_persistent) {
4750 phar_archive_data *phar = entry_obj->ent.entry->phar;
4757 …nd(&phar->manifest, entry_obj->ent.entry->filename, entry_obj->ent.entry->filename_len, (void **)&…
4760 entry_obj->ent.entry->flags &= ~PHAR_ENT_PERM_MASK;
4762 entry_obj->ent.entry->flags |= perms;
4763 entry_obj->ent.entry->old_flags = entry_obj->ent.entry->flags;
4764 entry_obj->ent.entry->phar->is_modified = 1;
4765 entry_obj->ent.entry->is_modified = 1;
4779 phar_flush(entry_obj->ent.entry->phar, 0, 0, 0, &error TSRMLS_CC);
4799 RETURN_BOOL(entry_obj->ent.entry->metadata != NULL);
4814 if (entry_obj->ent.entry->metadata) {
4815 if (entry_obj->ent.entry->is_persistent) {
4817 … char *buf = estrndup((char *) entry_obj->ent.entry->metadata, entry_obj->ent.entry->metadata_len);
4819 phar_parse_metadata(&buf, &ret, entry_obj->ent.entry->metadata_len TSRMLS_CC);
4823 RETURN_ZVAL(entry_obj->ent.entry->metadata, 1, 0);
4838 if (PHAR_G(readonly) && !entry_obj->ent.entry->phar->is_data) {
4843 if (entry_obj->ent.entry->is_temp_dir) {
4853 if (entry_obj->ent.entry->is_persistent) {
4854 phar_archive_data *phar = entry_obj->ent.entry->phar;
4861 …nd(&phar->manifest, entry_obj->ent.entry->filename, entry_obj->ent.entry->filename_len, (void **)&…
4863 if (entry_obj->ent.entry->metadata) {
4864 zval_ptr_dtor(&entry_obj->ent.entry->metadata);
4865 entry_obj->ent.entry->metadata = NULL;
4868 MAKE_STD_ZVAL(entry_obj->ent.entry->metadata);
4869 ZVAL_ZVAL(entry_obj->ent.entry->metadata, metadata, 1, 0);
4871 entry_obj->ent.entry->is_modified = 1;
4872 entry_obj->ent.entry->phar->is_modified = 1;
4873 phar_flush(entry_obj->ent.entry->phar, 0, 0, 0, &error TSRMLS_CC);
4895 if (PHAR_G(readonly) && !entry_obj->ent.entry->phar->is_data) {
4900 if (entry_obj->ent.entry->is_temp_dir) {
4906 if (entry_obj->ent.entry->metadata) {
4907 if (entry_obj->ent.entry->is_persistent) {
4908 phar_archive_data *phar = entry_obj->ent.entry->phar;
4915 …nd(&phar->manifest, entry_obj->ent.entry->filename, entry_obj->ent.entry->filename_len, (void **)&…
4917 zval_ptr_dtor(&entry_obj->ent.entry->metadata);
4918 entry_obj->ent.entry->metadata = NULL;
4919 entry_obj->ent.entry->is_modified = 1;
4920 entry_obj->ent.entry->phar->is_modified = 1;
4922 phar_flush(entry_obj->ent.entry->phar, 0, 0, 0, &error TSRMLS_CC);
4953 if (entry_obj->ent.entry->is_dir) {
4955 …ts, \"%s\" in phar \"%s\" is a directory", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
4959 link = phar_get_link_source(entry_obj->ent.entry TSRMLS_CC);
4962 link = entry_obj->ent.entry;
4967 …ieve contents, \"%s\" in phar \"%s\": %s", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
4974 …trieve contents of \"%s\" in phar \"%s\"", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
5001 if (entry_obj->ent.entry->is_tar) {
5007 if (entry_obj->ent.entry->is_dir) {
5013 if (PHAR_G(readonly) && !entry_obj->ent.entry->phar->is_data) {
5019 if (entry_obj->ent.entry->is_deleted) {
5025 if (entry_obj->ent.entry->is_persistent) {
5026 phar_archive_data *phar = entry_obj->ent.entry->phar;
5033 …nd(&phar->manifest, entry_obj->ent.entry->filename, entry_obj->ent.entry->filename_len, (void **)&…
5037 if (entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_GZ) {
5041 if ((entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_BZ2) != 0) {
5049 if (SUCCESS != phar_open_entry_fp(entry_obj->ent.entry, &error, 1 TSRMLS_CC)) {
5051 …"%s\" in order to compress with gzip: %s", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
5063 entry_obj->ent.entry->old_flags = entry_obj->ent.entry->flags;
5064 entry_obj->ent.entry->flags &= ~PHAR_ENT_COMPRESSION_MASK;
5065 entry_obj->ent.entry->flags |= PHAR_ENT_COMPRESSED_GZ;
5068 if (entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_BZ2) {
5072 if ((entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_GZ) != 0) {
5080 if (SUCCESS != phar_open_entry_fp(entry_obj->ent.entry, &error, 1 TSRMLS_CC)) {
5082 …%s\" in order to compress with bzip2: %s", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
5093 entry_obj->ent.entry->old_flags = entry_obj->ent.entry->flags;
5094 entry_obj->ent.entry->flags &= ~PHAR_ENT_COMPRESSION_MASK;
5095 entry_obj->ent.entry->flags |= PHAR_ENT_COMPRESSED_BZ2;
5102 entry_obj->ent.entry->phar->is_modified = 1;
5103 entry_obj->ent.entry->is_modified = 1;
5104 phar_flush(entry_obj->ent.entry->phar, 0, 0, 0, &error TSRMLS_CC);
5127 if (entry_obj->ent.entry->is_dir) {
5133 if ((entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSION_MASK) == 0) {
5137 if (PHAR_G(readonly) && !entry_obj->ent.entry->phar->is_data) {
5143 if (entry_obj->ent.entry->is_deleted) {
5149 if ((entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_GZ) != 0 && !PHAR_G(has_zlib)) {
5155 if ((entry_obj->ent.entry->flags & PHAR_ENT_COMPRESSED_BZ2) != 0 && !PHAR_G(has_bz2)) {
5161 if (entry_obj->ent.entry->is_persistent) {
5162 phar_archive_data *phar = entry_obj->ent.entry->phar;
5169 …nd(&phar->manifest, entry_obj->ent.entry->filename, entry_obj->ent.entry->filename_len, (void **)&…
5171 if (!entry_obj->ent.entry->fp) {
5172 if (FAILURE == phar_open_archive_fp(entry_obj->ent.entry->phar TSRMLS_CC)) {
5173 …not open phar archive \"%s\" for reading", entry_obj->ent.entry->filename, entry_obj->ent.entry->p…
5176 entry_obj->ent.entry->fp_type = PHAR_FP;
5179 entry_obj->ent.entry->old_flags = entry_obj->ent.entry->flags;
5180 entry_obj->ent.entry->flags &= ~PHAR_ENT_COMPRESSION_MASK;
5181 entry_obj->ent.entry->phar->is_modified = 1;
5182 entry_obj->ent.entry->is_modified = 1;
5183 phar_flush(entry_obj->ent.entry->phar, 0, 0, 0, &error TSRMLS_CC);
5306 ZEND_ARG_INFO(0, entry)
5317 ZEND_ARG_INFO(0, entry)
5322 ZEND_ARG_INFO(0, entry)