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: 105 All time: 9,697 This week: 455Up
Version License PHP version Categories
index-file 1.0.3MIT/X Consortium ...5.2PHP 5, Files and Folders
Description 

Author

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: 36
All time rank: 178641 in Canada Canada
Week rank: 321 Up6 in Canada Canada Up
Innovation award
Innovation award
Nominee: 5x

Example


<?php

   // 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 );

Details

Use 'IndexFile' to quickly and easily create HTML5 boilerplate files in the directory of your choice. I created this class in order to speed up production of basic files, thus reducing the need for repetitive task handling.

  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  
 0%
Total:105
This week:0
All time:9,697
This week:455Up