public static function create($path, $cb = null) { $dirs = explode("/", $path); if (!CDirectory::exists($path)) { mkdir($path, 0777, true); $created = true; } $res = CDirectory::open($path); if ($created && isset($cb)) { $cb($res); } return $res; }