MvcLite\File

Class to contain logic for accessing files

Synopsis

class File extends ObjectAbstract {
  • // members
  • protected string $contents = '';
  • // Inherited methods from ObjectAbstract
  • public final void __get()
  • public final void __set()
  • public final void __call()
  • public void __toString()
  • public string identify()
  • // Inherited methods from Filepath
  • public Request filepath()
}

Hierarchy

Coverage

Methods 100% 7 / 7
Lines 100% 21 / 21

Constants

Name Value
MSG_ERR_IDENTIFY 'Descendents must implement the identify method'

Members

protected

  • $contents — string
    The contents of the instance's file.

Methods

protected

  • checkFileExists() — method to throw an exception if a given filename doesn't exist

public

  • delete() — Deletes a file by filename.
  • getContents() — Getter for the _contents property
  • load() — loads file information to the file instance
  • save() — Saves the content of the file to a provided filename.
  • setContents() — Setter for the contents property.
  • test() — tests the existance of a given filename

Inherited from MvcLite\ObjectAbstract

public

  • __call() — Overriding the __call magic method
  • __get() — Overriding the __get magic method
  • __set() — Overriding the __set magic method
  • __toString() — returns a string representation of the object
  • identify() — method used to identify the object instance

Inherited from MvcLite\Traits\Filepath

public

History