]> git.mjollnir.org Git - s9y.git/commitdiff
* Create a new index on the plugin DB table, optimize fetching config values...
authorgarvinhicking <garvinhicking>
Sat, 1 Apr 2006 20:24:28 +0000 (20:24 +0000)
committergarvinhicking <garvinhicking>
Sat, 1 Apr 2006 20:24:28 +0000 (20:24 +0000)
include/functions_config.inc.php
serendipity_config.inc.php
sql/db_update_1.1-alpha1_1.1-alpha2_mysql.sql [new file with mode: 0644]

index 6ba8bf08c597d234b12ba564a7c8faefd2ca9829..b1da2d1647b2c94ce79369f6e8967c413ff48f6b 100644 (file)
@@ -2,6 +2,11 @@
 # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
 # All rights reserved.  See LICENSE file for licensing details
 
+if (defined('S9Y_FRAMEWORK_CONFIG')) {
+    return;
+}
+@define('S9Y_FRAMEWORK_CONFIG', true);
+
 /**
  * Adds a new author account
  *
@@ -142,6 +147,8 @@ function serendipity_get_user_config_var($name, $authorid, $default = '') {
     $author_sql = '';
     if (!empty($authorid)) {
         $author_sql = "authorid = " . (int)$authorid . " AND ";
+    } elseif (isset($serendipity[$name])) {
+        return $serendipity[$name];
     }
 
     $r = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE $author_sql name = '" . $name . "' LIMIT 1", true);
@@ -512,7 +519,7 @@ function serendipity_is_iframe() {
     global $serendipity;
 
     if ($serendipity['GET']['is_iframe'] && is_array($_SESSION['save_entry'])) {
-        include_once S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
+        include S9Y_INCLUDE_PATH . 'include/functions_entries_admin.inc.php';
         // An iframe may NOT contain <html> and </html> tags, that's why we emit different headers here than on serendipity_admin.php
 
         // We need to restore GET/POST variables to that depending plugins inside the iframe
index cb28614182179079c32ad8991336bef4ea74d970..1ad5354d00a94e12782ee63ab56eeb602d32ae40 100644 (file)
@@ -2,6 +2,12 @@
 # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
 # All rights reserved.  See LICENSE file for licensing details
 
+if (defined('S9Y_FRAMEWORK')) {
+    return;
+}
+
+@define('S9Y_FRAMEWORK', true);
+
 if (!headers_sent()) {
     session_start();
 }
@@ -18,10 +24,10 @@ if (IS_installed === true && !defined('IN_serendipity')) {
     define('IN_serendipity', true);
 }
 
-include_once(S9Y_INCLUDE_PATH . 'include/compat.inc.php');
+include(S9Y_INCLUDE_PATH . 'include/compat.inc.php');
 
 // The version string
-$serendipity['version']         = '1.1-alpha1';
+$serendipity['version']         = '1.1-alpha2';
 
 // Name of folder for the default theme
 $serendipity['defaultTemplate'] = 'carl_contest';
@@ -176,21 +182,25 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/se
     $local_config = S9Y_INCLUDE_PATH . '/serendipity_config_local.inc.php';
 }
 
-if (is_readable($local_config)) {
-    include_once($local_config);
-} else {
-    serendipity_die(sprintf(INCLUDE_ERROR, $local_config));
+if (!is_readable($local_config)) {
+    $serendipity['lang'] = 'en';
+    include(S9Y_INCLUDE_PATH . 'include/lang.inc.php');
+    serendipity_die(sprintf(INCLUDE_ERROR . '<br />' . FILE_CREATE_YOURSELF, $local_config));
 }
 
+include($local_config);
+
 define('IS_up2date', version_compare($serendipity['version'], $serendipity['versionInstalled'], '<='));
 
 /*
  *  Include main functions
  */
-include_once(S9Y_INCLUDE_PATH . 'include/functions.inc.php');
+include(S9Y_INCLUDE_PATH . 'include/functions.inc.php');
 
-if (serendipity_FUNCTIONS_LOADED!== true) {
-    serendipity_die(sprintf(INCLUDE_ERROR, 'include/functions.inc.php'));
+if (serendipity_FUNCTIONS_LOADED !== true) {
+    $serendipity['lang'] = 'en';
+    include(S9Y_INCLUDE_PATH . 'include/lang.inc.php');
+    serendipity_die(sprintf(INCLUDE_ERROR . '<br />' . FILE_CREATE_YOURSELF, 'include/functions.inc.php'));
 }
 
 /*
diff --git a/sql/db_update_1.1-alpha1_1.1-alpha2_mysql.sql b/sql/db_update_1.1-alpha1_1.1-alpha2_mysql.sql
new file mode 100644 (file)
index 0000000..ccf1d4a
--- /dev/null
@@ -0,0 +1 @@
+CREATE INDEX pluginretr_idx ON {PREFIX}plugins (placement, sort_order);