private static function splitFilename($name)
    {
        if (is_array($name)) {
            $name = array_pop($name);
        } else {
            $name = explode('/', $name);
            $name = array_pop($name);
        }
        if (strrpos($name, '.') !== false) {
            return explode('.', $name);
        } else {
            return array($name, null);
        }
    }