MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / read_file

Method read_file

src/phar.rs:135–138  ·  view source on GitHub ↗

Extract the content of a file inside the phar.

(&self, internal_path: &str)

Source from the content-addressed store, hash-verified

133
134 /// Extract the content of a file inside the phar.
135 pub fn read_file(&self, internal_path: &str) -> Option<&[u8]> {
136 let &(offset, size) = self.files.get(internal_path)?;
137 self.data.get(offset..offset + size)
138 }
139
140 /// Iterate over all file paths in the archive.
141 pub fn file_paths(&self) -> impl Iterator<Item = &str> {

Callers 2

scan_phar_archiveMethod · 0.80
parse_and_cache_fileMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected