Project

General

Profile

1 2 Manuela
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       Ryan Djurovich
9
 * @copyright       WebsiteBaker Org. e.V.
10
 * @link            http://websitebaker.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.3
13
 * @requirements    PHP 5.3.6 and higher
14
 * @version         $Id$
15
 * @filesource      $HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
19
20
/* -------------------------------------------------------- */
21
// Must include code to stop this file being accessed directly
22
if (defined('WB_PATH') == false) {
23
    die('Illegale file access /'.basename(__DIR__).'/'.basename(__FILE__).'');
24
} else {
25
/* -------------------------------------------------------- */
26
    if (!function_exists('insertDropletFile')) {require('droplets.functions.php');}
27
    $msg = array();
28
    // create tables from sql dump file
29
    if (is_readable(__DIR__.'/install-struct.sql')) {
30
        if (!$database->SqlImport(__DIR__.'/install-struct.sql', TABLE_PREFIX, true )){
31
            echo $msg[] = $database->get_error();
32
        } else {
33
        }
34
        if (is_writable(WB_PATH.'/temp/cache')) {
35
            Translate::getInstance()->clearCache();
36
        }
37
        $sBaseDir = realpath(dirname(__FILE__).'/example/');
38
        $sBaseDir    = rtrim(str_replace('\\', '/', $sBaseDir), '/').'/';
39
        $aDropletFiles = getDropletFromFiles($sBaseDir);
40
        $bOverwriteDroplets = false;
41
        insertDropletFile($aDropletFiles, $database, $admin,$msg,$bOverwriteDroplets);
42
    }
43
}