<?php
/* This document is meant to follow PSR-1 and PSR-2 php-fig standards
http://www.php-fig.org/psr/psr-1/
http://www.php-fig.org/psr/psr-2/ */
/**
* file, folder, and path related functions
*
* This file contains file, folder, and path related functions that are useful
* elsewhere in the framework.
*
* @copyright Copyright 2015 Asher Wolfstein
* @author Asher Wolfstein <asherwunk@gmail.com>
* @link http://wunk.me/ The author's URL
* @link http://www.furdev.com/primus-artificial-intelligence-framework/ Framework URL
* @license http://opensource.org/licenses/MIT
* @package File
* @subpackage Utilities
*
*/
/**
* Falcraft Resource Namespace
*
*/
namespace Falcraft\Resource
{
/**
* CHANGELOG
*
* 1.0: Created and Documented Utility class - February 22nd, 2014
* 2.0: Renamed and refactored to primus 2 - October 21st, 2015
*
* @version 2.0
*/
class FileUtility
{
/**
* Remove prefixes from path, such as C: or F: (windows)
*
* @static
*
* @param string $path The path to affect
*
* @return string
*
*/
public static function normalizePath( $path )
{
if ( strpos($path, ':') == 1 )
{
$path = explode( ':', $path );
array_shift( $path );
$path = implode( ':', $path );
}
return $path;
}
}
}
|