plasmaconduit / path
此包已被废弃,不再维护。未建议替代包。
此包的最新版本(0.1.1)没有提供许可证信息。
0.1.1
2013-01-23 06:47 UTC
Requires (Dev)
This package is not auto-updated.
Last update: 2016-11-19 07:19:46 UTC
README
简单且无忧的文件路径连接和简化。
<?php use PlasmaConduit\Path; Path::join("wat", "lol"); // -> wat/lol Path::join("/a", "///b"); // -> /a/b Path::join("/a", "b", "c", "..", "d"); // -> /a/b/d Path::normalize("/a/b/c/../d"); // -> /a/b/d Path::normalize("/a/b/c/../../d"); // -> /a/d Path::normalize("/b/wat//"); // -> /b/wat/ Path::normalize("/b///wat/"); // -> /b/wat/ Path::normalize(""); // -> . Path::normalize("/"); // -> /
公共接口
namespace PlasmaConduit; class Path { /** * This function takes a variable amount of strings and joins * them together so that they form a valid file path. * * @param {String ...} $peice - The peices of the file path * @returns {String} - The final file path */ static public function join(); /** * This function takes a valid file path and nomalizes it into * the simplest form possible. * * @param {String} $path - The path to normalize * @returns {String} - The normailized path */ static public function normalize($path); }