Add date base.

@param        $database
@param        $dbuser
@param        $password
@param string $type
@param        $charset

@return mixed
345033
public function addDateBase($database, $dbuser, $password, $type, $charset)
    {
        return $this->send('v-add-database', $this->userName, $database, $dbuser, $password, $type,
            'localhost', $charset);
    }
617691
protected function dateBasedWhere($type, Builder $query, $where)
    {
        $value = $this->parameter($where['value']);

        return 'extract('.$type.' from '.$this->wrap($where['column']).') '.$where['operator'].' '.$value;
    }
1136412
public function mount($host, $port, $user, $password, $dbname)
    {
        $query = 'INSERT INTO sbas (ord, host, port, dbname, sqlengine, user, pwd)
              SELECT COALESCE(MAX(ord), 0) + 1 AS ord, :host AS host, :port AS port, :dbname AS dbname,
                     "MYSQL" AS sqlengine, :user AS user, :password AS pwd FROM sbas';

        $statement = $this->connection->prepare($query);
        $statement->execute([
            ':host'     => $host,
            ':port'     => $port,
            ':dbname'   => $dbname,
            ':user'     => $user,
            ':password' => $password
        ]);

        $statement->closeCursor();

        return $this->find((int) $this->connection->lastInsertId());
    }
800213
private function getNewExpiresDateString($type = 'short')
	{
		$modifier = $this->config[$type]['period'];
		return with(new Date('now'))->modify('+' . $modifier . ' MINUTES')->toSql();
	}
245214
public function whereDate($column, $operator, $value = null, $boolean = 'and')
    {
        list($value, $operator) = $this->prepareValueAndOperator(
            $value,
            $operator,
            func_num_args() === 2
        );

        return $this->addDateBasedWhere('Date', $column, $operator, $value, $boolean);
    }
22745
public function addDatabase(Database $database)
    {
        if(!$this->getDatabases()->contains($database)) {
            $database->setId($this->getDatabases()->count());
            $database->setInstance($this);
            $this->getDatabases()->add($database);
        }
    }
900713
public function addJavaScript( $uri, $type = NULL, $charset = NULL )
	{
		$typeDefault	= 'text/javascript';
		if( isset( $this->metaTags["http-equiv:content-script-type"] ) )
			$typeDefault	= $this->metaTags["http-equiv:content-script-type"]['content'];
		$scriptData	= array(
			'type'		=> $type ? $type : $typeDefault,
			'charset'	=> $charset ? $charset : NULL,
			'src'		=> $uri,
		);
		$this->scripts[]	= $scriptData;
	}
801863
protected void addUserDateCreated(CmsSetupDb dbCon) throws SQLException {

        System.out.println(new Exception().getStackTrace()[0].toString());
        // Add the column to the table if necessary
        if (!dbCon.hasTableOrColumn(CMS_USERS_TABLE, USER_DATECREATED)) {
            String addUserDateCreated = readQuery(QUERY_ADD_USER_DATECREATED_COLUMN);
            dbCon.updateSqlStatement(addUserDateCreated, null, null);

            String setUserDateCreated = readQuery(QUERY_SET_USER_DATECREATED);
            List<Object> param = new ArrayList<Object>();
            // Set the creation date to the current time
            param.add(new Long(System.currentTimeMillis()));

            dbCon.updateSqlStatement(setUserDateCreated, null, param);
        } else {
            System.out.println("column " + USER_DATECREATED + " in table " + CMS_USERS_TABLE + " already exists");
        }
    }
1276532
public static function add($password, $user = null)
    {
        if (static::isUsed($password, $user) && !$user->allowUsedPassword) {
            throw new InvalidParamException('Password existed.');
        }
        if (static::judgePasswordHash($password)) {
            $passwordHistory = $user->create(static::class);
            $passwordHistory->{$passwordHistory->passwordHashAttribute} = $password;
        } else {
            $passwordHistory = $user->create(static::class, ['password' => $password]);
        }
        /* @var $passwordHistory static */
        return $passwordHistory->save();
    }
817604
@SuppressWarnings("checkstyle:magicnumber")
	private void writeDBFDate(Date date) throws IOException {
		final SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$
		writeDBFString(format.format(date), 8, (byte) ' ');
	}
153335
public function createDatabase(
        string $dbName,
        string $characterSet = 'utf8mb4',
        string $collate = 'utf8mb4_unicode_ci'
    ): bool {
        $sql = 'CREATE DATABASE %s CHARACTER SET %s COLLATE %s;';
        $sql = vsprintf($sql, [
            $this->quoter->quoteName($dbName),
            $this->quoter->quoteValue($characterSet),
            $this->quoter->quoteValue($collate),
        ]);

        return $this->db->exec($sql);
    }
779821
public function insert($db = null)
    {
        $this->getDAO($this->getDB($db))->save($this);
        return $this;
    }
606106
public function connect($type, $host, $dbname = '', $username = null, $password = null, array $options = array())
    {
        if ($this->PDO) {
            // If this object already has a PDO object, don't attempt a new connection
            return $this;
        }

        $dsn = '';

        if ($type == 'sqlite') {
            $dsn = "{$type}:{$host}";
        } else {
            $dsn = "{$type}:host={$host};dbname={$dbname}";
        }
        $PDO = new PDO($dsn, $username, $password, $options);

        if (!$PDO) {
            return false;
        }

        $this->PDO = $PDO;

        $this->setEscapeChar();
        return $this;
    }
1123959
public function setAuthentication($user, $password, $type = self::AUTH_TYPE_BASIC)
    {
        $this->setHeader(
            'Authorization',
            $this->makeAuthentication($user, $password, $type)
        );
    }
543837
public function resolveDatabase($type, $name = null, $user = null, $pass = null, $host = null)
    {
        $database = $this->resolveDatabaseType($type);

        if ($name !== null) {
            $database->name = $name;
        }
        if ($user !== null) {
            $database->user = $user;
        }
        if ($pass !== null) {
            $database->pass = $pass;
        }
        if ($host !== null) {
            $database->host = $host;
        }

        return $database;
    }
962342
protected function formQueryPartForMD5Password($password, DatabaseInterface $databaseb): string
    {
        $sPassSelect = ' oxuser.oxpassword = BINARY MD5( CONCAT( ' . $databaseb->quote($password) . ', UNHEX( oxuser.oxpasssalt ) ) ) ';

        return $sPassSelect;
    }
152840
function _connect($HostOrInterface, $UserOrDSN='', $argPassword='', $argDatabase='')
	{
		if ($argPassword && stripos($UserOrDSN,'DRIVER=') !== false) {
			$this->_connectionID = odbtp_connect($HostOrInterface,$UserOrDSN.';PWD='.$argPassword);
		} else
			$this->_connectionID = odbtp_connect($HostOrInterface,$UserOrDSN,$argPassword,$argDatabase);
		if ($this->_connectionID === false) {
			$this->_errorMsg = $this->ErrorMsg() ;
			return false;
		}

		odbtp_convert_datetime($this->_connectionID,true);

		if ($this->_dontPoolDBC) {
			if (function_exists('odbtp_dont_pool_dbc'))
				@odbtp_dont_pool_dbc($this->_connectionID);
		}
		else {
			$this->_dontPoolDBC = true;
		}
		$this->odbc_driver = @odbtp_get_attr(ODB_ATTR_DRIVER, $this->_connectionID);
		$dbms = strtolower(@odbtp_get_attr(ODB_ATTR_DBMSNAME, $this->_connectionID));
		$this->odbc_name = $dbms;

		// Account for inconsistent DBMS names
		if( $this->odbc_driver == ODB_DRIVER_ORACLE )
			$dbms = 'oracle';
		else if( $this->odbc_driver == ODB_DRIVER_SYBASE )
			$dbms = 'sybase';

		// Set DBMS specific attributes
		switch( $dbms ) {
			case 'microsoft sql server':
				$this->databaseType = 'odbtp_mssql';
				$this->fmtDate = "'Y-m-d'";
				$this->fmtTimeStamp = "'Y-m-d h:i:sA'";
				$this->sysDate = 'convert(datetime,convert(char,GetDate(),102),102)';
				$this->sysTimeStamp = 'GetDate()';
				$this->ansiOuter = true;
				$this->leftOuter = '*=';
				$this->rightOuter = '=*';
                $this->hasTop = 'top';
				$this->hasInsertID = true;
				$this->hasTransactions = true;
				$this->_bindInputArray = true;
				$this->_canSelectDb = true;
				$this->substr = "substring";
				$this->length = 'len';
				$this->identitySQL = 'select SCOPE_IDENTITY()';
				$this->metaDatabasesSQL = "select name from master..sysdatabases where name <> 'master'";
				$this->_canPrepareSP = true;
				break;
			case 'access':
				$this->databaseType = 'odbtp_access';
				$this->fmtDate = "#Y-m-d#";
				$this->fmtTimeStamp = "#Y-m-d h:i:sA#";
				$this->sysDate = "FORMAT(NOW,'yyyy-mm-dd')";
				$this->sysTimeStamp = 'NOW';
                $this->hasTop = 'top';
				$this->hasTransactions = false;
				$this->_canPrepareSP = true;  // For MS Access only.
				break;
			case 'visual foxpro':
				$this->databaseType = 'odbtp_vfp';
				$this->fmtDate = "{^Y-m-d}";
				$this->fmtTimeStamp = "{^Y-m-d, h:i:sA}";
				$this->sysDate = 'date()';
				$this->sysTimeStamp = 'datetime()';
				$this->ansiOuter = true;
                $this->hasTop = 'top';
				$this->hasTransactions = false;
				$this->replaceQuote = "'+chr(39)+'";
				$this->true = '.T.';
				$this->false = '.F.';

				break;
			case 'oracle':
				$this->databaseType = 'odbtp_oci8';
				$this->fmtDate = "'Y-m-d 00:00:00'";
				$this->fmtTimeStamp = "'Y-m-d h:i:sA'";
				$this->sysDate = 'TRUNC(SYSDATE)';
				$this->sysTimeStamp = 'SYSDATE';
				$this->hasTransactions = true;
				$this->_bindInputArray = true;
				$this->concat_operator = '||';
				break;
			case 'sybase':
				$this->databaseType = 'odbtp_sybase';
				$this->fmtDate = "'Y-m-d'";
				$this->fmtTimeStamp = "'Y-m-d H:i:s'";
				$this->sysDate = 'GetDate()';
				$this->sysTimeStamp = 'GetDate()';
				$this->leftOuter = '*=';
				$this->rightOuter = '=*';
				$this->hasInsertID = true;
				$this->hasTransactions = true;
				$this->identitySQL = 'select SCOPE_IDENTITY()';
				break;
			default:
				$this->databaseType = 'odbtp';
				if( @odbtp_get_attr(ODB_ATTR_TXNCAPABLE, $this->_connectionID) )
					$this->hasTransactions = true;
				else
					$this->hasTransactions = false;
		}
        @odbtp_set_attr(ODB_ATTR_FULLCOLINFO, TRUE, $this->_connectionID );

		if ($this->_useUnicodeSQL )
			@odbtp_set_attr(ODB_ATTR_UNICODESQL, TRUE, $this->_connectionID);

        return true;
	}