PHP Classes

IndexFile: Initialize a directory with a template index file

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 106 All time: 9,705 This week: 47Up
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: 178541 in Canada Canada
Week rank: 200 Up3 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 (4)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:106
This week:0
All time:9,705
This week:47Up