20 lines
466 B
PHP
20 lines
466 B
PHP
<?php
|
|
|
|
class Utils
|
|
{
|
|
public const WORKSPACE_DIR = "workspace";
|
|
|
|
public static function str2kv(string $str): array
|
|
{
|
|
preg_match_all("/([^,= ]+)=([^,= ]+)/", $str, $r);
|
|
return array_combine($r[1], $r[2]);
|
|
}
|
|
|
|
public static function str2a(string $str): array {
|
|
return explode(",", $str);
|
|
}
|
|
|
|
public static function getWorkspaceDir(): string {
|
|
return getcwd() . DIRECTORY_SEPARATOR . self::WORKSPACE_DIR;
|
|
}
|
|
} |