make the file PEAR CS compliant
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@395 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
3bbf5f3c55
commit
3df99a0aec
1 changed files with 29 additions and 5 deletions
|
@ -1,6 +1,29 @@
|
||||||
<?php
|
<?php
|
||||||
/* Connect to the database and build services */
|
/**
|
||||||
|
* SemanticScuttle - your social bookmark manager.
|
||||||
|
*
|
||||||
|
* PHP version 5.
|
||||||
|
*
|
||||||
|
* @category Bookmarking
|
||||||
|
* @package SemanticScuttle
|
||||||
|
* @author Benjamin Huynh-Kim-Bang <mensonge@users.sourceforge.net>
|
||||||
|
* @author Christian Weiske <cweiske@cweiske.de>
|
||||||
|
* @author Eric Dane <ericdane@users.sourceforge.net>
|
||||||
|
* @license GPL http://www.gnu.org/licenses/gpl.html
|
||||||
|
* @link http://sourceforge.net/projects/semanticscuttle
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Connect to the database and build services.
|
||||||
|
*
|
||||||
|
* @category Bookmarking
|
||||||
|
* @package SemanticScuttle
|
||||||
|
* @author Benjamin Huynh-Kim-Bang <mensonge@users.sourceforge.net>
|
||||||
|
* @author Christian Weiske <cweiske@cweiske.de>
|
||||||
|
* @author Eric Dane <ericdane@users.sourceforge.net>
|
||||||
|
* @license GPL http://www.gnu.org/licenses/gpl.html
|
||||||
|
* @link http://sourceforge.net/projects/semanticscuttle
|
||||||
|
*/
|
||||||
class SemanticScuttle_Service_Factory
|
class SemanticScuttle_Service_Factory
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -71,7 +94,7 @@ class SemanticScuttle_Service_Factory
|
||||||
if (!class_exists($class)) {
|
if (!class_exists($class)) {
|
||||||
//PEAR classname to filename rule
|
//PEAR classname to filename rule
|
||||||
$file = str_replace('_', '/', $class) . '.php';
|
$file = str_replace('_', '/', $class) . '.php';
|
||||||
require_once $file;
|
include_once $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$instances[$name] = call_user_func(
|
self::$instances[$name] = call_user_func(
|
||||||
|
@ -95,19 +118,20 @@ class SemanticScuttle_Service_Factory
|
||||||
if (self::$db !== null) {
|
if (self::$db !== null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
require_once 'SemanticScuttle/db/'. $dbtype .'.php';
|
include_once 'SemanticScuttle/db/'. $dbtype .'.php';
|
||||||
$db = new sql_db();
|
$db = new sql_db();
|
||||||
$db->sql_connect(
|
$db->sql_connect(
|
||||||
$dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist
|
$dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist
|
||||||
);
|
);
|
||||||
if(!$db->db_connect_id) {
|
if (!$db->db_connect_id) {
|
||||||
message_die(
|
message_die(
|
||||||
CRITICAL_ERROR,
|
CRITICAL_ERROR,
|
||||||
'Could not connect to the database',
|
'Could not connect to the database',
|
||||||
$db
|
self::$db
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$db->sql_query('SET NAMES UTF8');
|
$db->sql_query('SET NAMES UTF8');
|
||||||
|
self::$db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue