Highway to PSR2
[openemr.git] / portal / patient / fwk / libs / verysimple / IO / FileHelper.php
blob7a88bf473e659272b9cdc788ba055eed21aa4ed1
1 <?php
2 /** @package verysimple::IO */
4 /**
5 * Provides helper functions for dealing with a file
7 * @package verysimple::IO
8 * @author Jason Hinkle
9 * @copyright 1997-2007 VerySimple, Inc.
10 * @license http://www.gnu.org/licenses/lgpl.html LGPL
11 * @version 1.0
13 class FileHelper
15 public $Name;
16 public $Path;
17 public $FolderPath;
18 public $Extention;
19 public $Prefix;
20 public $MiddleBit;
22 /**
23 * Creates a new instance of a FileHelper object
25 * @access public
26 * @param $path The
27 * full path to the file
29 function __construct($path)
31 // TODO: user build-in php functions to extract these properties
32 $this->Path = str_replace("\\", "/", $path); // normalize any directory paths
34 $this->Name = substr($this->Path, strrpos($this->Path, "/") + 1);
35 $this->Extention = substr($this->Path, strrpos($this->Path, ".") + 1);
36 $this->Prefix = substr($this->Name, 0, strpos($this->Name, "."));
37 $this->MiddleBit = substr($this->Name, strpos($this->Name, ".") + 1, strrpos($this->Name, ".") - strpos($this->Name, ".") - 1);
38 $this->FolderPath = substr($this->Path, 0, strrpos($this->Path, "/") + 1);