定制 maximgrynykha/path2 二次开发

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

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

maximgrynykha/path2

Composer 安装命令:

composer require maximgrynykha/path2

包简介

Normalize paths to files & directories in PHP

README 文档

README

Build Status

Path2

If you are not confident that your program will properly lead the way to the required file or directory - use Path2, it automatically converts all slashes to those which are used in the current operating system, yet so over also will trim excess slashes if there are in the path.

⚙️ Installation

To install this library - run the command below in your terminal:

composer require maximgrynykha/path2

Usage

<?php

use Path2\Path;

require_once 'vendor/autoload.php';

$path = new Path();

// For example, normalize some kinky path
$normalized = $path->to('/\/src/\\\Path2/\/\/\Path.php');

dd($normalized); // "{CWD}/src/Path2/Path.php" (on an UNIX) || "{CWD}\src\Path2\Path.php" (on a Windows)
                 
                 // Note, by default if any preceding to the main path (first argument),
                 // from-path (second argument) isn't passed then Path::to()
                 // uses CWD (current working directory) as a preceding, from-path.

API

Param Argument Example
path [string]: any path to the file or dir
from [string]: any path preceding before the main path CWD (current working directory)
__DIR__, __NAMESPACE__, etc.

🤝 Contributing

If you have a problem that cannot be solved using this library, please write your solution, and if you want to help other developers who also use this library (or if you want to keep your solution working after a new version is released, which will be in the package manager dependencies) — create a pull-request. I will be happy to add your excellent code to the library!

🐞 Report any bugs or issues you find on the GitHub issues.

📃 License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固