/**
 * Reads in all plugins an create an instance for each.
 */
function getPluginArray()
{
    $plugins = includePlugins();
    $classes = null;
    $i = 0;
    foreach ($plugins as $plugin) {
        $path = basename($plugin, ".php");
        $plugin = new $path();
        $classes[$plugin->id] = $plugin;
    }
    return $classes;
}
Exemple #2
0
/**
 * Main entry point for churchtools.
 * This will be called from /index.php
 * Function load constants and simple functions and have a try and catch for the whole application
 * It calls churchtools_app().
 */
function churchtools_main()
{
    try {
        require "system/includes/constants.php";
        include_once INCLUDES . "/functions.php";
        includePlugins();
        churchtools_app();
    } catch (SQLException $e) {
        //  TODO: get sql and show it to admin only
        //  if (DEBUG) {
        //  echo "<h3>PDO-Error:</h3>", $db->errorCode(), "<br>", $db->lastQuery(), '<br>';
        //  }
        //  else {
        //  echo "<h3>Database-Error:</h3>", "There is an error";
        //  }
        CTException::reportError($e);
    } catch (CTException $e) {
        $e->reportError($e);
    } catch (Exception $e) {
        echo '
<div class="alert alert-error">
    <h3>Sorry, but there is an Error:</h3>
    <p><br/>' . $e->getMessage() . '</p>
  </div>';
    }
}