2017 © Pedro Peláez
 

library file

File methods

image

eden/file

File methods

  • Friday, November 13, 2015
  • by cblanquera
  • Repository
  • 4 Watchers
  • 2 Stars
  • 39,115 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 4 Versions
  • 14 % Grown

The README.md

logo Eden File

Build Status

====, (*1)

, (*2)

Install

composer install eden/file, (*3)

====, (*4)

, (*5)

Introduction

Instantiate file in this manner., (*6)

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

====, (*7)

, (*8)

API

====, (*9)

, (*10)

isFile

Checks to see if this path is a real file, (*11)

Usage

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

Parameters

Returns bool, (*12)

====, (*13)

, (*14)

getBase

Returns the base file name with out the extension, (*15)

Usage

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

Parameters

Returns string, (*16)

====, (*17)

, (*18)

getContent

Returns the contents of a file given the path, (*19)

Usage

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

Parameters

Returns string, (*20)

====, (*21)

, (*22)

getData

Returns the executes the specified file and returns the final value, (*23)

Usage

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

Parameters

Returns bool, (*24)

====, (*25)

, (*26)

getExtension

Returns the base file name extension, (*27)

Usage

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

Parameters

Returns string|null, (*28)

====, (*29)

, (*30)

getFolder

Returns the file path, (*31)

Usage

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

Parameters

Returns string, (*32)

====, (*33)

, (*34)

getMime

Returns the mime type of a file, (*35)

Usage

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

Parameters

Returns string, (*36)

====, (*37)

, (*38)

getName

Returns the file name, (*39)

Usage

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

Parameters

Returns string, (*40)

====, (*41)

, (*42)

getSize

Returns the size of a file in bytes, (*43)

Usage

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

Parameters

Returns string, (*44)

====, (*45)

, (*46)

getTime

Returns the last time file was modified in UNIX time, (*47)

Usage

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

Parameters

Returns int, (*48)

====, (*49)

, (*50)

setContent

Creates a file and puts specified content into that file, (*51)

Usage

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

Parameters

  • *string $content - The raw content to save

Returns Eden\File\Index, (*52)

Example

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

====, (*53)

, (*54)

setData

Creates a php file and puts specified variable into that file, (*55)

Usage

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

Parameters

  • *mixed $variable - Whatever data to save

Returns Eden\File\Index, (*56)

Example

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

====, (*57)

, (*58)

remove

Removes a file, (*59)

Usage

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

Parameters

Returns Eden\File\Index, (*60)

====, (*61)

, (*62)

touch

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

Usage

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

Parameters

Returns Eden\File\Index, (*64)

====, (*65)

, (*66)

Contributing to Eden

Contributions to Eden are following the Github work flow. Please read up before contributing., (*67)

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.

The Versions

13/11 2015

dev-master

9999999-dev http://eden-php.com

File methods

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

13/11 2015

4.x-dev

4.9999999.9999999.9999999-dev http://eden-php.com

File methods

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

13/10 2015

4.0.1

4.0.1.0 http://eden-php.com

File methods

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

07/10 2015

v4

4.0.0.0 http://eden-php.com

File methods

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden