Changeset 2767 in /cluster/svnroot


Ignore:
Timestamp:
Oct 28, 2010 5:08:11 PM (10 years ago)
Author:
fitz
Message:

#532: add page to process/receive usage data

Location:
bccd-ng/bccd.net
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/bccd.net/includes/bccdPage.php

    r2702 r2767  
    33include("cssmin.php");
    44include("jsmin.php");
     5
     6if (file_exists("config.php")) {
     7        include("config.php");
     8} else {
     9        print "<h1>Missing config.php!</h1>";
     10        die;
     11}
    512
    613class bccdPage {
     
    1926  private $CSSFiles;
    2027  private $JSFiles;
     28        private $pgConnection;
    2129
    2230  // ---------- Private Methods ----------
     
    102110  }
    103111
     112        public function dbConnect() {
     113                $this->pgConnection
     114                        = pg_connect("host=cluster.earlham.edu dbname=bccd user=bccd password=$dbpass");
     115
     116                if (!$this->pgConnection) {
     117                        print pg_last_error();
     118                }
     119
     120                return $this->pgConnection;
     121        }
     122
    104123  public function setBasePath($path) {
    105124    if ($path[strlen($path)-1] != '/')
     
    189208
    190209    print $page;
     210
     211                if ($this->pgConnection) {
     212                        pg_close($this->pgConnection);
     213                }
    191214  }
    192215}
Note: See TracChangeset for help on using the changeset viewer.