當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Workflow::setConfig方法代碼示例

本文整理匯總了PHP中Workflow::setConfig方法的典型用法代碼示例。如果您正苦於以下問題:PHP Workflow::setConfig方法的具體用法?PHP Workflow::setConfig怎麽用?PHP Workflow::setConfig使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Workflow的用法示例。


在下文中一共展示了Workflow::setConfig方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Curl

     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) {
         echo 'Update failed';
         exit;
     }
     $zip = __DIR__ . '/workflow.zip';
     file_put_contents($zip, $response);
     exec('unzip -o workflow.zip');
     unlink($zip);
     Workflow::deleteCache();
     echo 'Successfully updated the GitHub Workflow';
     break;
開發者ID:njql007,項目名稱:alfred-github-workflow,代碼行數:31,代碼來源:action.php

示例2:

<?php

if (preg_match('/\\.(?:png|jpg|jpeg|gif)$/', $_SERVER['REQUEST_URI'])) {
    return false;
}
require 'workflow.php';
Workflow::init();
if (!isset($_GET['access_token'])) {
    echo 'FAILURE (missing access_token parameter)!';
    exit;
}
Workflow::setConfig('access_token', $_GET['access_token']);
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>alfred-github-workflow</title>
        <style>
            * {
                margin: 0;
                padding: 0;
            }
            body {
                background: #999;
                font-family: 'Helvetica Neue', sans-serif;
                font-size: 14pt;
            }
            div {
                padding-top: 200px;
                width: 450px;
開發者ID:regedor,項目名稱:alfred-github-workflow,代碼行數:31,代碼來源:server.php

示例3: PharData

     break;
 case 'logout':
     Workflow::deleteCookies();
     Workflow::deleteCache();
     echo 'Successfully logged out';
     break;
 case 'delete-cache':
     Workflow::deleteCache();
     echo 'Successfully deleted cache';
     break;
 case 'activate-autoupdate':
     Workflow::setConfig('autoupdate', true);
     echo 'Activated auto updating';
     break;
 case 'deactivate-autoupdate':
     Workflow::setConfig('autoupdate', false);
     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;
     }
     $zip = __DIR__ . '/workflow.zip';
     file_put_contents($zip, $c);
     $phar = new PharData($zip);
     foreach ($phar as $path => $file) {
         copy($path, __DIR__ . '/' . $file->getFilename());
     }
     unlink($zip);
開發者ID:RStankov,項目名稱:config_files,代碼行數:31,代碼來源:action.php


注:本文中的Workflow::setConfig方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。