本文整理汇总了PHP中Workflow::requestCache方法的典型用法代码示例。如果您正苦于以下问题:PHP Workflow::requestCache方法的具体用法?PHP Workflow::requestCache怎么用?PHP Workflow::requestCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Workflow
的用法示例。
在下文中一共展示了Workflow::requestCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
} else {
echo 'Login failed';
}
break;
case 'logout':
Workflow::request('https://github.com/logout', $status, $etag, true, array('authenticity_token' => Workflow::getToken()));
Workflow::deleteCookies();
Workflow::deleteCache();
echo 'Successfully logged out';
break;
case 'delete-cache':
Workflow::deleteCache();
echo 'Successfully deleted cache';
break;
case 'refresh-cache':
Workflow::requestCache($parts[2], 0, false);
break;
case 'activate-autoupdate':
Workflow::setConfig('autoupdate', 1);
echo 'Activated auto updating';
break;
case 'deactivate-autoupdate':
Workflow::setConfig('autoupdate', 0);
echo 'Deactivated auto updating';
break;
case 'update':
$c = Workflow::request('http://gh01.de/alfred/github/github.alfredworkflow', $status);
if ($status != 200) {
echo 'Update failed';
exit;
}
示例2: exec
exec('open ' . escapeshellarg($url));
}
break;
case 'logout':
Workflow::removeAccessToken();
Workflow::deleteCache();
echo 'Successfully logged out';
break;
case 'delete-cache':
Workflow::deleteCache();
echo 'Successfully deleted cache';
break;
case 'refresh-cache':
$curl = new Curl();
foreach (explode(',', $parts[2]) as $url) {
Workflow::requestCache($url, $curl, null, 0, false);
}
$curl->execute();
Workflow::cleanCache();
break;
case 'activate-autoupdate':
Workflow::setConfig('autoupdate', 1);
echo 'Activated auto updating';
break;
case 'deactivate-autoupdate':
Workflow::setConfig('autoupdate', 0);
echo 'Deactivated auto updating';
break;
case 'update':
$response = Workflow::request('http://gh01.de/alfred/github/github.alfredworkflow');
if (!$response) {
示例3: ltrim
<?php
require 'workflow.php';
$query = ltrim($argv[1]);
$parts = explode(' ', $query);
Workflow::init($query);
if (Workflow::checkUpdate()) {
$cmds = array('update' => 'There is an update for this Alfred workflow', 'deactivate autoupdate' => 'Deactivate auto updating this Alfred Workflow');
foreach ($cmds as $cmd => $desc) {
Workflow::addItem(Item::create()->prefix('gh ')->title('> ' . $cmd)->subtitle($desc)->arg('> ' . str_replace(' ', '-', $cmd))->randomUid(), false);
}
print Workflow::getItemsAsXml();
exit;
}
if (!Workflow::getConfig('user') || !($users = Workflow::requestCacheJson('https://github.com/command_bar/users', 'results')) && !Workflow::requestCache('https://github.com/settings/profile')) {
Workflow::removeConfig('user');
$user = null;
if (count($parts) > 1 && $parts[0] == '>' && $parts[1] == 'login' && isset($parts[2])) {
$user = $parts[2];
}
Workflow::addItem(Item::create()->prefix('gh ')->title('> login ' . $user)->subtitle('Log in to GitHub')->arg('> login ' . $user)->valid((bool) $user, '<user>'));
print Workflow::getItemsAsXml();
return;
}
$isSystem = isset($query[0]) && $query[0] == '>';
$isMy = 'my' == $parts[0] && isset($parts[1]);
$isUser = isset($query[0]) && $query[0] == '@';
$isRepo = false;
$queryUser = null;
if ($isUser) {
$queryUser = ltrim($parts[0], '@');