Esempio n. 1
0
 public static function init($config)
 {
     if (!is_array($config) && !file_exists($config)) {
         throw new Exception("Config needed for SocialAuth", 1);
     }
     if (!is_array($config)) {
         $config = (include $config);
     }
     $config["base_path"] = dirname(__FILE__) . DIRECTORY_SEPARATOR;
     $config["sdk_path"] = $config["base_path"] . "Sdk" . DIRECTORY_SEPARATOR;
     $config["network_path"] = $config["base_path"] . "Network" . DIRECTORY_SEPARATOR;
     require_once $config["base_path"] . "Adapter.php";
     require_once $config["base_path"] . "Auth.php";
     require_once $config["base_path"] . "Client.php";
     require_once $config["base_path"] . "Exception.php";
     require_once $config["base_path"] . "Logger.php";
     require_once $config["base_path"] . "Session.php";
     require_once $config["base_path"] . "User.php";
     require_once $config["base_path"] . DIRECTORY_SEPARATOR . "Protocol" . DIRECTORY_SEPARATOR . "Model" . DIRECTORY_SEPARATOR . "Base.php";
     require_once $config["base_path"] . DIRECTORY_SEPARATOR . "Protocol" . DIRECTORY_SEPARATOR . "Model" . DIRECTORY_SEPARATOR . "OAuth.php";
     require_once $config["base_path"] . DIRECTORY_SEPARATOR . "Protocol" . DIRECTORY_SEPARATOR . "Model" . DIRECTORY_SEPARATOR . "OAuth2.php";
     require_once $config["base_path"] . DIRECTORY_SEPARATOR . "User" . DIRECTORY_SEPARATOR . "Activity.php";
     require_once $config["base_path"] . DIRECTORY_SEPARATOR . "User" . DIRECTORY_SEPARATOR . "Contact.php";
     require_once $config["base_path"] . DIRECTORY_SEPARATOR . "User" . DIRECTORY_SEPARATOR . "Profile.php";
     Social_Auth::$config = $config;
     Social_Auth::$logger = new Social_Logger();
     Social_Auth::$session = new Social_Session();
     Social_Auth::checkRequirements();
 }