Yiinitializr\Helpers\Config::value PHP Method

value() public static method

Returns a value of the array
public static value ( $value ) : mixed | null
$value
return mixed | null | null if no key is found
    public static function value($value)
    {
        return ArrayX::get(self::settings(), $value);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @param string $name the name of the runtime folder,
  * @throws \Exception
  */
 public static function createRuntimeFolders($name = 'runtime')
 {
     self::output("\n%gBuilding runtime '{$name}' folders.%n");
     umask(0);
     $directories = Config::value('yiinitializr.app.directories.' . $name);
     if (null === $directories) {
         throw new \Exception("Unable to find 'yiinitializr.app.directories.{$name}' on the settings.");
     }
     if (!is_array($directories)) {
         $directories = array($directories);
     }
     foreach ($directories as $directory) {
         $runtime = $directory . '/' . $name;
         if (!file_exists($runtime)) {
             @mkdir($runtime, 02777);
             self::output("Your {$name} folder has been created on {$directory}.");
         } else {
             self::output("'{$name}' %pfolder already exists. No action has been executed.%n");
         }
     }
     self::output("%gRuntime '{$name}' folders creation process finished.%n");
 }
All Usage Examples Of Yiinitializr\Helpers\Config::value