PHP Classes

IndexFile: Initialize a directory with a template index file

Recommend this page to a friend!
  Info   View files Example   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 104 All time: 9,662 This week: 263Up
Version License PHP version Categories
index-file 1.0.3MIT/X Consortium ...5.2PHP 5, Files and Folders


This is a simple class that can initialize a directory with a template index file.

It can take the path of a given directory and copies a given template file to the index.php file.

If the index.php file already exists, it copies the template file to the index-2.php file instead.

Picture of Gavin Gordon Markowski
  Performance   Level  
Name: Gavin Gordon Markowski <contact>
Classes: 13 packages by
Country: Canada Canada
Age: 35
All time rank: 178941 in Canada Canada
Week rank: 587 Up8 in Canada Canada Up
Innovation award
Innovation award
Nominee: 5x



   // include the class file

    include( strtolower( 'IndexFile.class.php' ) );

   // a directory to place the new file inside

   $workspace = realpath( './workspace' );

   // static call to create new file

   IndexFile::create( $workspace );

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.txt Example An example of how to use the IndexFile class.
Plain text file indexfile.class.php Class IndexFile class file
Accessible without login Plain text file IndexFileTemplate.php Data The html5 template file
Accessible without login Plain text file readme.txt Data Read me file

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,662
This week:263Up