Login   Register  
PHP Classes
elePHPant
Icontem

File: class_specif_examples.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of MARY Matthieu  >  class_specif  >  class_specif_examples.php  >  Download  
File: class_specif_examples.php
Role: Example script
Content type: text/plain
Description: examples of use this class
Class: class_specif
Determine OS specific file parameters
Author: By
Last change:
Date: 2003-07-06 18:27
Size: 788 bytes
 

Contents

Class file image Download
<?php
require_once "class_specif.php";
// for windows users uncomments theses lines
/*
$aTest = array("../../test.php",
               "c:\windows",
               "test.php");
check($aTest);
*/

// for linux users uncomments theses lines
/*
$aTest = array("../../test.php",
               "test.php",
               "/home/root",
               "/tmp");
check($aTest);
*/
function check($aTest){
         foreach(
$aTest as $id => $path){
               
$pattern '^('.addslashes(realpath($_SERVER['DOCUMENT_ROOT'])).')';
               
$specif = new specif(preg_match("/^($pattern)/",realpath($path)));
               echo 
"for path [".$path."] you have the path delimiter [".$specif->Path_delimiter()."]".$specif->Endline();
         }
//foreach
}//check

?>