crell/path 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

crell/path

最新稳定版本:0.1.2

Composer 安装命令:

composer require crell/path

包简介

Data model value objects for handling paths.

README 文档

README

Latest Version on Packagist Software License Total Downloads

Crell/Path is a simple library that provides typed value objects for handling paths. Paths may be either a PathFragment (no leading /) or an AbsolutePath. An AbsolutePath always begins either with a / or a stream identifier.

The contents of an absolute path may also be retrieved, if there is an actual file that it points to.

A Path object's primary purpose is to centralize and abstract away the various and sundry complexities and edge cases of manipulating paths: Getting a parent path (have to handle the case where there isn't one, with or without a stream), Concatenating two paths (have to handle the leading/trailing slashes, accounting for when one path or the other is the root path), filtering out and rejecting suspicious paths that contain .., and so on.

use Crell\Path\Path;

// Creates a Path Fragment
$frag = Path::create('foo/bar');

// Creates an Absolute Path
$abs = Path::create('/baz/beep');

$new = $abs->concat($frag);

// Prints /baz/beep/foo/bar
print $new;

// Prints /baz/beep/foo
print $new->parent();

$file = '/narf.jpg';
$fileAbs = $abs->concat($file);

// Prints /baz/beep/narf.jpg
print $fileAbs;

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.

Credits

License

The Lesser GPL version 3 or later. Please see License File for more information.

统计信息

  • 总下载量: 23
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2025-05-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固