eden/file 问题修复 & 功能扩展

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

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

eden/file

最新稳定版本:4.0.1

Composer 安装命令:

composer require eden/file

包简介

File methods

README 文档

README

Build Status

====

Install

composer install eden/file

====

Introduction

Instantiate file in this manner.

$file = eden('file', '/some/path/to/file.txt');

====

API

====

isFile

Checks to see if this path is a real file

Usage

eden('file', '/some/path/to/file.txt')->isFile();

Parameters

Returns bool

====

getBase

Returns the base file name with out the extension

Usage

eden('file', '/some/path/to/file.txt')->getBase();

Parameters

Returns string

====

getContent

Returns the contents of a file given the path

Usage

eden('file', '/some/path/to/file.txt')->getContent();

Parameters

Returns string

====

getData

Returns the executes the specified file and returns the final value

Usage

eden('file', '/some/path/to/file.txt')->getData();

Parameters

Returns bool

====

getExtension

Returns the base file name extension

Usage

eden('file', '/some/path/to/file.txt')->getExtension();

Parameters

Returns string|null

====

getFolder

Returns the file path

Usage

eden('file', '/some/path/to/file.txt')->getFolder();

Parameters

Returns string

====

getMime

Returns the mime type of a file

Usage

eden('file', '/some/path/to/file.txt')->getMime();

Parameters

Returns string

====

getName

Returns the file name

Usage

eden('file', '/some/path/to/file.txt')->getName();

Parameters

Returns string

====

getSize

Returns the size of a file in bytes

Usage

eden('file', '/some/path/to/file.txt')->getSize();

Parameters

Returns string

====

getTime

Returns the last time file was modified in UNIX time

Usage

eden('file', '/some/path/to/file.txt')->getTime();

Parameters

Returns int

====

setContent

Creates a file and puts specified content into that file

Usage

eden('file', '/some/path/to/file.txt')->setContent(*string $content);

Parameters

  • *string $content - The raw content to save

Returns Eden\File\Index

Example

eden('file', '/some/path/to/file.txt')->setContent('foo');

====

setData

Creates a php file and puts specified variable into that file

Usage

eden('file', '/some/path/to/file.txt')->setData(*mixed $variable);

Parameters

  • *mixed $variable - Whatever data to save

Returns Eden\File\Index

Example

eden('file', '/some/path/to/file.txt')->setData($variable);

====

remove

Removes a file

Usage

eden('file', '/some/path/to/file.txt')->remove();

Parameters

Returns Eden\File\Index

====

touch

Touches a file (effectively creates the file if it doesn't exist and updates the date if it does)

Usage

eden('file', '/some/path/to/file.txt')->touch();

Parameters

Returns Eden\File\Index

====

#Contributing to Eden

Contributions to Eden are following the Github work flow. Please read up before contributing.

##Setting up your machine with the Eden repository and your fork

  1. Fork the repository
  2. Fire up your local terminal create a new branch from the v4 branch of your fork with a branch name describing what your changes are. Possible branch name types:
    • bugfix
    • feature
    • improvement
  3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

##Making pull requests

  1. Please ensure to run phpunit before making a pull request.
  2. Push your code to your remote forked version.
  3. Go back to your forked version on GitHub and submit a pull request.
  4. An Eden developer will review your code and merge it in when it has been classified as suitable.

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 3
  • Forks: 6
  • 开发语言: PHP

其他信息

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