Changeset 1498

Show
Ignore:
Timestamp:
06/14/06 07:36:31 (2 years ago)
Author:
mdodoo
Message:

Fixes #310 by making schema.php write to dbstruct.sql. Through the CLI, it still display HTML headers, but also tells you that your information has been saved.

Also corrected unwrapped text in INSTALL.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gregarius/INSTALL

    r1497 r1498  
    3737 
    3838        1.  For a graphical installation, point your browser at the root 
    39             directory of your installation. Enter the necessary information about your database structure and continue. 
     39            directory of your installation. Enter the necessary information 
     40            about your database structure and continue. 
    4041 
    4142        2.  For a manual installation, create a configuration file, based on the 
  • trunk/gregarius/schema.php

    r1483 r1498  
    2626############################################################################### 
    2727 
     28define('DBSTRUCT', dirname(__FILE__) . '/dbstruct.sql'); 
    2829 
    2930require_once('util.php'); 
     
    9293 
    9394function rss_query_wrapper($query, $dieOnError=true, $preventRecursion=false) { 
     95    global $out; 
     96 
    9497    if (defined('DUMP_SCHEMA')) { 
    95         echo $query . ";\n"; 
     98        $out .= $query . ";\n"; 
    9699    } else { 
    97100        rss_query(trim($query),$dieOnError,$preventRecursion); 
     
    716719    @require_once('init.php'); 
    717720     
    718      
     721    $out = "################ 
     722# Gregarius " . _VERSION_ . " 
     723# database structure 
     724################# 
     725 
     726"; 
    719727    foreach (array("channels","config","folders","item","metatag","tag","rating", "users", "dashboard") as $tbl) { 
    720728        call_user_func("_init_$tbl");  
    721729    } 
    722          
    723          
     730    // shamelessly copied from install.php 
     731        $fp = @fopen(DBSTRUCT, 'w'); 
     732        if(!$fp) { 
     733            // unable to open file for writing 
     734            echo($out); 
     735            exit(); 
     736        } else { 
     737            // write the file 
     738            fwrite($fp, $out); 
     739            fclose($fp); 
     740            echo "The database structure has been written to the file 'dbstruct.sql'.\n"; 
     741            exit(); 
     742        } 
    724743} 
    725744