Example #1
0
#!/usr/bin/env php
<?php 
require_once 'libraries/freepbx.php';
$help = array();
$help[] = array('--directory', 'Directory Location of modules root, always assumed to be ../freepbx from this location');
$freepbx_conf = freepbx::getFreePBXConfig();
if (is_array($freepbx_conf) && !empty($freepbx_conf)) {
    foreach ($freepbx_conf as $key => $value) {
        if (isset($value) && $value != '') {
            $vars[$key] = $value;
        }
    }
}
$longopts = array("directory::");
$options = getopt("", $longopts);
$directory = !empty($options['directory']) ? $options['directory'] : $vars['repo_directory'];
if (!file_exists($directory)) {
    freepbx::out("Directories didn't exist! Aborting");
    exit(0);
}
$fwlangpacksReop = $directory . "/fw_langpacks";
if (!file_exists($fwlangpacksReop)) {
    freepbx::out("Language Packs didn't exist! Aborting");
    exit(0);
}
foreach (glob($directory . "/*", GLOB_ONLYDIR) as $moduleDir) {
    $module = basename($moduleDir);
    if ($module == 'fw_langpacks') {
        continue;
    }
    try {