Ejemplo n.º 1
0
function load_extensions($path, $recurse)
{
    $d = dir($path);
    while (false !== ($entry = $d->read())) {
        if ($entry == '.' || $entry == '..') {
            continue;
        }
        $f = $path . DIRECTORY_SEPARATOR . $entry;
        if ($recurse && is_dir($f)) {
            load_extensions($f, false);
        }
        if ((is_file($f) || is_link($f)) && preg_match('/\\.ext\\.php$/i', $entry)) {
            include $f;
            debug("Loaded extension: {$f}");
        }
    }
    $d->close();
}
Ejemplo n.º 2
0
                    $_SESSION['user']['extension'][$x]['outbound_caller_id_number'] = $row['outbound_caller_id_number'];
                    if ($row['voicemail_uuid'] != '') {
                        $_SESSION['user']['voicemail'][]['voicemail_uuid'] = $row['voicemail_uuid'];
                    }
                    $_SESSION['user_context'] = $row["user_context"];
                    $x++;
                }
            }
            //if no extension has been assigned then setting the user_context will still need to be set
            if (strlen($_SESSION['user_context']) == 0) {
                $_SESSION['user_context'] = $_SESSION['domain_name'];
            }
        }
    }
}
load_extensions();
function event_socket_create($host, $port, $password)
{
    $esl = new EventSocket();
    if ($esl->connect($host, $port, $password)) {
        return $esl->reset_fp();
    }
    return false;
}
function event_socket_request($fp, $cmd)
{
    $esl = new EventSocket($fp);
    $result = $esl->request($cmd);
    $esl->reset_fp();
    return $result;
}
Ejemplo n.º 3
0
/**
 * Initialize miniWiki infrastructure.
 * <p>
 * Will load and initialize extensions.
 */
function miniwiki_boot($install_mode = false)
{
    set_default_config('install_mode', $install_mode);
    register_shutdown_function('miniwiki_shutdown');
    load_extensions(realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ext"), true);
    initialize_extensions();
}