FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Proxy Class Reference

Proxy for files that are outside of the public document root. More...

Inheritance diagram for Proxy:
Component Thing

Public Member Functions

 url ($alias)
 Create a URL for an alias. More...
 
 alias ($filename)
 Create a unique alias for a filename. More...
 
 add ($filename, $alias=null)
 Add a file to the list. More...
 
 serve ($alias)
 Serve a file. More...
 
- Public Member Functions inherited from Component
 __construct ($fred, $config=null)
 
 __destruct ()
 
 clientConfig ()
 Public configuration. More...
 
 config ($key, $default=null)
 Retrieve a config value. More...
 
 ping ()
 Ping function. More...
 
 filemtime ($filename)
 Filemtime with session cache. More...
 
 component ($name)
 Get a component (local or default). More...
 
 components (... $names)
 Get multiple components in an array. More...
 
- Public Member Functions inherited from Thing
 propertyExists ($property)
 Check if a property exists (public or published). More...
 
 constants ($prefix=null)
 Return all constants. More...
 
 get ($key)
 Get one or more properties. More...
 
 set ($key, $value=null)
 Set one or more properties. More...
 
 __get ($key)
 
 __set ($key, $value)
 

Data Fields

 $controllerName = 'Proxy'
 Controller for the proxy. Has param 'alias'. More...
 
- Data Fields inherited from Component
 $filemtimeTtl = 0
 
- Data Fields inherited from Thing
const HIDDEN = 0
 Property is hidden. More...
 
const READABLE = 1
 Property is readable. More...
 
const WRITEABLE = 2
 Property is writeable. More...
 
const READWRITE = 3
 Property is readable and writeable. More...
 

Protected Member Functions

 getFiles ()
 
- Protected Member Functions inherited from Component
 init ()
 
 done ()
 
 getSession ()
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). More...
 
 configure ($config)
 Configure the object. More...
 
 _get ($key)
 Default getter if no specific setter is defined, and the property is also not published (readable). More...
 
 _set ($key, $value)
 Default setter if no specific setter is defined, and the property is also not published (writeable). More...
 

Protected Attributes

 $_files = null
 
- Protected Attributes inherited from Component
 $_fred = null
 
 $_config = null
 
 $_name = null
 
 $_components = []
 Local components (key = component name, value = component). More...
 
 $_session = null
 
- Protected Attributes inherited from Thing
 $_published = []
 Published properties (key = name of property, value = visibility). More...
 

Detailed Description

Proxy for files that are outside of the public document root.

Definition at line 8 of file Proxy.php.

Member Function Documentation

◆ add()

add (   $filename,
  $alias = null 
)

Add a file to the list.

Parameters
string$filename
string$aliasAlias for the file (a unique alias will be created when empty).
Returns
string URL for the file.

Definition at line 40 of file Proxy.php.

◆ alias()

alias (   $filename)

Create a unique alias for a filename.

Parameters
string$filename
Returns
string The generated alias.

Definition at line 27 of file Proxy.php.

◆ getFiles()

getFiles ( )
protected

Definition at line 56 of file Proxy.php.

◆ serve()

serve (   $alias)

Serve a file.

Parameters
string$aliasAlias for the file.

Definition at line 49 of file Proxy.php.

◆ url()

url (   $alias)

Create a URL for an alias.

Parameters
string$aliasAlias for the file.
Returns
string URL for the proxy call.

Definition at line 19 of file Proxy.php.

Field Documentation

◆ $_files

$_files = null
protected

Definition at line 12 of file Proxy.php.

◆ $controllerName

$controllerName = 'Proxy'

Controller for the proxy. Has param 'alias'.

Definition at line 10 of file Proxy.php.


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