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


PHP Settings::query方法代碼示例

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


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

示例1: initView

 public function initView()
 {
     //init session
     $storage = new Zend_Auth_Storage_Session();
     $this->session = $storage->read();
     if ($this->session) {
         $this->_me = $this->session;
         $this->view->user = $this->_me;
     }
     $settingsModel = new Settings();
     $offset = date('Z') / 60 / 60;
     $settingsModel->query("SET time_zone = '{$offset}:00'");
     $this->view->currentRoute = Zend_Controller_Front::getInstance()->getRouter()->getCurrentRouteName();
     $siteSettingsModel = new SiteSettings();
     $this->view->siteSettings = $siteSettingsModel->getById(1);
     $this->init();
 }
開發者ID:tolya199178,項目名稱:swift,代碼行數:17,代碼來源:Action.php

示例2: makeRed

<?php

require 'clibootstrap.php';
$commands = array();
/** Include commands files - must be listed here to be used. **/
$actions = scandir('cliactions');
foreach ($actions as $file) {
    if ($file != '.' && $file != '..') {
        include 'cliactions/' . $file;
    }
}
//Run function or provide help
if (count($argv) > 1) {
    $settingsModel = new Settings();
    $offset = date('Z') / 60 / 60;
    $settingsModel->query("SET time_zone = '{$offset}:00'");
    $argv[1](@$argv[2]);
} else {
    echo "\n[1;33m==============================================\n==============================================\n   _____         _ ______  ________    ____\n  / ___/      __(_) __/ /_/ ____/ /   /  _/\n  \\__ \\ | /| / / / /_  __/ /   / /    / /  \n ___/ / |/ |/ / / __/ /_/ /___/ /____/ /   \n/____/|__/|__/_/_/  \\__/\\____/_____/___/   \n==============================================\n==============================================[0m                                                                                     \n                                                                           \nZend Framework Command Line Interface                                                                     \n   \n[1;30;32mCLI Command Line Interface for PHP [0m\nAuthor: Brandon Swift 2012\n\n\nTo run a command, type 'php cli.php [commandName]' then hit Enter\n\n\n\nAvailable Methods: \n";
    foreach ($commands as $command) {
        echo "[1;30;32m" . $command['command'] . "[0m - " . $command['description'] . "\n";
    }
    echo "\n\n";
}
function makeRed($text)
{
    echo "[31m{$text}[0m";
}
function makeGreen($text)
{
    echo "[32m{$text}[0m";
開發者ID:tolya199178,項目名稱:swift,代碼行數:31,代碼來源:cli.php

示例3: handleError

require_once dirname(__FILE__) . '/../../www/config.php';
function handleError($errno, $errstr, $errfile, $errline, array $errcontext)
{
    // error was suppressed with the @-operator
    if (0 === error_reporting()) {
        return false;
    }
    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler('handleError');
$regs = array("empty" => "", "illformed" => "[](9()))))))))) [34543/34]", "simple" => '"data.mp3');
$releases = new Releases();
$db = new Settings();
# fetch enabled regular expression
$catsql = "select ID,groupname,regex from releaseregex where status = 1";
$res = $db->query($catsql);
$total = count($res);
$errcnt = 0;
echo "\n";
foreach ($res as $regexrow) {
    foreach ($regs as $regex) {
        try {
            $res = preg_match($regexrow["regex"], $regex);
        } catch (Exception $e) {
            $errcnt++;
            $strerr = str_pad((int) $errcnt, 2, " ", STR_PAD_LEFT);
            echo "{$strerr}. id=" . $regexrow["id"] . ", group=" . $regexrow["groupname"] . "\n";
            echo "    regex='" . $regexrow["regex"] . "'\n";
            echo "    error=" . $e->getMessage() . "\n\n";
            break;
        }
開發者ID:engine9-,項目名稱:newznab-tmux,代碼行數:31,代碼來源:regexverify.php

示例4: dirname

<?php

require dirname(__FILE__) . "/../bin/config.php";
require_once WWW_DIR . "/lib/framework/db.php";
$db = new Settings();
$rel = $db->query("update releases set passwordstatus = -1 where rarinnerfilecount = 0");
開發者ID:RickDB,項目名稱:newznab-tmux,代碼行數:6,代碼來源:reset_rar_check.php


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