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


PHP Ak::trace方法代码示例

本文整理汇总了PHP中Ak::trace方法的典型用法代码示例。如果您正苦于以下问题:PHP Ak::trace方法的具体用法?PHP Ak::trace怎么用?PHP Ak::trace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ak的用法示例。


在下文中一共展示了Ak::trace方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _run_from_file

 function _run_from_file($file_name, $all_in_one_test = true)
 {
     $multiple_expected_php = $multiple_sintags = '';
     $tests = explode('===================================', file_get_contents(AK_TEST_DIR . DS . 'fixtures' . DS . 'data' . DS . $file_name));
     foreach ($tests as $test) {
         list($sintags, $php) = explode('-----------------------------------', $test);
         $sintags = trim($sintags);
         $expected_php = trim($php);
         if (empty($sintags)) {
             break;
         } else {
             $multiple_sintags .= $sintags;
             $multiple_expected_php .= $expected_php;
         }
         $AkSintags =& new AkSintagsParser();
         $php = $AkSintags->parse($sintags);
         if ($php != $expected_php) {
             Ak::trace("GENERATED: \n" . $php);
             Ak::trace("EXPECTED: \n" . $expected_php);
             Ak::trace("SINTAGS: \n" . $sintags);
         }
         $this->assertEqual($php, $expected_php);
     }
     if ($all_in_one_test) {
         $AkSintags =& new AkSintagsParser();
         $php = $AkSintags->parse($multiple_sintags);
         if ($php != $multiple_expected_php) {
             Ak::trace("GENERATED: \n" . $php);
             Ak::trace("EXPECTED: \n" . $expected_php);
             Ak::trace("SINTAGS: \n" . $sintags);
         }
         $this->assertEqual($php, $multiple_expected_php);
     }
 }
开发者ID:joeymetal,项目名称:v1,代码行数:34,代码来源:AkSintags.php

示例2: log_memory

 function log_memory($reset = false, $vervose = false)
 {
     ($reset || empty($this->initial)) && ($this->initial = memory_get_usage());
     $this->current = memory_get_usage();
     $this->difference = $this->current - $this->initial;
     $this->difference && $vervose && Ak::trace($this->difference / 1048576 . ' MB increased');
     return $this->difference;
 }
开发者ID:joeymetal,项目名称:v1,代码行数:8,代码来源:PHP_Bug_33595.php

示例3: file_put_contents

 function file_put_contents($file_name, $content, $options = array())
 {
     $default_options = array('ftp' => defined('AK_UPLOAD_FILES_USING_FTP') && AK_UPLOAD_FILES_USING_FTP, 'base_path' => AK_BASE_DIR);
     $options = array_merge($default_options, $options);
     if (!function_exists('file_put_contents')) {
         include_once AK_CONTRIB_DIR . DS . 'pear' . DS . 'PHP' . DS . 'Compat.php';
         PHP_Compat::loadFunction(array('file_put_contents'));
     }
     $file_name = trim(str_replace($options['base_path'], '', $file_name), DS);
     if ($options['ftp']) {
         require_once AK_LIB_DIR . DS . 'AkFtp.php';
         $file_name = trim(str_replace(array(DS, '//'), array('/', '/'), $file_name), '/');
         if (!AkFtp::is_dir(dirname($file_name))) {
             AkFtp::make_dir(dirname($file_name));
         }
         return AkFtp::put_contents($file_name, $content);
     } else {
         if (!is_dir(dirname($options['base_path'] . DS . $file_name))) {
             Ak::make_dir(dirname($options['base_path'] . DS . $file_name), $options);
         }
         if (!($result = file_put_contents($options['base_path'] . DS . $file_name, $content))) {
             if (!empty($content)) {
                 Ak::trace("Could not write to file: \"" . $options['base_path'] . DS . "{$file_name}\". Please change file/dir permissions or enable FTP file handling by" . " setting the following on your config/" . AK_ENVIRONMENT . ".php file \n<pre>define('AK_UPLOAD_FILES_USING_FTP', true);\n" . "define('AK_READ_FILES_USING_FTP', false);\n" . "define('AK_DELETE_FILES_USING_FTP', true);\n" . "define('AK_FTP_PATH', 'ftp://username:password@example.com/path_to_the_framework');\n" . "define('AK_FTP_AUTO_DISCONNECT', true);\n</pre>");
             }
         }
         return $result;
     }
 }
开发者ID:joeymetal,项目名称:v1,代码行数:28,代码来源:Ak.php

示例4: ak_trace_db_query

 function ak_trace_db_query($message, $new_line = true)
 {
     if (Ak::getStaticVar('ak_trace_db_query') === false) {
         return;
     }
     if (!AK_TRACE_DB_QUERIES_INCLUDES_DB_TYPE) {
         $message = preg_replace('/\\([a-z0-9]+\\): /', '', trim($message, "\n-"));
     }
     $details = Ak::getLastFileAndLineAndMethod(AK_TRACE_ONLY_APP_DB_QUERIES);
     if (empty($details)) {
         $details = array(null, null, null);
     }
     $message = trim(html_entity_decode(strip_tags($message)));
     if (!AK_DEBUG_OUTPUT_AS_HTML) {
         echo $message . "\n";
     } else {
         Ak::trace($message, $details[1], $details[0], $details[2]);
     }
 }
开发者ID:joeymetal,项目名称:v1,代码行数:19,代码来源:AkDevelopmentErrorHandler.php

示例5: failTransaction

 public function failTransaction()
 {
     if(AK_DEBUG && !empty($this->connection->debug)){
         Ak::trace(ak_backtrace(), null, null, null, false);
     }
     return $this->connection->FailTrans();
 }
开发者ID:joeymetal,项目名称:v1,代码行数:7,代码来源:AkDbAdapter.php

示例6: dbugging

 function dbugging($trace_this_on_debug_mode = null)
 {
     if(!empty($this->_db->debug) && !empty($trace_this_on_debug_mode)){
         $message = !is_scalar($trace_this_on_debug_mode) ? var_export($trace_this_on_debug_mode, true) : (string)$trace_this_on_debug_mode;
         Ak::trace($message);
     }
     return !empty($this->_db->debug);
 }
开发者ID:joeymetal,项目名称:v1,代码行数:8,代码来源:AkActiveRecord.php

示例7: _displayLog

 function _displayLog($type, $error_mode, $error_message)
 {
     $message = $this->_getLogFormatedAsHtml($type, $error_mode, $error_message);
     if ($this->print_display_message) {
         Ak::trace($message);
     }
     return $message;
 }
开发者ID:joeymetal,项目名称:v1,代码行数:8,代码来源:AkLogger.php


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