예제 #1
0
        //TODO: check to make sure the author/committer isn't 'root'
        try {
            $repo->push("origin", "release/" . $mver);
        } catch (Exception $e) {
            freepbx::out($e->getMessage());
            freepbx::out("Module " . $module . " will not be pushed!");
            continue;
        }
        freepbx::out("Done");
        freepbx::outn("\tMaster is the same supported release as this branch. Merging this release into master...");
        if (!$vars['debug']) {
            $repo->checkout("master");
            $merged = $repo->pull("origin", "release/" . $mver);
            if (!$merged) {
                freepbx::out("\t\tMerge from release/" . $mver . " into master failed");
                freepbx::out("Module " . $module . " will not be tagged!");
                continue;
            }
            $repo->push("origin", "master");
            $repo->checkout("release/" . $mver);
        }
        freepbx::out("Done");
        freepbx::outn("\tChecking you back into " . $activeb . "...");
        $repo->checkout($activeb);
        freepbx::out("Done");
        break;
    default:
        freepbx::showHelp('update_language.php', $help);
        exit(0);
        break;
}
예제 #2
0
파일: merge.php 프로젝트: FreePBX/devtools
            freepbx::out("Done");
        }
        $organizationApi = $client->api('organization');
        $paginator = new Github\ResultPager($client);
        $parameters = array('freepbx');
        $repos = $paginator->fetchAll($organizationApi, 'repositories', $parameters);
        $core = array();
        foreach ($repos as $repo) {
            $core[] = $repo['name'];
        }
        $paginator = new Github\ResultPager($client);
        $parameters = array('FreePBX-ContributedModules');
        $repos = $paginator->fetchAll($organizationApi, 'repositories', $parameters);
        $contrib = array();
        foreach ($repos as $repo) {
            $contrib[] = $repo['name'];
        }
        if (in_array($rawname, $core)) {
            $org = "freepbx";
        } elseif (in_array($rawname, $contrib)) {
            $org = "FreePBX-ContributedModules";
        } else {
            exit;
        }
        $repo = $client->api('repo')->update($org, $rawname, array('name' => $rawname, 'description' => "Module of FreePBX (" . trim($name) . ") :: " . trim(strip_tags(str_replace(array("\r", "\n"), '', $description))), 'default_branch' => 'release/13.0', 'homepage' => 'http://www.freepbx.org', "has_issues" => false, "has_wiki" => false, "had_downloads" => false));
        break;
    default:
        freepbx::showHelp('merge.php', $help);
        exit(0);
        break;
}
예제 #3
0
if (isset($vars['c']) && $vars['interactive']) {
    $vars['username'] = freepbx::getInput('Username');
    if (empty($vars['username'])) {
        freepbx::out("Invalid Username");
        exit(1);
    }
    $vars['password'] = freepbx::getPassword('Password');
    if (empty($vars['password'])) {
        efreepbx::out("Invalid Password");
        exit(1);
    }
}
//ensure we have modules to package
if (empty($modules)) {
    freepbx::out("No modules specified. Please specify at least one module");
    freepbx::showHelp('Package.php', $help);
    exit(1);
}
//get current working directory
$cwd = getcwd();
if (!file_exists($vars['directory'])) {
    freepbx::out("Directory Location: " . $vars['directory'] . " does not exist!");
    exit(1);
}
freepbx::out("Using " . $vars['directory']);
chdir($vars['directory']);
update_devtools();
foreach ($modules as $module) {
    $file_scan_exclude_list = $module == 'framework' ? array("modules", "Symfony", "Composer") : array();
    freepbx::out("Processing " . $module . "...");
    $mod_dir = $vars['directory'] . '/' . $module;
예제 #4
0
        $username = freepbx::getInput("FreePBX Username");
    } else {
        $username = $vars['username'];
    }
    if (empty($vars['password'])) {
        $password = freepbx::getPassword("FreePBX Password", true);
    } else {
        $password = $vars['password'];
    }
    try {
        $freepbx = new freepbx($username, $password);
    } catch (Exception $e) {
        freepbx::out("Invalid Username/Password Combination");
        exit(1);
    }
    if (isset($options['keys'])) {
        $pkeys = explode(",", $options['keys']);
    } else {
        $pkeys = array("freepbx");
    }
    $force = isset($options['force']) ? true : false;
    $branch = isset($options['switch']) && !empty($options['switch']) ? $options['switch'] : 'develop';
    foreach ($pkeys as $k) {
        $freepbx->setupDevRepos($directory, $force, $mode, $branch, $k);
    }
    $freepbx->setupSymLinks($directory);
    exit(0);
}
freepbx::out("Invalid Command");
freepbx::showHelp('freepbx_git.php', $help);
exit;
예제 #5
0
 * options:
 *      run with --help for options
 *
 */
require_once 'libraries/freepbx.php';
//get cli opts
$longopts = array('directory::', 'help::', 'module::');
$vars = getopt('d:h::m:', $longopts);
$helpArray = array(array('--help', 'Show this menu and exit'), array('--module', 'Module to be packaged. You can use one module per --module argument (for multiples)'), array('--directory', 'Directory Location of modules root, always assumed to be ../freepbx from this location'));
//if help was requested, show help and exit
if (isset($vars['h'])) {
    freepbx::out(freepbx::showHelp(basename(__FILE__), $helpArray, true));
    exit(0);
}
if (isset($vars['help'])) {
    freepbx::out(freepbx::showHelp(basename(__FILE__), $helpArray));
    exit(0);
}
//setup some other settings
$vars['directory'] = !empty($vars['directory']) ? $vars['directory'] : dirname(dirname(__FILE__)) . '/freepbx';
//Combine shortopt -m with longopt --module
$vars['m'] = isset($vars['m']) ? is_array($vars['m']) ? $vars['m'] : array($vars['m']) : array();
$vars['module'] = isset($vars['module']) ? is_array($vars['module']) ? $vars['module'] : array($vars['module']) : array();
$modules = array_merge($vars['m'], $vars['module']);
//if no modules are set, grab all of them
if (isset($modules) && empty($modules)) {
    $allmods = glob($vars['directory'] . '/*', GLOB_ONLYDIR);
    foreach ($allmods as $mod) {
        $modules[] = str_replace($vars['directory'] . '/', '', $mod);
    }
}