本文整理汇总了PHP中Workflow::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Workflow::getConfig方法的具体用法?PHP Workflow::getConfig怎么用?PHP Workflow::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Workflow
的用法示例。
在下文中一共展示了Workflow::getConfig方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addHandle
private function addHandle(CurlRequest $request)
{
$defaultOptions = array(CURLOPT_HEADER => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_USERAGENT => 'alfred-github-workflow', CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 5, CURLINFO_HEADER_OUT => true);
if ($this->debug) {
$defaultOptions[CURLOPT_PROXY] = 'localhost';
$defaultOptions[CURLOPT_PROXYPORT] = 8888;
$defaultOptions[CURLOPT_SSL_VERIFYPEER] = 0;
}
$ch = curl_init();
$options = $defaultOptions;
$options[CURLOPT_URL] = $request->url;
$header = array();
$header[] = 'X-Url: ' . $request->url;
$header[] = 'Authorization: token ' . Workflow::getConfig('access_token');
if ($request->etag) {
$header[] = 'If-None-Match: ' . $request->etag;
}
$options[CURLOPT_HTTPHEADER] = $header;
curl_setopt_array($ch, $options);
curl_multi_add_handle(self::$multiHandle, $ch);
}
示例2: addSystemCommands
private static function addSystemCommands()
{
$cmds = array('delete cache' => 'Delete GitHub Cache', 'logout' => 'Log out this workflow', 'update' => 'Update this Alfred workflow');
if (Workflow::getConfig('autoupdate', true)) {
$cmds['deactivate autoupdate'] = 'Deactivate auto updating this Alfred Workflow';
} else {
$cmds['activate autoupdate'] = 'Activate auto updating this Alfred Workflow';
}
foreach ($cmds as $cmd => $desc) {
Workflow::addItem(Item::create()->prefix('gh ')->title('> ' . $cmd)->subtitle($desc)->icon($cmd)->arg('> ' . str_replace(' ', '-', $cmd)));
}
}
示例3: addSystemCommands
private static function addSystemCommands()
{
$cmds = array('delete cache' => 'Delete GitHub Cache', 'logout' => 'Log out this workflow', 'update' => 'Update this Alfred workflow');
if (Workflow::getConfig('autoupdate', true)) {
$cmds['deactivate autoupdate'] = 'Deactivate auto updating this Alfred Workflow';
} else {
$cmds['activate autoupdate'] = 'Activate auto updating this Alfred Workflow';
}
if (self::$enterprise) {
$cmds['enterprise reset'] = 'Reset the GitHub Enterprise URL';
}
foreach ($cmds as $cmd => $desc) {
Workflow::addItem(Item::create()->title('> ' . $cmd)->subtitle($desc)->icon($cmd)->arg('> ' . str_replace(' ', '-', $cmd)));
}
$cmds = array('help' => 'readme', 'changelog' => 'changelog');
foreach ($cmds as $cmd => $file) {
Workflow::addItem(Item::create()->title('> ' . $cmd)->subtitle('View the ' . $file)->icon('file')->arg('https://github.com/gharlan/alfred-github-workflow/blob/master/' . strtoupper($file) . '.md'));
}
}
示例4: foreach
}
foreach ($users as $user) {
$name = substr($user->command, 1);
Workflow::addItem(Item::create()->prefix('@', false)->title($name . ' ')->subtitle($user->description)->arg('https://github.com/' . $name)->prio(20 + (isset($user->multiplier) ? $user->multiplier : 1)));
}
}
Workflow::addItem(Item::create()->title('my ')->subtitle('Dashboard, settings, and more')->prio(10)->valid(false));
} else {
$myPages = array('dashboard' => array('', 'View your dashboard'), 'pulls' => array('dashboard/pulls', 'View your pull requests'), 'issues' => array('dashboard/issues', 'View your issues'), 'stars' => array('stars', 'View your starred repositories'), 'profile' => array(Workflow::getConfig('user'), 'View your public user profile'), 'settings' => array('settings', 'View or edit your account settings'), 'notifications' => array('notifications', 'View all your notifications'));
foreach ($myPages as $key => $my) {
Workflow::addItem(Item::create()->title('my ' . $key)->subtitle($my[1])->arg('https://github.com/' . $my[0])->prio(1));
}
}
Workflow::sortItems();
if ($query) {
$path = $isUser ? $queryUser : 'search?q=' . urlencode($query);
Workflow::addItem(Item::create()->title("Search GitHub for '{$query}'")->arg('https://github.com/' . $path)->autocomplete(false), false);
}
} else {
$cmds = array('logout' => 'Log out from GitHub (only this Alfred Workflow)', 'delete cache' => 'Delete GitHub Cache (only for this Alfred Workflow)', 'update' => 'Update this Alfred workflow');
if (Workflow::getConfig('autoupdate', true)) {
$cmds['deactivate autoupdate'] = 'Deactivate auto updating this Alfred Workflow';
} else {
$cmds['activate autoupdate'] = 'Activate auto updating this Alfred Workflow';
}
foreach ($cmds as $cmd => $desc) {
Workflow::addItem(Item::create()->prefix('gh ')->title('> ' . $cmd)->subtitle($desc)->arg('> ' . str_replace(' ', '-', $cmd)));
}
Workflow::sortItems();
}
print Workflow::getItemsAsXml();