Пример #1
0
<?php

require_once __DIR__ . '/../initialize.php';
require_once APP_ROOT . '/mainmodules/MainModules.php';
try {
    mfwServerEnv::setEnv($_SERVER['MFW_ENV']);
    list($headers, $content) = MainModules::execute();
    foreach ($headers as $h) {
        header($h);
    }
    echo $content;
} catch (Exception $e) {
    header(mfwActions::HTTP_500_INTERNALSERVERERROR);
    echo "<h1>500 Internal Server Error</h1>\n";
    echo $e->getMessage();
}
Пример #2
0
<?php

require_once dirname(__FILE__) . '/../mfw/initialize.php';
require_once APP_ROOT . '/core/vendor/optionparse.php';
require_once APP_ROOT . '/model/Repository.php';
require_once APP_ROOT . '/model/Filter.php';
require_once APP_ROOT . '/model/PullRequest.php';
require_once APP_ROOT . '/model/PullRequestAlert.php';
mfwServerEnv::setEnv('metahub_vm');
$owner = trim(file_get_contents(APP_ROOT . '/../apiauth/github_project_owner'));
// oauth2 access token.
$token = trim(file_get_contents(dirname(__FILE__) . '/../apiauth/github_accesstoken'));
$parser = new Optionparse(array('description' => 'scan pullrequests', 'arguments' => '[repository ...]'));
$parser->addOption('help', array('short_name' => '-h', 'long_name' => '--help', 'description' => 'show this help message'));
$options = $parser->parse();
if ($options['help']) {
    $parser->displayUsage();
    exit(0);
}
/*----------------------------------------------------------------------------
 * repository一覧
 */
if (!empty($options['_arguments_'])) {
    $repolist = RepositoryDb::selectSetByNames($options['_arguments_']);
} else {
    $repolist = RepositoryDb::selectAll();
}
if (empty($repolist)) {
    echo "no repository\n";
    exit(-1);
}