本文整理汇总了PHP中owa_coreAPI::profile方法的典型用法代码示例。如果您正苦于以下问题:PHP owa_coreAPI::profile方法的具体用法?PHP owa_coreAPI::profile怎么用?PHP owa_coreAPI::profile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类owa_coreAPI
的用法示例。
在下文中一共展示了owa_coreAPI::profile方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lookup
function lookup($user_agent)
{
if (owa_coreAPI::getSetting('base', 'cache_objects')) {
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$cache_obj = $this->cache->get('browscap', $this->ua);
}
if (!$cache_obj) {
$custom_db = owa_coreAPI::getSetting('base', 'ua-regexes');
if ($custom_db) {
$parser = new UAParser($custom_db);
} else {
$parser = new UAParser();
}
$cap = $parser->parse($this->ua);
} else {
$cap = $cache_obj;
}
if (!empty($cap)) {
if (owa_coreAPI::getSetting('base', 'cache_objects')) {
$family = $cap->ua->family;
if ($family != 'Default Browser') {
$this->cache->set('browscap', $this->ua, $cap, $this->cacheExpiration);
}
}
}
return $cap;
}
示例2: __destruct
function __destruct()
{
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
}
示例3: profileDisplay
public static function profileDisplay()
{
$p = owa_coreAPI::profile();
if ($p) {
$p->display();
}
}
示例4: query
/**
* Database Query
*
* @param string $sql
* @access public
*
*/
function query($sql)
{
//echo "Inside query <br/>";
$sql = str_replace("false", "0", $sql);
//for sql server test
$sql = str_replace("true", "1", $sql);
if ($this->connection_status == false) {
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$this->connect();
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
}
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$this->e->debug(sprintf('Query: %s', $sql));
$this->result = '';
$this->new_result = '';
if (!empty($this->new_result)) {
sqlsrv_free_stmt($this->new_result);
}
owa_coreAPI::profile($this, __FUNCTION__, __LINE__, $sql);
$result = @sqlsrv_query($this->connection, $sql);
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
// Log Errors only the first row
$errors = sqlsrv_errors();
if ($errors !== null) {
$this->e->notice(sprintf('A SQL error occured. Error: (%s) %s %s. Query: %s', $errors[0]['SQLSTATE'], $errors[0]['code'], htmlspecialchars($errors[0]['message']), $sql));
}
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$this->new_result = $result;
return $this->new_result;
}
示例5: query
/**
* Database Query
*
* @param string $sql
* @access public
*
*/
function query($sql)
{
if ($this->connection_status == false) {
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$this->connect();
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
}
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$this->e->debug(sprintf('Query: %s', $sql));
$this->result = '';
$this->new_result = '';
if (!empty($this->new_result)) {
mysql_free_result($this->new_result);
}
owa_coreAPI::profile($this, __FUNCTION__, __LINE__, $sql);
$result = @mysql_unbuffered_query($sql, $this->connection);
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
// Log Errors
if (mysql_errno($this->connection)) {
$this->e->debug(sprintf('A MySQL error occured. Error: (%s) %s. Query: %s', mysql_errno($this->connection), htmlspecialchars(mysql_error($this->connection)), $sql));
}
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$this->new_result = $result;
return $this->new_result;
}
示例6: lookup
function lookup($user_agent)
{
if (owa_coreAPI::getSetting('base', 'cache_objects') === true) {
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$cache_obj = $this->cache->get('browscap', $this->ua);
}
if (!empty($cache_obj)) {
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
return $cache_obj;
} else {
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
// Load browscap file into memory
$user_browscap_file = OWA_DATA_DIR . 'browscap/php_browscap.ini';
// check to see if a user downloaded version of the file exists
if (file_exists($user_browscap_file)) {
$this->browscap_db = $this->load($user_browscap_file);
} else {
$this->browscap_db = $this->load($this->config['browscap.ini']);
}
$cap = null;
foreach ($this->browscap_db as $key => $value) {
if ($key != '*' && !array_key_exists('Parent', $value)) {
continue;
}
$keyEreg = '^' . str_replace(array('\\', '.', '?', '*', '^', '$', '[', ']', '|', '(', ')', '+', '{', '}', '%'), array('\\\\', '\\.', '.', '.*', '\\^', '\\$', '\\[', '\\]', '\\|', '\\(', '\\)', '\\+', '\\{', '\\}', '\\%'), $key) . '$';
if (preg_match('%' . $keyEreg . '%i', $user_agent)) {
$cap = array('browser_name_regex' => strtolower($keyEreg), 'browser_name_pattern' => $key) + $value;
$maxDeep = 8;
while (array_key_exists('Parent', $value) && --$maxDeep > 0) {
$cap += $value = $this->browscap_db[$value['Parent']];
}
break;
}
}
if (!empty($cap)) {
if ($this->config['cache_objects'] == true) {
if ($cap['Browser'] != 'Default Browser') {
$this->cache->set('browscap', $this->ua, (object) $cap, $this->cacheExpiration);
}
}
}
return (object) $cap;
}
}
示例7: _insertQuery
function _insertQuery()
{
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$params = $this->_fetchSqlParams('set_values');
$count = count($params);
$i = 0;
$sql_cols = '';
$sql_values = '';
foreach ($params as $k => $v) {
$sql_cols .= $v['name'];
$sql_values .= "'" . $this->prepare($v['value']) . "'";
$i++;
// Add commas
if ($i < $count) {
$sql_cols .= ", ";
$sql_values .= ", ";
}
}
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$this->_setSql(sprintf(OWA_SQL_INSERT_ROW, $this->_sqlParams['table'], $sql_cols, $sql_values));
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$ret = $this->_query();
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
return $ret;
}