Lines Matching refs:manifest

187  * When all uses of a phar have been concluded, this frees the manifest
207 if (HT_IS_INITIALIZED(&phar->manifest)) {
208 zend_hash_destroy(&phar->manifest);
209 HT_INVALIDATE(&phar->manifest);
269 if (!zend_hash_num_elements(&phar->manifest)) {
332 /* first, iterate over the manifest and close all PHAR_TMP entry fp handles,
334 zend_hash_apply(&(phar_data->manifest), phar_tmpclose_apply);
348 * destructor for the manifest hash, frees each file's entry
425 zend_hash_str_del(&idata->phar->manifest, idata->internal_file->filename, idata->internal_file->filename_len);
527 if (PHAR_G(readonly) && NULL == (stub = zend_hash_str_find_ptr(&(phar->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1))) {
693 * Parse out metadata from the manifest for a single file, saving it into a string.
711 * Size of fixed fields in the manifest.
718 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest header)"); \
726 * FAILURE, and setting pphar to the pointer to the manifest entry
728 * This is used by phar_open_from_filename to process the manifest, but can be called
761 MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at stub end)")
768 MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at stub end)")
774 MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at stub end)")
784 /* make sure we are at the right location to read the manifest */
789 /* read in manifest */
793 MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at manifest length)")
799 /* prevent serious memory issues by limiting manifest to at most 100 MB in length */
800 MAPPHAR_ALLOC_FAIL("manifest cannot be larger than 100 MB in phar \"%s\"")
808 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest header)")
815 MAPPHAR_FAIL("in phar \"%s\", manifest claims to have zero entries. Phars must have at least 1 entry");
1049 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest header)")
1088 MAPPHAR_FAIL("internal corruption of phar \"%s\" (too many manifest entries for size of manifest)")
1093 HT_INVALIDATE(&mydata->manifest);
1112 /* set up our manifest */
1113 zend_hash_init(&mydata->manifest, manifest_count,
1132 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)")
1146 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)");
1184 MAPPHAR_FAIL("internal corruption of phar \"%s\" (truncated manifest entry)");
1229 zend_hash_add_mem(&mydata->manifest, str, (void*)&entry, sizeof(phar_entry_info));
1353 if (NULL == (stub = zend_hash_str_find_ptr(&((*test)->manifest), ".phar/stub.php", sizeof(".phar/stub.php")-1))) {
1439 /* set up our manifest */
1466 zend_hash_init(&mydata->manifest, sizeof(phar_entry_info),
1537 * that the manifest is proper, then pass it to phar_parse_pharfile(). SUCCESS
1538 * or FAILURE is returned and pphar is set to a pointer to the phar's manifest
1623 * that the manifest is proper, then pass it to phar_parse_pharfile(). SUCCESS
1624 * or FAILURE is returned and pphar is set to a pointer to the phar's manifest
2320 * to set up its manifest directly
2550 char manifest[18], entry_buffer[24];
2575 if (!zend_hash_num_elements(&phar->manifest) && !user_stub) {
2720 zend_hash_apply(&phar->manifest, phar_flush_clean_deleted_apply);
2722 /* compress as necessary, calculate crcs, serialize meta-data, manifest size, and file sizes */
2733 ZEND_HASH_MAP_FOREACH_PTR(&phar->manifest, entry) {
2755 /* after excluding deleted files, calculate manifest size in bytes and number of entries */
2773 /* 32 bits for filename length, length of filename, manifest + metadata, and add 1 for trailing / if a directory */
2887 /* write out manifest pre-header */
2888 /* 4: manifest length
2889 * 4: manifest entry count
2902 manifest_len = offset + phar->alias_len + sizeof(manifest) + (main_metadata_str.s ? ZSTR_LEN(main_metadata_str.s) : 0);
2903 phar_set_32(manifest, manifest_len);
2904 /* Hack - see bug #65028, add padding byte to the end of the manifest */
2905 if(manifest[0] == '\r' || manifest[0] == '\n') {
2907 phar_set_32(manifest, manifest_len);
2910 phar_set_32(manifest+4, new_manifest_count);
2912 *(manifest + 8) = (unsigned char) (((PHAR_API_VERSION) >> 8) & 0xFF);
2913 *(manifest + 9) = (unsigned char) (((PHAR_API_VERSION) & 0xF0));
2915 *(manifest + 8) = (unsigned char) (((PHAR_API_VERSION_NODIR) >> 8) & 0xFF);
2916 *(manifest + 9) = (unsigned char) (((PHAR_API_VERSION_NODIR) & 0xF0));
2918 phar_set_32(manifest+10, global_flags);
2919 phar_set_32(manifest+14, phar->alias_len);
2921 /* write the manifest header */
2922 if (sizeof(manifest) != php_stream_write(newfile, manifest, sizeof(manifest))
2933 spprintf(error, 0, "unable to write manifest header of new phar \"%s\"", phar->fname);
2941 phar_set_32(manifest, main_metadata_str.s ? ZSTR_LEN(main_metadata_str.s) : 0);
2942 if (4 != php_stream_write(newfile, manifest, 4) || ((main_metadata_str.s ? ZSTR_LEN(main_metadata_str.s) : 0)
2954 spprintf(error, 0, "unable to write manifest meta-data of new phar \"%s\"", phar->fname);
2961 /* re-calculate the manifest location to simplify later code */
2964 /* now write the manifest */
2965 ZEND_HASH_MAP_FOREACH_PTR(&phar->manifest, entry) {
2988 spprintf(error, 0, "unable to write filename of directory \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->fname);
2990 spprintf(error, 0, "unable to write filename of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->fname);
2996 /* set the manifest meta-data:
3024 spprintf(error, 0, "unable to write temporary manifest of file \"%s\" to manifest of new phar \"%s\"", entry->filename, phar->fname);
3030 /* Hack - see bug #65028, add padding byte to the end of the manifest */
3032 if(1 != php_stream_write(newfile, manifest, 1)) {
3040 spprintf(error, 0, "unable to write manifest padding byte");
3049 ZEND_HASH_MAP_FOREACH_PTR(&phar->manifest, entry) {
3261 ZEND_HASH_MAP_FOREACH_PTR(&phar->manifest, entry) {
3515 stuff[pphar->phar_pos].manifest = (phar_entry_fp_info *) ecalloc( zend_hash_num_elements(&(pphar->manifest)), sizeof(phar_entry_fp_info));
3554 efree(PHAR_G(cached_fp)[i].manifest);