Overview

Namespaces

  • Budovy
  • Kdyby
    • BootstrapFormRenderer
      • DI
      • Latte
  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Diagnostics
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
      • Diagnostics
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • PhpGenerator
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
  • NetteModule
  • Nextras
    • Datagrid
  • None
  • PHP
  • Tester
    • CodeCoverage
    • Runner
      • Output
  • Vodacek
    • Forms
      • Controls
  • WebLoader
    • Filter
    • Nette

Classes

  • Compiler
  • DefaultOutputNamingConvention
  • FileCollection
  • LoaderFactory
  • Path

Interfaces

  • IFileCollection
  • IOutputNamingConvention

Exceptions

  • FileNotFoundException
  • InvalidArgumentException
  • WebLoaderException
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: namespace WebLoader;
 4: 
 5: class Path
 6: {
 7: 
 8:     public static function normalize($path)
 9:     {
10:         $path = strtr($path, '\\', '/');
11:         $root = (strpos($path, '/') === 0) ? '/' : '';
12:         $pieces = explode('/', trim($path, '/'));
13:         $res = array();
14: 
15:         foreach ($pieces as $piece) {
16:             if ($piece === '.' || empty($piece)) {
17:                 continue;
18:             }
19:             if ($piece === '..') {
20:                 array_pop($res);
21:             } else {
22:                 array_push($res, $piece);
23:             }
24:         }
25: 
26:         return $root . implode('/', $res);
27:     }
28: 
29: }
30: 
API documentation generated by ApiGen 2.8.0