Exemplo n.º 1
0
        //!< throw the first element out, it's already in class name
        if (!self::IncludeClassFile($file_name)) {
            return null;
        }
        $name_parts = explode('.', $file_name);
        $class_name = $name_parts[0];
        if (count($name_parts) > 1 && strtolower($name_parts[1]) == "ext") {
            $class_name .= "ExtAuth";
        }
        return new $class_name($options);
    }
    /**
     * Include a contacts class file so that the class definition is available
     * @param $class_name
     * @return bool true if class name exists and file has been included
     */
    public static function IncludeClassFile($file_name)
    {
        if (!self::IsContactsFile($file_name)) {
            return false;
        }
        require_once SVETLOZARNET_CONTACTS . "{$file_name}.php";
        return true;
    }
    public static function IsContactsFile($file_name)
    {
        return isset(self::$ContactsClasses[$file_name]);
    }
}
ContactsHelper::init();