当前位置: 首页>>代码示例>>PHP>>正文


PHP Workflow::query方法代码示例

本文整理汇总了PHP中Workflow::query方法的典型用法代码示例。如果您正苦于以下问题:PHP Workflow::query方法的具体用法?PHP Workflow::query怎么用?PHP Workflow::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Workflow的用法示例。


在下文中一共展示了Workflow::query方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public static function init($enterprise = false, $query = null)
 {
     date_default_timezone_set('UTC');
     self::$enterprise = $enterprise;
     self::$query = $query;
     if (isset($_ENV['alfred_workflow_data'])) {
         $dataDir = $_ENV['alfred_workflow_data'];
     } else {
         $dataDir = (isset($_ENV['HOME']) ? $_ENV['HOME'] : $_SERVER['HOME']) . '/Library/Application Support/Alfred 2/Workflow Data/' . self::BUNDLE;
         $_ENV['alfred_workflow_data'] = $dataDir;
     }
     if (!is_dir($dataDir)) {
         mkdir($dataDir);
     }
     self::$filePids = $dataDir . '/pid';
     $fileDb = $dataDir . '/db.sqlite';
     $exists = file_exists($fileDb);
     self::$db = new PDO('sqlite:' . $fileDb, null, null);
     if (!$exists) {
         self::$db->exec('
             CREATE TABLE config (
                 key TEXT PRIMARY KEY,
                 value TEXT
             )
         ');
         self::createRequestCacheTable();
     }
     if (self::$enterprise) {
         self::$baseUrl = self::getConfig('enterprise_url');
         self::$apiUrl = self::$baseUrl ? self::$baseUrl . '/api/v3' : null;
         self::$gistUrl = self::$baseUrl ? self::$baseUrl . '/gist' : null;
     }
     register_shutdown_function(array(__CLASS__, 'shutdown'));
 }
开发者ID:njql007,项目名称:alfred-github-workflow,代码行数:34,代码来源:workflow.php

示例2: init

 public static function init($enterprise = false, $query = null, $hotkey = false)
 {
     date_default_timezone_set('UTC');
     self::$enterprise = $enterprise;
     self::$query = ltrim($query);
     self::$hotkey = $hotkey;
     $dataDir = getenv('alfred_workflow_data');
     if (!$dataDir) {
         $dataDir = getenv('HOME') . '/Library/Application Support/Alfred 3/Workflow Data/' . self::BUNDLE;
         putenv('alfred_workflow_data="' . $dataDir . '"');
     }
     if (!is_dir($dataDir)) {
         mkdir($dataDir);
     }
     self::$filePids = $dataDir . '/pid';
     $fileDb = $dataDir . '/db.sqlite';
     $exists = file_exists($fileDb);
     self::$db = new PDO('sqlite:' . $fileDb, null, null);
     if (!$exists) {
         self::$db->exec('
             CREATE TABLE config (
                 key TEXT PRIMARY KEY,
                 value TEXT
             )
         ');
         self::createRequestCacheTable();
     }
     if (self::$enterprise) {
         self::$baseUrl = self::getConfig('enterprise_url');
         self::$apiUrl = self::$baseUrl ? self::$baseUrl . '/api/v3' : null;
         self::$gistUrl = self::$baseUrl ? self::$baseUrl . '/gist' : null;
     }
     self::$debug = getenv('alfred_debug') && defined('STDERR');
     register_shutdown_function(array(__CLASS__, 'shutdown'));
 }
开发者ID:jessefurmanek,项目名称:dotfiles,代码行数:35,代码来源:workflow.php

示例3: init

 public static function init($query = null)
 {
     self::$query = $query;
     $dataDir = $_SERVER['HOME'] . '/Library/Application Support/Alfred 2/Workflow Data/' . self::BUNDLE;
     if (!is_dir($dataDir)) {
         mkdir($dataDir);
     }
     self::$fileCookies = $dataDir . '/cookies';
     $fileDb = $dataDir . '/db.sqlite';
     $exists = file_exists($fileDb);
     self::$db = new PDO('sqlite:' . $fileDb, null, null, array(PDO::ATTR_PERSISTENT => true));
     if (!$exists) {
         self::$db->exec('
             CREATE TABLE config (
                 key TEXT PRIMARY KEY,
                 value TEXT
             )
         ');
         self::$db->exec('
             CREATE TABLE request_cache (
                 url TEXT PRIMARY KEY,
                 timestamp INTEGER,
                 etag TEXT,
                 content TEXT,
                 refresh INTEGER
             )
         ');
     }
     register_shutdown_function(array(__CLASS__, 'shutdown'));
 }
开发者ID:jesseflorig,项目名称:config,代码行数:30,代码来源:workflow.php

示例4: init

 public static function init($query = null)
 {
     self::$query = $query;
     $dataDir = $_SERVER['HOME'] . '/Library/Application Support/Alfred 2/Workflow Data/' . self::BUNDLE;
     $cacheDir = $_SERVER['HOME'] . '/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/' . self::BUNDLE;
     if (!is_dir($dataDir)) {
         mkdir($dataDir);
     }
     if (!is_dir($cacheDir)) {
         mkdir($cacheDir);
     }
     self::$fileCookies = $dataDir . '/cookies';
     self::$fileConfig = $dataDir . '/config.json';
     self::$fileCache = $cacheDir . '/cache.json';
     register_shutdown_function(array(__CLASS__, 'shutdown'));
     if (file_exists(self::$fileConfig)) {
         self::$config = json_decode(file_get_contents(self::$fileConfig), true);
     }
     if (file_exists(self::$fileCache)) {
         self::$cache = json_decode(file_get_contents(self::$fileCache), true);
     }
 }
开发者ID:Frinstio,项目名称:AlfredWorkflow.com,代码行数:22,代码来源:workflow.php


注:本文中的Workflow::query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。