public object addFile(ScriptContext context, object filename, object localname, object start, object length) { string fpath = Core.Convert.ObjectToString(filename); string flocal = Core.Convert.ObjectToString(localname); int fstart = Core.Convert.ObjectToInteger(start); int flength = Core.Convert.ObjectToInteger(length); try { using (PhpStream handle = PhpStream.Open(fpath, "r", StreamOpenOptions.Empty)) { if (fstart > 0) { PhpFile.Seek(handle, fstart); } FileHandleDataSource src = new FileHandleDataSource(handle, flength); this.m_zip.BeginUpdate(); this.m_zip.Add(src, flocal); this.m_zip.CommitUpdate(); return(true); } } catch (Exception ex) { Debug.WriteLine("ZipArchive::addFile", ex.Message); return(false); } }
public static object GzRead(PhpResource zp, int length) { return(PhpFile.Read(zp, length)); }
public static int GzWrite(PhpResource zp, PhpBytes str, int length) { return(PhpFile.Write(zp, str, length)); }
public static object GzGetStringStripped(PhpResource zp, int length, PhpBytes allowable_tags) { return(PhpFile.ReadLineStripTags(zp, length, allowable_tags.ToString())); }
public static int GzPassthru(PhpResource zp) { return(PhpFile.PassThrough(zp)); }
public static object GzGetChar(PhpResource zp) { return(PhpFile.ReadChar(zp)); }
public static object GzGetString(PhpResource zp, int length) { return(PhpFile.ReadLine(zp, length)); }
public static bool GzClose(PhpResource zp) { return(PhpFile.Close(zp)); }
public static object GzTell(PhpResource zp) { return(PhpFile.Tell(zp)); }
public static int GzSeek(PhpResource zp, int offset, int whence) { return(PhpFile.Seek(zp, offset, whence)); }
public static bool GzRewind(PhpResource zp) { return(PhpFile.Rewind(zp)); }
public static bool GzEof(PhpResource zp) { return(PhpFile.Eof(zp)); }