定制 vube/php-filesystem 二次开发

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

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

vube/php-filesystem

Composer 安装命令:

composer require vube/php-filesystem

包简介

PHP classes for working with files and the file system

README 文档

README

Build Status Coverage Status Latest Stable Version Dependency Status

PHP classes for working with files and the file system

Features

  • Safely install files on network mounted drives
  • Atomic file installs; 100% uptime on production systems
  • Atomic symlink modifications; 100% uptime on production systems

Installation

Load php-filesystem into your project by adding the following lines to your composer.json

{
    "require": {
        "vube/php-filesystem": ">=0.1"
    }
}

Example Usage

Install a directory

// Explicitly create a directory.
// ALL parent dirs we create will share mode 0775 as modified by your umask

$installer = new Vube\FileSystem\Installer();
$installer->installDir('/path/to/some/dir', 0775);

Install files safely and atomically

// Install files into /existing-dir
//
// When installing into subdirs, we create all dirs needed,
// the mode is set by your umask.
//
// File installs are network-safe, providing 100% uptime
// on production systems.

$installer = new Vube\FileSystem\Installer();

$installer->installFile('file1', '/existing-dir/file1');
$installer->installFile('file2', '/existing-dir/new-dirs-we-create/with/subdirs/file2');

Create/overwrite symlinks atomically

// Create or overwrite /path/to/symlink
//
// If it already exists, it is atomically updated.

$installer = new Vube\FileSystem\Installer();
$installer->symlink('/path/to/actual', '/path/to/symlink');

Easily diff files

// Compare file1 and file2; are they different?

$differ = new Vube\FileSystem\FileDiffer();

if($differ->isDiff('file1', 'file2'))
    echo "These files are different.\n";

Easily zip files

// Gzip source.txt and save the result in destination.gz

$zipper = new Vube\FileSystem\Gzip();
$zipper->zip('source.txt', 'destination.gz');

Dependencies

  • PHP 5.3.2+
  • Composer

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 7
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-07-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固