Example #1
0
/**
 * this method may be called by modules to handle a droplet import
 *
 * moved to CAT_Helper_Droplet, which ignores the $temp_unzip param; it is only
 * left for backward compatibility
 *
 **/
function droplets_import($temp_file, $temp_unzip = NULL)
{
    return CAT_Helper_Droplet::installDroplet($temp_file);
}
Example #2
0
 *   @license         http://www.gnu.org/licenses/gpl.html
 *   @category        CAT_Modules
 *   @package         lib_search
 *
 */
if (defined('CAT_PATH')) {
    include CAT_PATH . '/framework/class.secure.php';
} else {
    $root = "../";
    $level = 1;
    while ($level < 10 && !file_exists($root . '/framework/class.secure.php')) {
        $root .= "../";
        $level += 1;
    }
    if (file_exists($root . '/framework/class.secure.php')) {
        include $root . '/framework/class.secure.php';
    } else {
        trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
    }
}
// import droplets
$inst_dir = CAT_Helper_Directory::sanitizePath(dirname(__FILE__) . '/install');
$temp_unzip = CAT_Helper_Directory::sanitizePath(CAT_PATH . '/temp/unzip/');
$dirh = CAT_Helper_Directory::getInstance();
$files = $dirh->getFiles($inst_dir);
if (is_array($files) && count($files)) {
    foreach ($files as $file) {
        // ignore the result here
        CAT_Helper_Droplet::installDroplet($file, $temp_unzip);
    }
}