Esempio n. 1
0
 public function executeInstall()
 {
     $pf = $this->package->getPlatform();
     $ua = mfwRequest::userAgent();
     if ($pf === Package::PF_IOS && $ua->isIOS()) {
         // itms-service での接続はセッションを引き継げない
         // 一時トークンをURLパラメータに付けることで認証する
         $scheme = Config::get('enable_https') ? 'https' : null;
         // HTTPSが使えるならHTTPS優先
         $plist_url = mfwHttp::composeUrl(mfwRequest::makeUrl('/package/install_plist', $scheme), array('id' => $this->package->getId(), 't' => $this->makeToken()));
         $url = 'itms-services://?action=download-manifest&url=' . urlencode($plist_url);
     } else {
         // iPhone以外でのアクセスはパッケージを直接DL
         $url = $this->package->getFileUrl('+60 min');
     }
     $con = mfwDBConnection::getPDO();
     $con->beginTransaction();
     try {
         InstallLog::Logging($this->login_user, $this->package, $ua, $con);
         $con->commit();
     } catch (Exception $e) {
         $con->rollback();
         error_log(__METHOD__ . '(' . __LINE__ . '): ' . get_class($e) . ":{$e->getMessage()}");
         throw $e;
     }
     apache_log('app_id', $this->app->getId());
     apache_log('pkg_id', $this->package->getId());
     apache_log('platform', $this->package->getPlatform());
     return $this->redirect($url);
 }
Esempio n. 2
0
 protected function redirect($query, $params = array())
 {
     $query = mfwHttp::composeUrl($query, $params);
     if (strpos($query, 'http') !== 0) {
         $query = mfwRequest::makeUrl($query);
     }
     $headers = array("Location: {$query}");
     return array($headers, null);
 }
Esempio n. 3
0
 protected static function getApi($url, $params = array())
 {
     $token = self::accessToken();
     if ($token) {
         $params['access_token'] = $token;
     }
     $ret = mfwHttp::get(mfwHttp::composeURL($url, $params));
     return json_decode($ret, true);
 }
Esempio n. 4
0
 protected function getUserInfo($token)
 {
     if (!isset($token['access_token'])) {
         return null;
     }
     $url = 'https://www.googleapis.com/oauth2/v1/userinfo';
     $header = array("Authorization: {$token['token_type']} {$token['access_token']}");
     $response = mfwHttp::get($url, $header);
     return json_decode($response, true);
 }
Esempio n. 5
0
<?php 
} else {
    ?>
      <li class="previous"><a href="<?php 
    echo mfwHttp::composeURL(mfwRequest::url(), array('page' => $current_page - 1));
    ?>
">Previous</a></li>
<?php 
}
?>

<?php 
if ($has_next_page) {
    ?>
      <li class="next"><a href="<?php 
    echo mfwHttp::composeURL(mfwRequest::url(), array('page' => $current_page + 1));
    ?>
">Next</a></li>
<?php 
} else {
    ?>
      <li class="next disabled"><span>Next</span></li>
<?php 
}
?>
    </ul>

  </div>
</div>

<div class="visible-xs">
Esempio n. 6
0
</a></li>
	<?php 
    }
}
if ($end < $max_page - 1) {
    ?>
	<li class="disabled omission">
		<span>..</span>
	</li>
<?php 
}
if ($end != $max_page) {
    ?>
	<li<?php 
    echo $cur_page == $max_page ? ' class="active"' : '';
    ?>
>
		<a href="<?php 
    echo mfwHttp::composeUrl($urlbase, array('page' => $max_page));
    ?>
"><?php 
    echo $max_page;
    ?>
</a>
	</li>
<?php 
}
?>
</ul>

Esempio n. 7
0
 * pull requestの中身を精査
 */
$alterts = array();
$alerted_pulls = array();
foreach ($pulllists as $repo_id => $pulls) {
    $repo = $repos[$repo_id];
    echo "repository: {$repo->getName()}\n";
    // number昇順
    usort($pulls, function ($a, $b) {
        return $a['number'] - $b['number'];
    });
    foreach ($pulls as $num => $p) {
        echo " {$p['number']} {$p['user']['login']}: {$p['title']}\n";
        $url = "https://api.github.com/repos/{$owner}/{$repo->getName()}/pulls/{$p['number']}/files";
        $params = array('access_token' => $token);
        $files = mfwHttp::get(mfwHttp::composeURL($url, $params));
        $files = json_decode($files, true);
        foreach ($pullfilters as $filter) {
            if ($filter->test($p)) {
                echo "      match pull filter:{$filter->getId()}\n";
                $alerts[$repo->getId()][] = array('filter_id' => $filter->getId(), 'repo_id' => $repo->getId(), 'number' => $p['number']);
                $alerted_pulls[$repo->getId()][$p['number']] = $p;
            }
        }
        foreach ($files as $file) {
            foreach ($filefilters as $filter) {
                if ($filter->test($file)) {
                    echo "      match file filter:{$filter->getId()}\n";
                    $alerts[$repo->getId()][] = array('filter_id' => $filter->getId(), 'repo_id' => $repo->getId(), 'number' => $p['number'], 'filename' => $file['filename']);
                    $alerted_pulls[$repo->getId()][$p['number']] = $p;
                }
Esempio n. 8
0
    $url = mfwHttp::composeUrl($baseurl, array($paramname => 1));
    echo "<a href=\"{$url}\">1</a>\n...\n";
    for ($i = $page - 2; $i < $page; ++$i) {
        $url = mfwHttp::composeUrl($baseurl, array($paramname => $i));
        echo "<a href=\"{$url}\">{$i}</a>\n";
    }
    echo "{$page}\n";
    for ($i = $page + 1; $i <= $page + 2; ++$i) {
        $url = mfwHttp::composeUrl($baseurl, array($paramname => $i));
        echo "<a href=\"{$url}\">{$i}</a>\n";
    }
    $url = mfwHttp::composeUrl($baseurl, array($paramname => $page_max));
    echo "...\n<a href=\"{$url}\">{$page_max}</a>\n";
}
if ($page < $page_max) {
    $url = mfwHttp::composeUrl($baseurl, array($paramname => $page + 1));
    echo "<a class=\"next\" href=\"{$url}\">Next</a>\n";
} else {
    echo "<span class=\"next\">Next</span>\n";
}
?>
<form action="<?php 
echo $baseurl;
?>
" method="get">
page: <input type="text" size="3" name="<?php 
echo $paramname;
?>
" value="<?php 
echo $page;
?>