php error_reporting E_ALL st int microtime define win_include_path zf

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
error_reporting(E_ALL);
$st = (int)microtime(1);
define('win_include_path', ';e:/zf/zend_framework/library;../application/classes;../application/hessian;../application/shared;../application/Tests;c:/wamp/bin/php/php5.2.5/PEAR');
define('unix_include_path', ':/usr/share/zend/library:../application/classes:../application/hessian:../application/shared:../application/Tests');
(stripos(PHP_OS, 'win')!==false)?ini_set('include_path', ini_get('include_path').win_include_path):ini_set('include_path', ini_get('include_path').unix_include_path);
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
$config = new Zend_Config_Xml('../application/config.xml', 'recurred');
$_config = $config->toArray();
$db = Zend_Db::factory($_config['database']['driver'], $_config['database']['dsn']);
$db->setFetchMode(Zend_Db::FETCH_ASSOC);
(isset($_REQUEST['code']) && is_string($_REQUEST['code']) && $_REQUEST['code']!='')?$code = $_REQUEST['code']:die("FALSE");
$select = new Zend_Db_Select($db);
$select->from("sms", array("count"=>"count(*)"))
->where("code=? and (CAST(time AS DATE) + interval'1 month')>now()", $code);
$ret = $db->fetchOne($select->__toString());
if($ret>0)echo "TRUE";
else echo "FALSE";