/** * @ignore */ public function __construct() { parent::__construct(); // Set up shell colors $this->foregroundColors['black'] = '0;30'; $this->foregroundColors['dark_gray'] = '1;30'; $this->foregroundColors['blue'] = '0;34'; $this->foregroundColors['light_blue'] = '1;34'; $this->foregroundColors['green'] = '0;32'; $this->foregroundColors['light_green'] = '1;32'; $this->foregroundColors['cyan'] = '0;36'; $this->foregroundColors['light_cyan'] = '1;36'; $this->foregroundColors['red'] = '0;31'; $this->foregroundColors['light_red'] = '1;31'; $this->foregroundColors['purple'] = '0;35'; $this->foregroundColors['light_purple'] = '1;35'; $this->foregroundColors['brown'] = '0;33'; $this->foregroundColors['yellow'] = '1;33'; $this->foregroundColors['light_gray'] = '0;37'; $this->foregroundColors['white'] = '1;37'; $this->backgroundColors['black'] = '40'; $this->backgroundColors['red'] = '41'; $this->backgroundColors['green'] = '42'; $this->backgroundColors['yellow'] = '43'; $this->backgroundColors['blue'] = '44'; $this->backgroundColors['magenta'] = '45'; $this->backgroundColors['cyan'] = '46'; $this->backgroundColors['light_gray'] = '47'; $this->options = []; $this->command = 'info'; }
/** * Grab connection settings * @param string $host * @param string $user * @param string $password * @return void */ public function __construct($host, $user = null, $password = null) { parent::__construct(); $this->host = $host; $this->port = 21; $this->passive = true; $this->ssl = false; $this->binary = true; $this->timeout = 120; $this->user = $user; $this->password = $password; $this->connection = false; $this->status = false; }
/** * Memcache wrapper constructor, configured by global config * @param void * @return void */ public function __construct() { parent::__construct(); $this->server = $this->config('system/memcacheServer'); $this->port = $this->config('system/memcachePort'); $this->driver = $this->config('system/memcacheDriver'); $this->class = '\\' . $this->driver; $this->connection = false; $this->message = null; if (class_exists($this->class)) { $this->connection = new $this->class(); $a = $this->connection->addServer($this->server, $this->port); if ($this->connection === false || $a == false) { $this->message = $this->driver . ' connection failed'; } else { $this->message = $this->driver . ' connection ok'; } } else { $this->message = $this->driver . ' class is not installed'; } }