git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

common.php 2.16 KB
Newer Older
Evan Prodromou's avatar
Evan Prodromou committed
1
<?php
Evan Prodromou's avatar
Evan Prodromou committed
2
/*
3
 * StatusNet - the distributed open-source microblogging tool
4
 * Copyright (C) 2008-2010, StatusNet, Inc.
Evan Prodromou's avatar
Evan Prodromou committed
5
 *
6 7 8 9
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
Evan Prodromou's avatar
Evan Prodromou committed
10
 *
11 12 13 14
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
Evan Prodromou's avatar
Evan Prodromou committed
15
 *
16 17 18 19
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

20
if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
21

22 23
// All the fun stuff to actually initialize StatusNet's framework code,
// without loading up a site configuration.
Brion Vibber's avatar
Brion Vibber committed
24
require_once INSTALLDIR . '/lib/framework.php';
25

26
try {
mmn's avatar
mmn committed
27
    GNUsocial::init(@$server, @$path, @$conffile);
28 29 30
} catch (NoConfigException $e) {
    // XXX: Throw a conniption if database not installed
    // XXX: Find a way to use htmlwriter for this instead of handcoded markup
31
    // TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
32
    echo '<p>'. _('No configuration file found.') .'</p>';
33 34
    // TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
    // TRANS: Is followed by a list of directories (separated by HTML breaks).
35
    echo '<p>'. _('I looked for configuration files in the following places:') .'<br /> ';
36 37
    echo implode($e->configFiles, '<br />');
    // TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
38
    echo '<p>'. _('You may wish to run the installer to fix this.') .'</p>';
39 40 41
    // @todo FIXME Link should be in a para?
    // TRANS: Error message displayed when no configuration file was found for a StatusNet installation.
    // TRANS: The text is link text that leads to the installer page.
42 43
    echo '<a href="install.php">'. _('Go to the installer.') .'</a>';
    exit;
Evan Prodromou's avatar
Evan Prodromou committed
44
}