本文整理汇总了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();
}
示例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";
示例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;
}
示例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");