*/
    if (!(include_once $ElggPath . "engine/lib/database.php")) {
        // Database connection
        throw new InstallationException("Elgg could not load the main Elgg database library.");
    }
    /**
     * Load the remaining libraries from lib/ in alphabetical order,
     * except for a few exceptions
     */
    if (!(include_once $ElggPath . "engine/lib/actions.php")) {
        throw new InstallationException("Elgg could not load the Actions library");
    }
    // We don't want to load or reload these files
    $file_exceptions = array('.', '..', '.DS_Store', 'Thumbs.db', '.svn', 'CVS', 'cvs', 'settings.php', 'settings.example.php', 'languages.php', 'exceptions.php', 'elgglib.php', 'access.php', 'database.php', 'actions.php', 'sessions.php');
    // Get the list of files to include, and alphabetically sort them
    $files = get_library_files($ElggPath . "engine/lib", $file_exceptions);
    asort($files);
    // Get config
    global $CONFIG;
    $CONFIG->cli = true;
    //to allow the superadmin from commandline to modify entities
    // Include them
    foreach ($files as $file) {
        if (isset($CONFIG->debug) && $CONFIG->debug) {
            error_log("Loading {$file}...");
        }
        if (!(include_once $file)) {
            throw new InstallationException("Could not load {$file}");
        }
    }
} else {
Beispiel #2
0
     */
    if (!(include_once dirname(__FILE__) . "/lib/database.php")) {
        // Database connection
        throw new InstallationException("Elgg could not load the main Elgg database library.");
    }
    /**
     * Load the remaining libraries from /lib/ in alphabetical order,
     * except for a few exceptions
     */
    if (!(include_once dirname(__FILE__) . "/lib/actions.php")) {
        throw new InstallationException("Elgg could not load the Actions library");
    }
    // We don't want to load or reload these files
    $file_exceptions = array('.', '..', '.DS_Store', 'Thumbs.db', '.svn', 'CVS', 'cvs', 'settings.php', 'settings.example.php', 'languages.php', 'exceptions.php', 'elgglib.php', 'access.php', 'database.php', 'actions.php', 'sessions.php');
    // Get the list of files to include, and alphabetically sort them
    $files = get_library_files(dirname(__FILE__) . "/lib", $file_exceptions);
    asort($files);
    // Get config
    global $CONFIG;
    // Include them
    foreach ($files as $file) {
        if (isset($CONFIG->debug) && $CONFIG->debug) {
            error_log("Loading {$file}...");
        }
        if (!(include_once $file)) {
            throw new InstallationException("Could not load {$file}");
        }
    }
} else {
    // End portion for sanitised installs only
    throw new InstallationException(elgg_echo('installation:error:configuration'));
Beispiel #3
0
//rico
$lib_files['rico.js'][] = 'effects/rico.js';

//javascript templating
$lib_files['template.js'][] = 'extra/tp_template.js';

//validator
$lib_files['validator.js'][] = 'prado/validation.js';
$lib_files['validator.js'][] = 'prado/validators.js';

//date picker
$lib_files['datepicker.js'][] = 'prado/datepicker.js';
*/
/*============ Build the javascript files =========*/
foreach ($lib_files as $output_file => $lib) {
    $files = get_library_files($library, $lib);
    $compressed = get_compressed_content($files);
    save_contents($outputs, $output_file, $compressed);
}
/*============ utility functions ==============*/
function save_contents($outputs, $output_file, $contents)
{
    $tmp_file = $output_file . '.tmp';
    file_put_contents($tmp_file, $contents);
    copy_files($outputs, $tmp_file, $output_file);
    echo "Saving to <b>{$output_file}.</b></br></br>\n\n";
    unlink($tmp_file);
}
function get_library_files($lib_dir, $lib_files)
{
    $files = array();