Example #1
0
 public static function setUpBeforeClass()
 {
     static::$host = getenv('MONGODB_STANDALONE_HOST') ?: static::DEFAULT_STANDALONE_HOST;
     static::$port = getenv('MONGODB_STANDALONE_PORT') ?: static::DEFAULT_STANDALONE_PORT;
     static::$server = static::$host . ':' . static::$port;
     static::$conn_str = 'mongodb://' . static::$server;
 }
Example #2
0
 public function simpleConfiguration()
 {
     $this->setDefine();
     static::changeAplicationName(self::APPLICATION_NAME);
     set_time_limit(0);
     if (DEBUG) {
         ini_set('display_errors', 'on');
     }
     global $argv;
     if (is_array($arguments = $this->getArguments($argv))) {
         extract($arguments);
     }
     $nameBotConfig = !empty($server) ? $server : DEFAULT_CONFIG;
     if (file_exists(ROOT_DIR . '/settings/config.' . $nameBotConfig . '.json')) {
         $config = file_get_contents(ROOT_DIR . '/settings/config.' . $nameBotConfig . '.json');
     } else {
         die('Not found config file');
     }
     $config = json_decode($config);
     static::$serverName = (string) strtolower($nameBotConfig);
     static::$server = (string) $config->server;
     static::$port = (int) $config->port;
     static::$personal = (object) $config->personal;
     static::$permit = (array) $config->permit;
     static::$channels = (array) $config->channels;
     static::$logFolder = (string) $config->logFolder;
     static::$modules = (array) $config->modules;
     static::setNick($config->personal->nick);
     static::changeAplicationName(static::$personal->nick . ' - ' . static::$server);
     date_default_timezone_set(self::DEFAULT_TIMEZONE);
 }
 public static function init($config)
 {
     static::$host = $config['host'];
     static::$port = $config['port'];
     static::$pid_file = $config['pid_file'];
     static::$root_dir = $config['root_dir'];
     static::$gzip = $config['gzip'];
     static::$gzip_min_length = $config['gzip_min_length'];
 }
Example #4
0
 protected function init($config)
 {
     static::$host = $config['host'];
     static::$port = $config['port'];
     static::$pid_file = $config['pid_file'];
     static::$root_dir = $config['root_dir'];
     static::$deal_with_public = $config['deal_with_public'];
     static::$gzip = $config['gzip'];
     static::$gzip_min_length = $config['gzip_min_length'];
 }
Example #5
0
 /**
  * @param int $port
  */
 public static function setPort($port)
 {
     static::$port = $port;
 }
Example #6
0
 /**
  * Set the port of the socket to send to
  * 
  * @param int $port port of the socket to send to
  */
 protected static function setPort($port)
 {
     static::$port = $port;
 }