Feat openemr fix 7480 7494 email prescription (#7495)
[openemr.git] / portal / patient / fwk / libs / verysimple / IO / FileHelper.php
blob4bea71f6b347ed7d9b60a7fd255bbdcefc72700b
1 <?php
3 /** @package verysimple::IO */
5 /**
6 * Provides helper functions for dealing with a file
8 * @package verysimple::IO
9 * @author Jason Hinkle
10 * @copyright 1997-2007 VerySimple, Inc.
11 * @license http://www.gnu.org/licenses/lgpl.html LGPL
12 * @version 1.0
14 class FileHelper
16 public $Name;
17 public $Path;
18 public $FolderPath;
19 public $Extention;
20 public $Prefix;
21 public $MiddleBit;
23 /**
24 * Creates a new instance of a FileHelper object
26 * @access public
27 * @param $path The
28 * full path to the file
30 function __construct($path)
32 // TODO: user build-in php functions to extract these properties
33 $this->Path = str_replace("\\", "/", $path); // normalize any directory paths
35 $this->Name = substr($this->Path, strrpos($this->Path, "/") + 1);
36 $this->Extention = substr($this->Path, strrpos($this->Path, ".") + 1);
37 $this->Prefix = substr($this->Name, 0, strpos($this->Name, "."));
38 $this->MiddleBit = substr($this->Name, strpos($this->Name, ".") + 1, strrpos($this->Name, ".") - strpos($this->Name, ".") - 1);
39 $this->FolderPath = substr($this->Path, 0, strrpos($this->Path, "/") + 1);