Gdn::config PHP Method

config() public static method

Get a configuration setting for the application.
public static config ( string $Name = false, mixed $Default = false ) : Gdn_Configuration | mixed
$Name string The name of the configuration setting. Settings in different sections are seperated by a dot ('.')
$Default mixed The result to return if the configuration setting is not found.
return Gdn_Configuration | mixed The configuration setting.
    public static function config($Name = false, $Default = false)
    {
        $Config = self::$_Config;
        if ($Name === false) {
            $Result = $Config;
        } else {
            $Result = $Config->get($Name, $Default);
        }
        return $Result;
    }

Usage Example

示例#1
0
 /**
  * Returns an array of all folder names within the source folder or FALSE
  * if SourceFolder does not exist.
  *
  * @param string $SourceFolder
  */
 public static function folders($SourceFolders)
 {
     if (!is_array($SourceFolders)) {
         $SourceFolders = array($SourceFolders);
     }
     $BlackList = Gdn::config('Garden.FolderBlacklist');
     if (!is_array($BlackList)) {
         $BlackList = array('.', '..');
     }
     $Result = array();
     foreach ($SourceFolders as $SourceFolder) {
         if ($DirectoryHandle = opendir($SourceFolder)) {
             while (($Item = readdir($DirectoryHandle)) !== false) {
                 $SubFolder = combinePaths(array($SourceFolder, $Item));
                 if (!in_array($Item, $BlackList) && is_dir($SubFolder)) {
                     $Result[] = $Item;
                 }
             }
             closedir($DirectoryHandle);
         }
     }
     if (count($Result) == 0) {
         return false;
     }
     return $Result;
 }
All Usage Examples Of Gdn::config