Overview

Namespaces

  • CJPGDK
    • PhpHttpAuth
      • Database
      • Hash
  • PHP

Classes

  • DB
  • MySQL
  • PDODB
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Class DB

Provides generic database methods

Direct known subclasses

CJPGDK\PhpHttpAuth\Database\MySQL, CJPGDK\PhpHttpAuth\Database\PDODB
Abstract
Namespace: CJPGDK\PhpHttpAuth\Database
Package: CJPGDK\PhpHttpAuth
Author: Christian M. Jensen cmj@cjpg.dk
Version: 1.0.0
Since: 1.0.0
Located at src/CJPGDK/PhpHttpAuth/Database/DB.php
Methods summary
abstract public boolean
# deleteUser( string $name )

Delete a user from database

Delete a user from database

Parameters

$name

Returns

boolean
abstract public object[]
# getUsers( )

Get users from database

Get users from database

Returns

object[]
abstract public object
# getUser( string $name )

Get user from database

Get user from database

Parameters

$name

Returns

object
abstract public boolean
# saveUser( string $name, string $passwd )

Save or update a user in the database

Save or update a user in the database

Parameters

$name
$passwd

Returns

boolean
abstract public mysqli|PDO
# getDb( )

Get database connection

Get database connection

Returns

mysqli|PDO
protected
# setConnectionSocket( mixed $socket, mixed $default = null )

Set the database connection socket

Set the database connection socket

Parameters

$socket
$default
protected mixed
# getConnectionSocket( )

Get the database connection socket

Get the database connection socket

Returns

mixed
protected
# setConnectionPort( mixed $port, mixed $default = null )

Set the database connection port

Set the database connection port

Parameters

$port
$default
protected mixed
# getConnectionPort( )

Get the database connection port

Get the database connection port

Returns

mixed
protected
# setConnectionDatabseName( mixed $dbName, mixed $default = null )

Set the databsename to use when connecting to the database

Set the databsename to use when connecting to the database

Parameters

$dbName
$default
protected mixed
# getConnectionDatabseName( )

Get the databsename to use when connecting to the database

Get the databsename to use when connecting to the database

Returns

mixed
protected
# setConnectionPassword( mixed $passwd, mixed $default = null )

Set the password to use when connecting to the database

Set the password to use when connecting to the database

Parameters

$passwd
$default
protected mixed
# getConnectionPassword( )

Get the password to use when connecting to the database

Get the password to use when connecting to the database

Returns

mixed
protected
# setConnectionUser( mixed $user, mixed $default = null )

Set the username to use when connecting to the database

Set the username to use when connecting to the database

Parameters

$user
$default
protected mixed
# getConnectionUser( )

Get the username to use when connecting to the database

Get the username to use when connecting to the database

Returns

mixed
protected
# setConnectionHost( mixed $host, mixed $default = null )

Set the host or path to the database

Set the host or path to the database

Parameters

$host
$default
protected mixed
# getConnectionHost( )

Get the host or path to the database

Get the host or path to the database

Returns

mixed
Properties summary
protected array $dbConnectionSettings
# array( 'host' => null, 'user' => null, 'passwd' => null, 'databsename' => null, 'port' => null, 'socket' => null, )
public string $usersTableName

Name of the table that holds the users

Name of the table that holds the users

# "users"
public array $tableColumns

An array that indicates the names of the columns in the table that contains the users

An array that indicates the names of the columns in the table that contains the users

# array( 'id' => 'id_users', 'username' => 'username', 'password' => 'password' )
PhpHttpAuth API documentation generated by ApiGen