示例#1
0
 function __construct($username = null, $password = null)
 {
     parent::__construct($username, $password);
     // Default persistance is using the PHP sessions
     if (!self::$persistance) {
         self::$persistance = new Session();
     }
     self::$persistance->init();
 }
 /**
  * In the class the constructor is a bit different: there is a 3rd param to
  * specify the Manialink from which the notifications are sent.
  *
  * IMPORTANT NOTE:
  *
  * If you are sending many notifications, please use the $group variable
  * See http://maniapla.net/maniahome-group
  *
  * The API username must be allowed to post notifications for the Manialink!
  * If you're the Manialink owner, go in ManiaHome's Manager to the "API user"
  * page to set it.
  *
  * @param string $username
  * @param string $password
  * @param string $manialink
  */
 function __construct($username = null, $password = null, $manialink = null)
 {
     parent::__construct($username, $password);
     // If you're using ManiaLib, credentials can be automatically loaded
     if (!$manialink && class_exists('\\ManiaLib\\Application\\Config')) {
         $config = \ManiaLib\Application\Config::getInstance();
         $manialink = $config->manialink;
     }
     $this->manialink = $manialink;
 }
 /**
  * In the class the constructor is a bit different: there is a 3rd param to
  * specify the server login from which the notifications are sent.
  *
  * IMPORTANT NOTE:
  *
  * The API username must be allowed to post notifications for the Server!
  * If you're the Server owner, go in ManiaHome's Manager to the "API user"
  * page to set it.
  *
  * @param string $username
  * @param string $password
  * @param string $serverLogin
  */
 public function __construct($username = null, $password = null, $serverLogin = null)
 {
     parent::__construct($username, $password);
     $this->serverLogin = $serverLogin;
 }