protected static function loadYaml($file, $ext)
    {
        $filename = \basename($file);
        $dir = \runtime_path('yaml');

        $cache = $dir . DIRECTORY_SEPARATOR . substr($filename, 0, -\strlen($ext)) . '.php';

        if (@\filemtime($cache) < \filemtime($file)) {
            $content = Yaml::parseFile($file);

            if (!\is_dir($dir) && !@\mkdir($dir, 0755) && !\is_dir($dir)) {
                throw new \RuntimeException('Temp directory permission denied');
            }

            \file_put_contents($cache, '<?php return ' . static::parseArrayToCode($content) . ';');

            if (\function_exists('\opcache_invalidate')) {
                \opcache_invalidate($cache, true);
            }
        }

        return include $cache;
    }