Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 public static object GzRead(PhpResource zp, int length)
 {
     return(PhpFile.Read(zp, length));
 }
Esempio n. 3
0
 public static int GzWrite(PhpResource zp, PhpBytes str, int length)
 {
     return(PhpFile.Write(zp, str, length));
 }
Esempio n. 4
0
 public static object GzGetStringStripped(PhpResource zp, int length, PhpBytes allowable_tags)
 {
     return(PhpFile.ReadLineStripTags(zp, length, allowable_tags.ToString()));
 }
Esempio n. 5
0
 public static int GzPassthru(PhpResource zp)
 {
     return(PhpFile.PassThrough(zp));
 }
Esempio n. 6
0
 public static object GzGetChar(PhpResource zp)
 {
     return(PhpFile.ReadChar(zp));
 }
Esempio n. 7
0
 public static object GzGetString(PhpResource zp, int length)
 {
     return(PhpFile.ReadLine(zp, length));
 }
Esempio n. 8
0
 public static bool GzClose(PhpResource zp)
 {
     return(PhpFile.Close(zp));
 }
Esempio n. 9
0
 public static object GzTell(PhpResource zp)
 {
     return(PhpFile.Tell(zp));
 }
Esempio n. 10
0
 public static int GzSeek(PhpResource zp, int offset, int whence)
 {
     return(PhpFile.Seek(zp, offset, whence));
 }
Esempio n. 11
0
 public static bool GzRewind(PhpResource zp)
 {
     return(PhpFile.Rewind(zp));
 }
Esempio n. 12
0
 public static bool GzEof(PhpResource zp)
 {
     return(PhpFile.Eof(zp));
 }