Start Database

@return bool
170614
public static function start() : bool
  {
    $capsule = new Capsule();

    $capsule->addConnection(Config::$database);
    $capsule->setAsGlobal();
    $capsule->bootEloquent();

    if ($capsule->connection()->getDatabaseName()) {
      return true;
    }

    return false;
  }
98540
public function start()
    {
		$this->_starttime = microtime(true);
        if (extension_loaded('xdebug') === false) {
            return false;
        }

        if (is_null($this->_traceFile) === true) {
            $this->_traceFile = tempnam(sys_get_temp_dir(), 'PHPConsistent_');
        }

        ini_set('xdebug.auto_trace', 1);
        ini_set('xdebug.trace_format', 1);
        ini_set('xdebug.collect_return', 1);
        ini_set('xdebug.collect_params', 1);
        ini_set('xdebug.trace_options', 0);
        xdebug_start_trace($this->_traceFile);

        if ($this->_log === self::LOG_TO_FIREPHP) {
            ob_start();
            break;
        }

        if ($this->_log !== self::LOG_TO_PHPUNIT) {
            register_shutdown_function(array($this, 'stop'));
            register_shutdown_function(array($this, 'analyze'));
        }

        return true;
    }
596611
public function startTransaction()
    {
        # Ensure we have a connection to start the transaction on
        $this->connect();

        switch ($this->mode) {

            case "mysql":
                $result = $this->server->autocommit(false);
                break;

            case "postgres":
                $result = $this->query("SET AUTOCOMMIT = OFF");
                break;

            case "redshift":
                $result = $this->query("START TRANSACTION");
                break;

            case "odbc":
                $result = odbc_autocommit($this->server, false);
                break;

            default:
                throw new \Exception("startTransaction() not supported in this mode (" . $this->mode . ")");
        }

        if (!$result) {
            $this->error();
        }

        $this->transaction = true;

        return true;
    }
716599
public function start(): bool
    {
        if (!is_null($this->expiration)) {
            $this->expiration->start();
        }
        if (!is_null($this->fingerprint)) {
            $this->fingerprint->start();
        }
        if (!isset($_SESSION['__HANDLER_INITIATED'])) {
            return $this->initialSessionStart();
        } else {
            return $this->laterSessionStart();
        }
    }
1243947
public function run()
    {
        $vendorDir = dirname(dirname(__FILE__));
        $baseDir = dirname($vendorDir);
        spl_autoload_register(function ($className) use($baseDir) {
            if (file_exists($file = $baseDir . '/database/seeds/' . $className . '.php')) {
                include($file);
                return true;
            }
        });

        $this->call([
            ModulesTableSeeder::class,
            PrivilegesTableSeeder::class,
            SettingsTableSeeder::class,
        ]);
    }
759558
private function databases()
    {
        if (Configuration::read('database.config.enable') === true) {
            $databaseConfigPath = $this->configDir . DS . Configuration::read('database.config.file');
            if (file_exists($databaseConfigPath)) {
                require $databaseConfigPath;
                return true;
            }
        }
        return false;
    }
127501
protected function init() {
		
		if (!($this->options['host'] || $this->options['socket'])
		||  !$this->options['user'] 
		||  !$this->options['pass'] 
		||  !$this->options['db']
		||  !$this->options['path']
		||  !$this->options['files_table']) {
			return false;
		}
		
		
		$this->db = new mysqli($this->options['host'], $this->options['user'], $this->options['pass'], $this->options['db'], $this->options['port'], $this->options['socket']);
		if ($this->db->connect_error || @mysqli_connect_error()) {
			return false;
		}
		
		$this->db->set_charset('utf8');

		if ($res = $this->db->query('SHOW TABLES')) {
			while ($row = $res->fetch_array()) {
				if ($row[0] == $this->options['files_table']) {
					$this->tbf = $this->options['files_table'];
					break;
				}
			}
		}

		if (!$this->tbf) {
			return false;
		}

		$this->updateCache($this->options['path'], $this->_stat($this->options['path']));

		return true;
	}
350855
public function start()
    {
        if ($this->isStarted()) {
            return true;
        }

        /*
         * Write and Close handlers are called after destructing objects since PHP 5.0.5.
         * Thus destructors can use sessions but session handler can't use objects.
         * So we are moving session closure before destructing objects.
         */
        session_register_shutdown();

        session_cache_limiter('none');

        if (!session_start()) {
            throw new \RuntimeException('Failed to start the session');
        }

        static::$started = true;

        return true;
    }
961707
public function startDatabase($database)
    {
        assert($this->_platform instanceof SQLAnywherePlatform);
        $this->_execSql($this->_platform->getStartDatabaseSQL($database));
    }
1301509
protected function opendb() {
    // Only do one open
    
    if($this->db) {
      return $this->db;
    }
    //echo "$this->host, $this->user, $this->password";
    try {
      $db = @new PDO($this->host, $this->user, $this->password);
    } catch(PDOException $e) {
      $this->errno = $e->getCode();
      $this->error = $e->getMessage();
      throw new SqlException(__METHOD__.  " Connection failed: $this->host", $this);
    }

    $this->db = $db; // set this right away so if we get an error below $this->db is valid

    return $db;
  }
487381
public function startTransaction(): bool {
        if ($this->transactionExists) {
            return false;
        }
        $started = $this->pdo->beginTransaction();
        $this->transactionExists = $started;
        return $started;
    }
809670
public function start()
  {
    $rememberMe = Remember::$rememberMe;
    $loginResult = $rememberMe->login();

    if ($loginResult->isSuccess()) {
      $_SESSION['_uas'] = $loginResult->getCredential();
      $_SESSION['remembered_by_cookie'] = true;
      return;
    }

    if ($loginResult->hasPossibleManipulation()) {
      exit();
    }

    if ($loginResult->isExpired() && !empty($_SESSION['_uas']) && !empty($_SESSION['remembered_by_cookie'])) {
      $rememberMe->clearCookie();
      unset($_SESSION['_uas']);
      unset($_SESSION['remembered_by_cookie']);
      exit();
    }
    if ($loginResult->isExpired() && !empty($_SESSION['_uas'])) {
      sleep(5);
    }
  }
972031
public synchronized void start() throws ManagedProcessException {
        logger.info("Starting up the database...");
        boolean ready = false;
        try {
            mysqldProcess = startPreparation();
            ready = mysqldProcess.startAndWaitForConsoleMessageMaxMs(getReadyForConnectionsTag(), dbStartMaxWaitInMS);
        } catch (Exception e) {
            logger.error("failed to start mysqld", e);
            throw new ManagedProcessException("An error occurred while starting the database", e);
        }
        if (!ready) {
            if (mysqldProcess.isAlive())
                mysqldProcess.destroy();
            throw new ManagedProcessException("Database does not seem to have started up correctly? Magic string not seen in "
                    + dbStartMaxWaitInMS + "ms: " + getReadyForConnectionsTag() + mysqldProcess.getLastConsoleLines());
        }
        logger.info("Database startup complete.");
    }
1112751
public function start()
    {
        $routeType = $this->getType();
        if ($routeType == RouteType::NORMAL) {
            $this->typeNormal();
        }
        if ($routeType == RouteType::PATHINFO) {
            $this->typePathInfo();
        }
        if ($routeType == RouteType::MAP) {
            $this->typeMap();
        }
        if ($routeType == RouteType::SYMFONY) {
            $this->typeSymfony();
        }
        return true;
    }
1205447
public static function start()
    {
        Base::checkOpen();
        if (Base::driver() == 'file') {
            if (session_status() != PHP_SESSION_ACTIVE) {
                session_start();
            }
            return true;
        }
        return Base::getSessionObject()->start();
    }
910633
public function start()
    {
        if (!$this->nested || !$this->depth) {
            parent::start();
        } else {
            $savepoint = 'SP_' . $this->depth;
            $this->db->setQuery('SAVEPOINT ' . $this->db->quoteName($savepoint));

            if ($this->db->execute()) {
                $this->depth++;
            }
        }

        return $this;
    }
952621
public function connect()
    {
        $this->connection = @new \mysqli(
            $this->host,
            $this->username,
            $this->password,
            $this->databaseName
        );

        if (!$this->connection->connect_errno) {
            $this->connection->autocommit(1);
            return true;
        } else {
            return false;
        }
    }