Ejemplo n.º 1
0
        } else {
            if (file_exists($directory . '/framework/install_amp')) {
                freepbx::outn("Updating links through install_amp...");
                $pwd = getcwd();
                chdir($directory . '/framework');
                passthru('./install_amp --update-links');
                chdir($pwd);
                freepbx::out("Done");
            }
        }
    }
    exit(0);
}
if (!isset($options['setup']) && isset($options['switch']) && !empty($options['switch'])) {
    foreach (glob($directory . "/*", GLOB_ONLYDIR) as $dir) {
        freepbx::switchBranch($dir, $options['switch']);
    }
    exit(0);
}
if (isset($options['refresh'])) {
    foreach (glob($directory . "/*", GLOB_ONLYDIR) as $dir) {
        freepbx::refreshRepo($dir);
    }
    exit(0);
}
if (isset($options['addmergedriver'])) {
    foreach (glob($directory . "/*", GLOB_ONLYDIR) as $dir) {
        freepbx::outn("Attempting to open " . $dir . "...");
        //Attempt to open the module as a git repo, bail if it's not a repo
        try {
            $repo = Git::open($dir);