Overview

Namespaces

  • BSN
    • CryptUser

Classes

  • CryptJSONSource
  • CryptMySQLSource
  • CryptUser
  • SSLKey

Interfaces

  • CryptDataSource
  • Overview
  • Namespace
  • Class
  • Tree

Class CryptMySQLSource

A MySQL based data source object for the CryptUsers.

BSN\CryptUser\CryptMySQLSource implements BSN\CryptUser\CryptDataSource
Namespace: BSN\CryptUser
Copyright: Copyright 2013, Bryan Nielsen
Author: Bryan Nielsen, bnielsen1965@gmail.com
Located at Class/CryptMySQLSource.php
Methods summary
public
# __construct( mixed $databaseConfig )

Constructor to set up the data source

Constructor to set up the data source

private
# connectToDatabase( )

Connect to the database

Connect to the database

public string
# getSourceType( )

Get source type

Get source type

Returns

string
The data source type.

Implementation of

BSN\CryptUser\CryptDataSource::getSourceType()
public array|boolean
# getUserByName( string $username )

Get array of users that match a given name.

Get array of users that match a given name.

Parameters

$username
string
$username The username to search for in the data source.

Returns

array|boolean
An array of arrays containing user elements to create a user or FALSE if not found.

Implementation of

BSN\CryptUser\CryptDataSource::getUserByName()
public array
# getUsernames( )

Get a list of usernames

Get a list of usernames

Returns

array
An array of strings containing the usernames from the data source.

Implementation of

BSN\CryptUser\CryptDataSource::getUsernames()
public boolean
# saveUser( array $user )

Save the provided user details in the data source.

Save the provided user details in the data source.

Parameters

$user
array
$user An array of user elements to be saved.

Returns

boolean
Returns TRUE on success and FALSE on failure.

Implementation of

BSN\CryptUser\CryptDataSource::saveUser()
public boolean
# deleteUser( string $username )

Delete the specified user from the data source.

Delete the specified user from the data source.

Parameters

$username
string
$username The username of the user to delete.

Returns

boolean
Returns TRUE on success and FALSE on failure.

Implementation of

BSN\CryptUser\CryptDataSource::deleteUser()
private integer|boolean
# searchUsersForUser( array $users, mixed $username )

Search provided users array for the specified user.

Search provided users array for the specified user.

Parameters

$users
array
$users An array of user rows to search.
$username

Returns

integer|boolean
The array index for the user name or FALSE if not found.
public string
# getCreateUserTableSQL( )

Get SQL to create users table.

Get SQL to create users table.

Returns

string
SQL statement to create user table.
public boolean
# createUsersTable( string $createSQL = NULL )

Create users table.

Create users table.

Parameters

$createSQL
string
$createSQL Optional SQL statement to create the users table.

Returns

boolean
TRUE on success, FALSE on failure.
public boolean
# usersTableExists( )

Check to see if users table exists

Check to see if users table exists

Returns

boolean
TRUE if table exists, FALSE if table does not exist.
public
# __wakeup( )

The magic __wakeup() function is used to reconnect to the database when the object is unserialized.

The magic __wakeup() function is used to reconnect to the database when the object is unserialized.

Properties summary
private mixed $mysqli
#
private mixed $usersTable
#
private mixed $databaseConfig
#
cryptUser API documentation generated by ApiGen 2.8.0