Jump to content

jfreak53

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jfreak53's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yep your correct, I didn't really get into the setup file to look at the functions of it, from what I can see it's pretty straight forward how it get's the files out and back into their original format: [quote]function process_setup_file( &$sf_h, $type = 0 ){ $fileCount = 0; $file = null; echo "<B>Writing files:</B><BR>"; while( ! feof($sf_h) ){ // $line = trim(fgets($sf_h, 1024)); $line = rtrim(fgets($sf_h, 64000)); if( strlen($line) > 0 ){ if( preg_match("/startFile\s*:\s*([^\s]+)\s*:\s*(\d)$/", $line, $matches) ){ // NEW FILE // CLOSE OLD if( $file ){ fclose($file); @chmod($fullFileName, 0666); $file = null; $fileCount++; } // START NEW $fileName = trim( $matches[1] ); $fileType = (int)trim( $matches[2] ); if( ($fileType != FILE_TYPE_SKIP) && ($type == $fileType) ){ echo "$fileName<BR>"; $fullFileName = MAIN_DIR . '/' . $fileName; makeDir( dirname($fullFileName) ); if( ! ($file = fopen($fullFileName, 'w')) ) fatalError( "Can't open file '$fullFileName' for writing<BR>" ); } // copy the new non-application files if any appeared if( ($type != $fileType) && ($type == FILE_TYPE_APP) ){ $fullFileName = MAIN_DIR . '/' . $fileName; if( ! file_exists($fullFileName) ){ echo "$fileName<BR>"; makeDir( dirname($fullFileName) ); if( ! ($file = fopen($fullFileName, 'w')) ) fatalError( "Can't open file '$fullFileName' for writing<BR>" ); } } } else { // EXISTING FILE if( $file ){ if( ftell($file) > 0 ) fwrite($file, "\n"); fwrite($file, $line); } } } else { // WRITE EMPTY LINE if( $file ) fwrite($file, "\n"); } } if( $file ){ fclose($file); @chmod($fullFileName, 0666); } return $fileCount; } function fatalError( $msg ){ echo $msg; exit; }[/quote] The start of every new file is like this: [quote]startFile : mwftp5/common/classes/mwfCommonView.php : 1[/quote] So I mean it's pretty straight forward design the "extracting them", so I guess to make a "compactor" as it would be, would just be the reverse of all that, parsing the other way.  I was just checking if someone has heard of a program or script that does that, the "reverse" that is, because I liked it for large systems, makes it easier to upload in one file than many files.
  2. Ok, I downloaded a program called MyWebFTP Free, and only four files come with this program.  When I upload it I run one of them and it extracts all the other files from one of those four, so I looked at it and it's a PHP file with all of the other PHP files and Images and all other things inside of it, there not compressed, it just contains the files contents inside of another PHP file, for quicker uploading I guess.  But I liked this and I would like to know if anyone knows how this is done, is there a program or a script that does this or is it done manually?? This is the actual funtion inside the setup.php file that extracts the other files as I can see: [code]function step_core(){ echo "<H3>Install Application Files</H3>"; $ifh = fopen( MAIN_DIR . '/' . SETUP_FILE, 'rb'); rewind($ifh); //first line is service one $line = fgets($ifh, 1024); $fileCount = process_setup_file( $ifh, FILE_TYPE_APP ); echo "<BR>$fileCount files have been extracted. <BR><BR>"; fclose($ifh); } [/code] Thanks in advance. Joel
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.