定制 dgifford/path 二次开发

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

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

dgifford/path

Composer 安装命令:

composer require dgifford/path

包简介

README 文档

README

A class for manipulating paths.

Usage

The class can be used non-statically:

$path = new Path( '/path/to/a/file.ext' );

// Boolean check if the path exists
$path->exists();

// Boolean check if the path is writeable
$path->writeable();

// Get components of the path
$path->extension(); // returns 'ext'

// Get the path
$path->get(); // Returns '/path/to/a/file.ext'

// Change the path
$path->set('path/to/a/foo/../file.ext' );

// Resolve the path to a real path
$path->real()->get(); // Returns '/path/to/a/file.ext' or false if it doesn't exist

And statically:

// Boolean check if a path exists
Path::exists( '/path/to/a/file.ext' );

// Boolean check if a path is writeable
Path::writeable( '/path/to/a/file.ext' );

// Get components of the path
Path::extension( '/path/to/a/file.ext' ); // returns 'ext'

// Resolve a path to a real path
Path::real('path/to/a/foo/../file.ext' ); // Returns '/path/to/a/file.ext' or false if it doesn't exist

The class can also accept multiple arguments:

// Join strings to make a path
$path = new Path( '/path/', '/to/', '\a\', 'file.ext' );

$path->join()->get(); // Returns '/path/to/a/file.ext'

// Boolean check if any of the paths don't exist
$path->set( '/path/to/a/file.ext', 'foo bar', '/var/etc/' );

$path->exists(); // Returns false

// Boolean check if each of the paths exists
$path->exists( true ); // Returns [ true, false, true ]

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2017-02-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固