Пример #1
0
 /**
  * @param \Magento\Framework\Stdlib\String $string
  * @param \Magento\Framework\Stdlib\DateTime $dateTime
  * @param array $config
  */
 public function __construct(\Magento\Framework\Stdlib\String $string, \Magento\Framework\Stdlib\DateTime $dateTime, array $config)
 {
     $this->string = $string;
     $this->dateTime = $dateTime;
     $this->_connectionConfig = $this->getValidConfig($config);
     parent::__construct();
 }
Пример #2
0
 /**
  * @param \Magento\Framework\App\Filesystem $filesystem
  * @param \Magento\Framework\Stdlib\String $string
  * @param \Magento\Framework\Stdlib\DateTime $dateTime
  * @param string $host
  * @param string $username
  * @param string $password
  * @param string $dbName
  * @param array $profiler
  * @param string $initStatements
  * @param string $type
  * @param bool $active
  */
 public function __construct(\Magento\Framework\App\Filesystem $filesystem, \Magento\Framework\Stdlib\String $string, \Magento\Framework\Stdlib\DateTime $dateTime, $host, $username, $password, $dbName, array $profiler = array(), $initStatements = 'SET NAMES utf8', $type = 'pdo_mysql', $active = false)
 {
     $this->_filesystem = $filesystem;
     $this->string = $string;
     $this->dateTime = $dateTime;
     $this->_connectionConfig = array('host' => $host, 'username' => $username, 'password' => $password, 'dbname' => $dbName, 'type' => $type, 'profiler' => !empty($profiler) && $profiler !== 'false');
     $this->_host = $host;
     $this->_type = $type;
     $this->_initStatements = $initStatements;
     $this->_isActive = !($active === 'false' || $active === '0');
     parent::__construct();
 }