PHP Classes

File: Falcraft/Resource/FileUtility.php

Recommend this page to a friend!
  Classes of Asher Wolfstein   Flexible AutoLoader   Falcraft/Resource/FileUtility.php   Download  
File: Falcraft/Resource/FileUtility.php
Role: Application script
Content type: text/plain
Description: File / Path Utility Functions
Class: Flexible AutoLoader
Autoloader that supports PSR-0 and other methods
Author: By
Last change:
Date: 8 years ago
Size: 1,315 bytes
 

Contents

Class file image Download
<?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;
        }
    }
}