Stud.IP  jlu_3.3 Revision
DiskFileStorage Class Reference
Inheritance diagram for DiskFileStorage:
Inheritance graph
Collaboration diagram for DiskFileStorage:
Collaboration graph

Public Member Functions

 __construct ($storage_id=NULL, $user_id=null)
 
 delete ()
 
 getPath ()
 
 exists ()
 
 getCreationTime ()
 
 getId ()
 
 getMimeType ($filename=null)
 
 getModificationTime ()
 
 getSize ()
 
 isReadable ()
 
 isWritable ()
 
 open ($mode)
 
- Public Member Functions inherited from FileStorage
 delete ()
 
 exists ()
 
 getCreationTime ()
 
 getId ()
 
 getMimeType ()
 
 getModificationTime ()
 
 getSize ()
 
 isReadable ()
 
 isWritable ()
 
 open ($mode)
 

Static Public Member Functions

static getQuotaUsage ($user_id)
 

Protected Attributes

 $storage_id
 
 $file_path
 

Detailed Description

File.php

Copyright (c) 2013 Elmar Ludwig

Class to represent files on disk (the only supported backend for now).

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $storage_id = NULL,
  $user_id = null 
)

Initialize a new DiskFileStorage object for the given id. A new (empty) file is created of storage_id is NULL.

Parameters
string$storage_idfile id or NULL

Member Function Documentation

◆ delete()

delete ( )

Delete this file from disk.

Implements FileStorage.

Here is the call graph for this function:

◆ exists()

exists ( )

Check whether the file exists on disk.

Returns
boolean TRUE or FALSE

Implements FileStorage.

Here is the caller graph for this function:

◆ getCreationTime()

getCreationTime ( )

Return the file creation time.

Returns
int timestamp

Implements FileStorage.

◆ getId()

getId ( )

Return the backend id of this file.

Returns
string backend id

Implements FileStorage.

◆ getMimeType()

getMimeType (   $filename = null)

Return the file's mime type, if known.

Parameters
string$filenameOptional filename if storage_id's do not provide enough information (like file extension)
Returns
string mime type (NULL if unknown)
Here is the call graph for this function:

◆ getModificationTime()

getModificationTime ( )

Return the file modification time.

Returns
int timestamp

Implements FileStorage.

◆ getPath()

getPath ( )

◆ getQuotaUsage()

static getQuotaUsage (   $user_id)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSize()

getSize ( )

Return the file's size in bytes.

Returns
int file size

Implements FileStorage.

◆ isReadable()

isReadable ( )

Check if this backend allows reading of files.

Returns
boolean TRUE

Implements FileStorage.

◆ isWritable()

isWritable ( )

Check if this backend allows writing of files.

Returns
boolean TRUE

Implements FileStorage.

◆ open()

open (   $mode)

Open a PHP stream resource for this file. Access mode parameter works just like fopen.

Parameters
string$modeaccess mode (see fopen)
Returns
resource file handle

Implements FileStorage.

Field Documentation

◆ $file_path

$file_path
protected

◆ $storage_id

$storage_id
protected

The documentation for this class was generated from the following file: