Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change PHP keywords to comply with PSR2 #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mssql.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ function connect($config) {

if ($this->db = mssql_pconnect($config['server'], $config['username'], $config['password'])) {
mssql_select_db($config['database']);
return TRUE;
return true;
}
return FALSE;
return false;
}

/**
Expand Down Expand Up @@ -126,7 +126,7 @@ function getDatabase() {
* @return str[] The primary key field names
*/
function getPrimaryKeys($table) {
$primary = NULL;
$primary = null;
$query = sprintf("SELECT [name]
FROM syscolumns
WHERE [id] IN (SELECT [id]
Expand Down
10 changes: 5 additions & 5 deletions mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ function connect($config) {
$config['password']
)) {
if ($this->select_db($config['database'])) {
return TRUE;
return true;
}
}
return FALSE;
return false;
}

/**
Expand All @@ -63,9 +63,9 @@ function close() {
*/
function select_db($database) {
if (mysql_select_db($database, $this->db)) {
return TRUE;
return true;
}
return FALSE;
return false;
}

/**
Expand Down Expand Up @@ -111,7 +111,7 @@ function getDatabase() {
*/
function getPrimaryKeys($table) {
$resource = $this->getColumns($table);
$primary = NULL;
$primary = null;
if ($resource) {
while ($row = $this->row($resource)) {
if ($row['Key'] == 'PRI') {
Expand Down
16 changes: 8 additions & 8 deletions phprestsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,25 @@ class PHPRestSQL {
* The HTTP request data sent (if any).
* @var str
*/
var $requestData = NULL;
var $requestData = null;

/**
* The URL extension stripped off of the request URL
* @var str
*/
var $extension = NULL;
var $extension = null;

/**
* The database table to query.
* @var str
*/
var $table = NULL;
var $table = null;

/**
* The primary key of the database row to query.
* @var str[]
*/
var $uid = NULL;
var $uid = null;

/**
* Array of strings to convert into the HTTP response.
Expand All @@ -75,15 +75,15 @@ class PHPRestSQL {
/**
* Type of display, database, table or row.
*/
var $display = NULL;
var $display = null;

/**
* Constructor. Parses the configuration file "phprestsql.ini", grabs any request data sent, records the HTTP
* request method used and parses the request URL to find out the requested table name and primary key values.
* @param str iniFile Configuration file to use
*/
function PHPRestSQL($iniFile = 'phprestsql.ini') {
$this->config = parse_ini_file($iniFile, TRUE);
$this->config = parse_ini_file($iniFile, true);

if (isset($_SERVER['REQUEST_URI']) && isset($_SERVER['REQUEST_METHOD'])) {

Expand All @@ -101,7 +101,7 @@ function PHPRestSQL($iniFile = 'phprestsql.ini') {

$lastPart = array_pop($urlParts);
$dotPosition = strpos($lastPart, '.');
if ($dotPosition !== FALSE) {
if ($dotPosition !== false) {
$this->extension = substr($lastPart, $dotPosition + 1);
$lastPart = substr($lastPart, 0, $dotPosition);
}
Expand Down Expand Up @@ -519,7 +519,7 @@ function generateResponseData() {
/**
* Send a HTTP 201 response header.
*/
function created($url = FALSE) {
function created($url = false) {
header('HTTP/1.0 201 Created');
if ($url) {
header('Location: '.$url);
Expand Down
6 changes: 3 additions & 3 deletions postgresql.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ function connect($config) {
);

if ($this->db = pg_pconnect($connString)) {
return TRUE;
return true;
}
return FALSE;
return false;
}

/**
Expand Down Expand Up @@ -126,7 +126,7 @@ function getDatabase() {
*/
function getPrimaryKeys($table) {
$i = 0;
$primary = NULL;
$primary = null;
do {
$query = sprintf('SELECT pg_attribute.attname
FROM pg_class, pg_attribute, pg_index
Expand Down