Lines Matching refs:manifest

197  * When all uses of a phar have been concluded, this frees the manifest
217 if (HT_IS_INITIALIZED(&phar->manifest)) {
218 zend_hash_destroy(&phar->manifest);
219 HT_INVALIDATE(&phar->manifest);
292 if (!zend_hash_num_elements(&phar->manifest)) {
355 /* first, iterate over the manifest and close all PHAR_TMP entry fp handles,
357 zend_hash_apply(&(phar_data->manifest), phar_tmpclose_apply);
371 * destructor for the manifest hash, frees each file's entry
466 zend_hash_str_del(&idata->phar->manifest, idata->internal_file->filename, idata->internal_file->filename_len);
568 if (PHAR_G(readonly) && NULL == (stub = zend_hash_str_find_ptr(&(phar->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1))) {
603 * Parse out metadata from the manifest for a single file
647 * Size of fixed fields in the manifest.
654 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest header)"); \
662 * FAILURE, and setting pphar to the pointer to the manifest entry
664 * This is used by phar_open_from_filename to process the manifest, but can be called
697 MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at stub end)")
704 MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at stub end)")
710 MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at stub end)")
720 /* make sure we are at the right location to read the manifest */
725 /* read in manifest */
729 MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at manifest length)")
735 /* prevent serious memory issues by limiting manifest to at most 100 MB in length */
736 MAPPHAR_ALLOC_FAIL("manifest cannot be larger than 100 MB in phar \"%s\"")
744 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest header)")
751 MAPPHAR_FAIL("in phar \"%s\", manifest claims to have zero entries. Phars must have at least 1 entry");
983 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest header)")
1022 MAPPHAR_FAIL("internal corruption of phar \"%s\" (too many manifest entries for size of manifest)")
1045 /* set up our manifest */
1046 zend_hash_init(&mydata->manifest, manifest_count,
1065 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)")
1079 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)");
1122 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)");
1184 zend_hash_add_mem(&mydata->manifest, str, (void*)&entry, sizeof(phar_entry_info));
1308 if (NULL == (stub = zend_hash_str_find_ptr(&((*test)->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1))) {
1394 /* set up our manifest */
1421 zend_hash_init(&mydata->manifest, sizeof(phar_entry_info),
1492 * that the manifest is proper, then pass it to phar_parse_pharfile(). SUCCESS
1493 * or FAILURE is returned and pphar is set to a pointer to the phar's manifest
1578 * that the manifest is proper, then pass it to phar_parse_pharfile(). SUCCESS
1579 * or FAILURE is returned and pphar is set to a pointer to the phar's manifest
2275 * to set up its manifest directly
2508 char manifest[18], entry_buffer[24];
2533 if (!zend_hash_num_elements(&phar->manifest) && !user_stub) {
2682 zend_hash_apply(&phar->manifest, phar_flush_clean_deleted_apply);
2684 /* compress as necessary, calculate crcs, serialize meta-data, manifest size, and file sizes */
2693 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) {
2715 /* after excluding deleted files, calculate manifest size in bytes and number of entries */
2738 /* 32 bits for filename length, length of filename, manifest + metadata, and add 1 for trailing / if a directory */
2855 /* write out manifest pre-header */
2856 /* 4: manifest length
2857 * 4: manifest entry count
2870 manifest_len = offset + phar->alias_len + sizeof(manifest) + (main_metadata_str.s ? ZSTR_LEN(main_metadata_str.s) : 0);
2871 phar_set_32(manifest, manifest_len);
2872 /* Hack - see bug #65028, add padding byte to the end of the manifest */
2873 if(manifest[0] == '\r' || manifest[0] == '\n') {
2875 phar_set_32(manifest, manifest_len);
2878 phar_set_32(manifest+4, new_manifest_count);
2880 *(manifest + 8) = (unsigned char) (((PHAR_API_VERSION) >> 8) & 0xFF);
2881 *(manifest + 9) = (unsigned char) (((PHAR_API_VERSION) & 0xF0));
2883 *(manifest + 8) = (unsigned char) (((PHAR_API_VERSION_NODIR) >> 8) & 0xFF);
2884 *(manifest + 9) = (unsigned char) (((PHAR_API_VERSION_NODIR) & 0xF0));
2886 phar_set_32(manifest+10, global_flags);
2887 phar_set_32(manifest+14, phar->alias_len);
2889 /* write the manifest header */
2890 if (sizeof(manifest) != php_stream_write(newfile, manifest, sizeof(manifest))
2901 spprintf(error, 0, "unable to write manifest header of new phar \"%s\"", phar->fname);
2909 phar_set_32(manifest, main_metadata_str.s ? ZSTR_LEN(main_metadata_str.s) : 0);
2910 if (4 != php_stream_write(newfile, manifest, 4) || ((main_metadata_str.s ? ZSTR_LEN(main_metadata_str.s) : 0)
2922 spprintf(error, 0, "unable to write manifest meta-data of new phar \"%s\"", phar->fname);
2929 /* re-calculate the manifest location to simplify later code */
2932 /* now write the manifest */
2933 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) {
2955 spprintf(error, 0, "unable to write filename of directory \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->fname);
2957 spprintf(error, 0, "unable to write filename of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->fname);
2963 /* set the manifest meta-data:
2990 spprintf(error, 0, "unable to write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->fname);
2996 /* Hack - see bug #65028, add padding byte to the end of the manifest */
2998 if(1 != php_stream_write(newfile, manifest, 1)) {
3006 spprintf(error, 0, "unable to write manifest padding byte");
3015 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) {
3225 ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) {
3489 stuff[pphar->phar_pos].manifest = (phar_entry_fp_info *) ecalloc( zend_hash_num_elements(&(pphar->manifest)), sizeof(phar_entry_fp_info));
3528 efree(PHAR_G(cached_fp)[i].manifest);