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


PHP owa_coreAPI::profile方法代码示例

本文整理汇总了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;
 }
开发者ID:ashutoshdev,项目名称:Open-Web-Analytics,代码行数:27,代码来源:browscap.php

示例2: __destruct

 function __destruct()
 {
     owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
 }
开发者ID:ashutoshdev,项目名称:Open-Web-Analytics,代码行数:4,代码来源:service.php

示例3: profileDisplay

 public static function profileDisplay()
 {
     $p = owa_coreAPI::profile();
     if ($p) {
         $p->display();
     }
 }
开发者ID:ashutoshdev,项目名称:Open-Web-Analytics,代码行数:7,代码来源:owa_coreAPI.php

示例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;
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:37,代码来源:owa_db_sqlserver.php

示例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;
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:32,代码来源:owa_db_mysql.php

示例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;
     }
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:44,代码来源:browscap.php

示例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;
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:25,代码来源:owa_db.php


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