diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-21 11:02:01 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-21 11:02:01 +0000 |
commit | 5db18a09c4eca4560c117f0b4dcd85d75e7139f2 (patch) | |
tree | 1fe739924ac56bebd2bf545f383aa1e0094a0b18 | |
parent | 3c181054dbe60467cc744c447010f525a862c26e (diff) | |
download | semanticscuttle-5db18a09c4eca4560c117f0b4dcd85d75e7139f2.tar.gz semanticscuttle-5db18a09c4eca4560c117f0b4dcd85d75e7139f2.tar.bz2 |
Refactoring: improve defined and imported functions
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@169 b3834d28-1941-0410-a4f8-b48e95affb8f
-rw-r--r-- | functions.inc.php | 12 | ||||
-rw-r--r-- | header.inc.php | 19 | ||||
-rw-r--r-- | services/bookmark2tagservice.php | 4 | ||||
-rw-r--r-- | services/servicefactory.php | 2 |
4 files changed, 23 insertions, 14 deletions
diff --git a/functions.inc.php b/functions.inc.php index 93821fd..965b120 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1,14 +1,6 @@ <?php -// UTF-8 functions -require_once(dirname(__FILE__) .'/includes/utf8.php'); - -// Translation -require_once(dirname(__FILE__) .'/includes/php-gettext/gettext.inc'); -$domain = 'messages'; -T_setlocale(LC_MESSAGES, $locale); -T_bindtextdomain($domain, dirname(__FILE__) .'/locales'); -T_bind_textdomain_codeset($domain, 'UTF-8'); -T_textdomain($domain); +/* Define functions used into the application */ + // Converts tags: // - direction = out: convert spaces to underscores; diff --git a/header.inc.php b/header.inc.php index f94ce0d..f26cb68 100644 --- a/header.inc.php +++ b/header.inc.php @@ -3,7 +3,7 @@ if(!file_exists(dirname(__FILE__) .'/config.inc.php')) { die("Please, create the 'config.inc.php' file. You can copy the 'config.inc.php.example' file."); } -// First requirements part (before debug management) +// 1 // First requirements part (before debug management) require_once(dirname(__FILE__) .'/config.inc.php'); require_once(dirname(__FILE__) .'/constants.inc.php'); // some constants are based on variables from config file @@ -20,12 +20,25 @@ if(DEBUG_MODE) { error_reporting(0); } - -// Second requirements part which could display bugs (must come after debug management) +// 2 // Second requirements part which could display bugs (must come after debug management) require_once(dirname(__FILE__) .'/services/servicefactory.php'); require_once(dirname(__FILE__) .'/functions.inc.php'); +// 3 // Third requirements part which import functions from includes/ directory + +// UTF-8 functions +require_once(dirname(__FILE__) .'/includes/utf8.php'); + +// Translation +require_once(dirname(__FILE__) .'/includes/php-gettext/gettext.inc'); +$domain = 'messages'; +T_setlocale(LC_MESSAGES, $locale); +T_bindtextdomain($domain, dirname(__FILE__) .'/locales'); +T_bind_textdomain_codeset($domain, 'UTF-8'); +T_textdomain($domain); + + session_start(); ?> diff --git a/services/bookmark2tagservice.php b/services/bookmark2tagservice.php index 31ae4d2..9cafec9 100644 --- a/services/bookmark2tagservice.php +++ b/services/bookmark2tagservice.php @@ -241,7 +241,9 @@ class Bookmark2TagService { message_die(GENERAL_ERROR, 'Could not get tags', '', __LINE__, __FILE__, $query, $this->db); return false; } - return $this->db->sql_fetchrowset($dbresult); + + $output = $this->db->sql_fetchrowset($dbresult); + return $output; } diff --git a/services/servicefactory.php b/services/servicefactory.php index 9d50841..7ff7f22 100644 --- a/services/servicefactory.php +++ b/services/servicefactory.php @@ -1,4 +1,6 @@ <?php +/* Build services */ + class ServiceFactory { function ServiceFactory(&$db, $serviceoverrules = array()) { } |