定制 wikimedia/relpath 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wikimedia/relpath

最新稳定版本:4.1.0

Composer 安装命令:

composer require wikimedia/relpath

包简介

Work with file paths to join or find the relative path

README 文档

README

RelPath is a small PHP library for working with file paths, to join two paths, or find the relative path to a path from the current directory or from an optional start directory.

Here is how you use it:

$relPath = \Wikimedia\RelPath::getRelativePath( '/srv/mediawiki/resources/src/startup.js', '/srv/mediawiki' );
// Result: "resources/src/startup.js"

$fullPath = \Wikimedia\RelPath::joinPath( '/srv/mediawiki', 'resources/src/startup.js' );
// Result: "/srv/mediawiki/resources/src/startup.js"

$fullPath = \Wikimedia\RelPath::joinPath( '/srv/mediawiki', '/var/startup/startup.js' );
// Result: "/var/startup/startup.js"

The RelPath::joinPath() function provided here is analogous to os.path.join() in Python, and path.join() found in Node.js.

License

MIT

统计信息

  • 总下载量: 864.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 13
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 13
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-29