Class: System_Folders
Source Location: /System_Folders-1.0.5/System/Folders.php
Provides the locations of several system and user directories independent of the operating system used.
Author(s):
|
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
System_Folders (Constructor) [line 225]
System_Folders System_Folders(
)
|
|
Constructor; initializes the system variable.
addTrailingSlash [line 243]
string addTrailingSlash(
string
$strPath)
|
|
Adds a trailing slash to the given path if there is none. Uses DIRECTORY_SEPARATOR, so it works with windows and *nix.
Parameters:
fixWindowsPath [line 266]
string fixWindowsPath(
string
$strPath)
|
|
Directories in windows environment variables sometimes have a double backslash, and this needs to be fixed.
Parameters:
getAllUsers [line 363]
Returns the All Users directory. Works on windows only, returns NULL if not found.
Overridden in child classes as:
- System_Folders_Cached::getAllUsers()
- Cached version of getAllUsers().
getAppData [line 407]
Returns the path to the application data directory. This is the directory in which applications save their settings. On Windows, this is an own directory called "Application data", on *nix, the home directory is used. MacOS X has two application settings directories: - $HOME/Library/Preferences/<pref_file> for normal settings
- $HOME/Library/Application Support/<app_name>/ for data files that
that the application needs to store
This method returns the latter, as it works for both storing just prefs and files in an application specific subdir. That's not 100% correct for apple, but it will work.
Overridden in child classes as:
- System_Folders_Cached::getAppData()
- Cached version of getAppData().
getCOMPath [line 340]
mixed getCOMPath(
string
$strType)
|
|
Loads a windows path via COM using $objCom.
Parameters:
getDesktop [line 444]
getDocuments [line 475]
Returns the path to the user's documents directory. (normally below the home folder)
Overridden in child classes as:
- System_Folders_Cached::getDocuments()
- Cached version of getDocuments().
getHome [line 507]
getPrograms [line 572]
Returns the path to the programs directory. This is the dir where all programs are installed normally. On windows, it's mostly "C:\Programs\", on linux, the /opt/ directory is returned.
Overridden in child classes as:
- System_Folders_Cached::getPrograms()
- Cached version of getPrograms().
getSharedDocuments [line 649]
string getSharedDocuments(
)
|
|
Returns the path to the shared documents directory. Supports windows only (at least for now) as no other operating system seems to have such a folder. Returns NULL on failure (not windows or not found).
Overridden in child classes as:
- System_Folders_Cached::getSharedDocuments()
- Cached version of getSharedDocuments().
getSys [line 674]
Returns the name of the guesses system. Can be compared with SYS_* constants.
getTemp [line 610]
getUserName [line 698]
Returns the name for the user under which name the program runs. This function returns the *system user name*, not the name with forename and surname On unix, this would be e.g. 'fbar' or so for the user 'Foo Bar' This method is used my most other methods, so recognizing the user name is really important. Be sure to check this method if the others fail.
getWindows [line 728]
Returns the windows directory (if any). NULL is returned if the system is not Windows.
Overridden in child classes as:
- System_Folders_Cached::getWindows()
- Cached version of getWindows().
loadCOM [line 310]
Loads the COM object into the $objCom variable.
tryPaths [line 289]
string tryPaths(
array
$arPaths, [string
$strBase = ''], [string
$strSuffix = ''])
|
|
Loops through a list of given paths and checks which of them are correct.
Parameters:
Documentation generated on Mon, 11 Mar 2019 15:52:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|