PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Zafar Iqbal   BinPacker   test.php   Download  
File: test.php
Role: Auxiliary script
Content type: text/plain
Description: Test File
Class: BinPacker
Pack files without exceeding a given size limit
Author: By
Last change:
Date: 19 years ago
Size: 1,560 bytes


Class file image Download

// Require class file

// Create Bin Packer Object
// You can ignore argument if you don't want verbose output
$myobj=new BinPacker(true);

// Change default Bin Size (which is 690M) to another size
// First argument is a number and the second a unit
// Unit can be (G)igabyte, (M)egabyte, (K)ilobyte or (B)yte

// Add all files with 'mpg' extensions in folder, includeing subfolders
// You can ignore extension argument which will then include every file
// The 'True' argument can be ignored if you don't want to recurse into
// directories

// Add all files with 'avi' extension in directory, including sub directories
// Just to show that the case of extension string argument does not matter

// Add all files with 'zip' extension in one directory only
// No recursion here

// Add all files in single directory - do not recurse

// Add specific file

// Pack everything

// Move everything to output directory
// Ignoring argument will cause a COPY operation
// Method also creates txt files which give information about what files are
// contained in each bin

// Thats it folks! Check your output directory!
// Class has auto destructor... which doesn't do much at the moment.