System_Folders
[ class tree: System_Folders ] [ index: System_Folders ] [ all elements ]

Class: System_Folders_Cached

Source Location: /System_Folders-1.0.0/Folders/Cached.php

Class Overview

System_Folders
   |
   --System_Folders_Cached

Provides a cached version of System_Folders.


Author(s):

Version:

  • CVS: $Id: Cached.php,v 1.1 2006/03/10 13:04:26 cweiske Exp $

Variables

Methods


Inherited Variables

Inherited Methods

Class: System_Folders

System_Folders::System_Folders()
Constructor; initializes the system variable.
System_Folders::addTrailingSlash()
Adds a trailing slash to the given path if there is none.
System_Folders::fixWindowsPath()
Directories in windows environment variables sometimes have a double backslash, and this needs to be fixed.
System_Folders::getAllUsers()
Returns the All Users directory.
System_Folders::getAppData()
Returns the path to the application data directory.
System_Folders::getCOMPath()
Loads a windows path via COM using $objCom.
System_Folders::getDesktop()
Returns the path to the user's desktop.
System_Folders::getDocuments()
Returns the path to the user's documents directory.
System_Folders::getHome()
Returns the path to the user's home directory.
System_Folders::getPrograms()
Returns the path to the programs directory.
System_Folders::getSharedDocuments()
Returns the path to the shared documents directory.
System_Folders::getSys()
Returns the name of the guesses system.
System_Folders::getTemp()
Returns the path to the directory for temporary files.
System_Folders::getUserName()
Returns the name for the user under which name the program runs.
System_Folders::getWindows()
Returns the windows directory (if any).
System_Folders::loadCOM()
Loads the COM object into the $objCom variable.
System_Folders::tryPaths()
Loops through a list of given paths and checks which of them are correct.

Class Details

[line 47]
Provides a cached version of System_Folders.

It also has methods to read folder settings from an ini file.

Be very careful when overriding the AppData setting with setAppData()! When loading a config file without specifying the file name, the default app data directory will be used. After loading, the file will be saved to the new app data directory, thus it won't be available the next time, as the app data folder is the old one again.

  • Author: Christian Weiske <cweiske@php.net>
  • Version: CVS: $Id: Cached.php,v 1.1 2006/03/10 13:04:26 cweiske Exp $
  • License: LGPL


[ Top ]


Class Variables

$arCache = array()

[line 55]

The cached paths will be hold here.
  • Access: protected

Type:   array


[ Top ]

$arSettings = array(
        'AllUsers', 'AppData', 'Desktop', 'Documents', 'Home',
        'Programs', 'Temp', 'SharedDocuments', 'Windows'
    )

[line 63]

The settings that are available.
  • Access: protected

Type:   array


[ Top ]



Method Detail

System_Folders_Cached (Constructor)   [line 70]

System_Folders_Cached System_Folders_Cached( )


[ Top ]

getAllUsers   [line 221]

string getAllUsers( )

Cached version of getAllUsers().

Overrides System_Folders::getAllUsers() (Returns the All Users directory.)
[ Top ]

getAppData   [line 235]

string getAppData( )

Cached version of getAppData().

Overrides System_Folders::getAppData() (Returns the path to the application data directory.)
[ Top ]

getCachedValue   [line 176]

string getCachedValue( string $strKey)

Returns a cached value.

If the cache doesn't exist, the cached value is empty or null, the System_Folders method for the key is called to get the value.

  • Return: The directory
  • Access: protected

Parameters:

string   $strKey   —  The id of the value to get

[ Top ]

getDefaultConfigFile   [line 160]

string getDefaultConfigFile( )

Returns the path to the default config file.

It the one that's used if no filename is passed to the saveToFile/loadFromFile methods.

  • Return: The filename
  • Access: public

[ Top ]

getDesktop   [line 249]

string getDesktop( )

Cached version of getDesktop().

Overrides System_Folders::getDesktop() (Returns the path to the user's desktop.)
[ Top ]

getDocuments   [line 263]

string getDocuments( )

Cached version of getDocuments().

Overrides System_Folders::getDocuments() (Returns the path to the user's documents directory.)
[ Top ]

getHome   [line 277]

string getHome( )

Cached version of getHome().

Overrides System_Folders::getHome() (Returns the path to the user's home directory.)
[ Top ]

getPrograms   [line 291]

string getPrograms( )

Cached version of getPrograms().

Overrides System_Folders::getPrograms() (Returns the path to the programs directory.)
[ Top ]

getSharedDocuments   [line 319]

string getSharedDocuments( )

Cached version of getSharedDocuments().

Overrides System_Folders::getSharedDocuments() (Returns the path to the shared documents directory.)
[ Top ]

getTemp   [line 305]

string getTemp( )

Cached version of getTemp().

Overrides System_Folders::getTemp() (Returns the path to the directory for temporary files.)
[ Top ]

getWindows   [line 333]

string getWindows( )

Cached version of getWindows().

Overrides System_Folders::getWindows() (Returns the windows directory (if any).)
[ Top ]

loadFromFile   [line 86]

mixed loadFromFile( [string $strFile = null])

Loads the directories from an ini file.

If you don't specify the config file, it will be determined automatically.

  • Return: True on success, PEAR_Error on failure
  • Access: public

Parameters:

string   $strFile   —  The file to load the data from (ini file)

[ Top ]

saveToFile   [line 129]

mixed saveToFile( [string $strFile = null], [boolean $bSaveAllSettings = true])

Saves the folders into a config file that can be edited by hand.

If you don't specify the config file, it will be determined automatically. Values that are NULL won't be saved.

  • Return: True on success, PEAR_Error on failure
  • Access: public

Parameters:

string   $strFile   —  The file to save the data into (ini file)
boolean   $bSaveAllSettings   —  If all settings shall be saved that can be loaded, or only that settings, that have been retrieved by the user

[ Top ]

setAllUsers   [line 355]

void setAllUsers( string $value)

Sets an own all users directory.

Set it to NULL to deactivate saving and remove the value from the cache.


Parameters:

string   $value   —  The new all users directory

[ Top ]

setAppData   [line 371]

void setAppData( string $value)

Sets an own application data directory.

Set it to NULL to deactivate saving and remove the value from the cache.


Parameters:

string   $value   —  The new app data directory

[ Top ]

setCachedValue   [line 197]

void setCachedValue( string $strKey, string $strValue)

Sets the cache of the given key to the given value.

Passing NULL removes the cache entry.

  • Access: protected

Parameters:

string   $strKey   —  Id of the value to get
string   $strValue   —  Value to set.

[ Top ]

setDesktop   [line 387]

void setDesktop( string $value)

Sets an own desktop directory.

Set it to NULL to deactivate saving and remove the value from the cache.


Parameters:

string   $value   —  The new desktop directory

[ Top ]

setDocuments   [line 403]

void setDocuments( string $value)

Sets an own documents directory.

Set it to NULL to deactivate saving and remove the value from the cache.


Parameters:

string   $value   —  The new documents directory

[ Top ]

setHome   [line 419]

void setHome( string $value)

Sets an own home directory.

Set it to NULL to deactivate saving and remove the value from the cache.


Parameters:

string   $value   —  The new home directory

[ Top ]

setPrograms   [line 435]

void setPrograms( string $value)

Sets an own programs directory.

Set it to NULL to deactivate saving and remove the value from the cache.


Parameters:

string   $value   —  The new programs directory

[ Top ]

setSharedDocuments   [line 467]

void setSharedDocuments( string $value)

Sets an own shared documents directory.

Set it to NULL to deactivate saving and remove the value from the cache.


Parameters:

string   $value   —  The new shared documents directory

[ Top ]

setTemp   [line 451]

void setTemp( string $value)

Sets an own temp directory.

Set it to NULL to deactivate saving and remove the value from the cache.


Parameters:

string   $value   —  The new temp directory

[ Top ]

setWindows   [line 483]

void setWindows( string $value)

Sets an own windows directory.

Set it to NULL to deactivate saving and remove the value from the cache.


Parameters:

string   $value   —  The new windows directory

[ Top ]


Documentation generated on Thu, 10 Dec 2015 05:42:41 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.