Example #1
0
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 */
// Use output buffering, this gains us a few things and
// fixes some CSS issues
ob_start();
$ampache_path = dirname(__FILE__);
$prefix = realpath($ampache_path . "/../");
require_once $prefix . '/lib/init-tiny.php';
// Explicitly load and enable the custom session handler.
// Relying on autoload may not always load it before sessiony things are done.
require_once $prefix . '/lib/class/session.class.php';
Session::_auto_init();
// Set up for redirection on important error cases
$path = preg_replace('#(.*)/(\\w+\\.php)$#', '$1', $_SERVER['PHP_SELF']);
$path = $http_type . $_SERVER['HTTP_HOST'] . $path;
// Check to make sure the config file exists. If it doesn't then go ahead and
// send them over to the install script.
$results = array();
if (!file_exists($configfile)) {
    $link = $path . '/install.php';
} else {
    // Make sure the config file is set up and parsable
    $results = @parse_ini_file($configfile);
    if (!count($results)) {
        $link = $path . '/test.php?action=config';
    }
}