[31516] trunk/www

jmpp at macports.org jmpp at macports.org
Mon Nov 26 18:46:09 PST 2007


Revision: 31516
          http://trac.macosforge.org/projects/macports/changeset/31516
Author:   jmpp at macports.org
Date:     2007-11-26 18:46:07 -0800 (Mon, 26 Nov 2007)

Log Message:
-----------

Not all pages need to establish a connection to the mysql db, so move the $portsdb_connect variable and mysql_pconnect() function call
out of www/includes/common.inc (which is included by all) and into the pages that really need it.

Modified Paths:
--------------
    trunk/www/includes/common.inc
    trunk/www/index.php
    trunk/www/ports.php

Modified: trunk/www/includes/common.inc
===================================================================
--- trunk/www/includes/common.inc	2007-11-27 02:15:13 UTC (rev 31515)
+++ trunk/www/includes/common.inc	2007-11-27 02:46:07 UTC (rev 31516)
@@ -35,7 +35,6 @@
 $portsdb_name = 'macports';
 $portsdb_user = 'www';
 $portsdb_passwd = '';
-$portsdb_connect = mysql_pconnect($portsdb_host, $portsdb_user, $portsdb_passwd) or die("Can't connect to the MacPorts database!");
 
 
 ######################################################################

Modified: trunk/www/index.php
===================================================================
--- trunk/www/index.php	2007-11-27 02:15:13 UTC (rev 31515)
+++ trunk/www/index.php	2007-11-27 02:46:07 UTC (rev 31516)
@@ -5,6 +5,7 @@
     $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     include_once("$MPWEB/includes/common.inc");
     print_header('The MacPorts Project -- Home', 'utf-8');
+    $portsdb_connect = mysql_pconnect($portsdb_host, $portsdb_user, $portsdb_passwd) or die("Can't connect to the MacPorts database!");
 ?>
 
 

Modified: trunk/www/ports.php
===================================================================
--- trunk/www/ports.php	2007-11-27 02:15:13 UTC (rev 31515)
+++ trunk/www/ports.php	2007-11-27 02:46:07 UTC (rev 31516)
@@ -7,6 +7,7 @@
     $MPWEB = $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME']);
     include_once("$MPWEB/includes/common.inc");
     print_header('The MacPorts Project -- Available Ports', 'utf-8');
+    $portsdb_connect = mysql_pconnect($portsdb_host, $portsdb_user, $portsdb_passwd) or die("Can't connect to the MacPorts database!");
     $by = isset($_GET['by']) ? $_GET['by'] : '';
     $substr = isset($_GET['substr']) ? $_GET['substr'] : '';
 ?>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071126/b3d1a972/attachment.html


More information about the macports-changes mailing list