A small PHP library for accessing Windows directory paths.
Installation
Install the package with Composer:
composer require gibbs/php-windows-base-dirExample Usage
Using the Composer autoloader, print all available paths:
// Path to the Composer autoloader
require __DIR__ . '/vendor/autoload.php';
// Get all paths
$paths = (new WindowsBaseDir\Wbd)->getAllEnvironmentPaths();
// Print
print_r($paths);API
| Visibility | Function |
|---|---|
| public | getAllEnvironmentPaths() : array An array of all paths with the envvar as key |
| public | getAllPaths() : array An array of all paths with underscore delimited key names |
| public | getAllUsersProfilePath() : string/null |
| public | getAppDataPath() : string/null |
| public | getComSpecPath() : string/null |
| public | getCommonProgramFilesPath() : string/null |
| public | getCommonProgramFilesX86Path() : string/null |
| public | getDriverDataPath() : string/null |
| public | getEnvironment() : string/null |
| public | getHomeDrive() : string/null |
| public | getHomeDrivePath() : string/null |
| public | getHomePath() : string/null |
| public | getLocalAppDataPath() : string/null |
| public | getLogonServerPath() : string/null |
| public | getOneDrivePath() : string/null |
| public | getPath() : string/null |
| public | getPathExt() : string/null |
| public | getProgramDataPath() : string/null |
| public | getProgramFilesPath() : string/null |
| public | getProgramFilesX86Path() : string/null |
| public | getPublicPath() : string/null |
| public | getSystemDrivePath() : string/null |
| public | getSystemRootPath() : string/null |
| public | getTempPath() : string/null |
| public | getUserDomain() : string/null |
| public | getUserDomainRoaminProfile() : string/null |
| public | getUserProfilePath() : string/null |
| public | getUsername() : string/null |
| public | getWindirPath() : string/null |
| public | isWindowsEnvironment() : bool Determine if the current runtime environment is Windows |