• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP log_debug函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中log_debug函数的典型用法代码示例。如果您正苦于以下问题:PHP log_debug函数的具体用法?PHP log_debug怎么用?PHP log_debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: preprocess_file

 /** 
  * Gets file information out of $_FILES and stores it locally in $files.
  * Checks file against max upload file size.
  * Scans file for viruses.
  * @return false for no errors, or a string describing the error
  */
 function preprocess_file()
 {
     $name = $this->inputname;
     if (!isset($_FILES[$name])) {
         return get_string('noinputnamesupplied');
     }
     $file = $_FILES[$name];
     $maxsize = get_config('maxuploadsize');
     if ($maxsize && $file['size'] > $maxsize) {
         return get_string('uploadedfiletoobig');
     }
     if ($file['error'] != UPLOAD_ERR_OK) {
         $errormsg = get_string('phpuploaderror', 'mahara', get_string('phpuploaderror_' . $file['error']), $file['error']);
         log_debug($errormsg);
         if ($file['error'] == UPLOAD_ERR_NO_TMP_DIR || $file['error'] == UPLOAD_ERR_CANT_WRITE) {
             // The admin probably needs to fix this; notify them
             // @TODO: Create a new activity type for general admin messages.
             $message = (object) array('users' => get_column('usr', 'id', 'admin', 1), 'subject' => get_string('adminphpuploaderror'), 'message' => $errormsg);
             require_once 'activity.php';
             activity_occurred('maharamessage', $message);
         } else {
             if ($file['error'] == UPLOAD_ERR_INI_SIZE || $file['error'] == UPLOAD_ERR_FORM_SIZE) {
                 return get_string('uploadedfiletoobig');
             }
         }
     }
     if (!is_uploaded_file($file['tmp_name'])) {
         return get_string('notphpuploadedfile');
     }
     if (get_config('viruschecking') && ($errormsg = mahara_clam_scan_file($file))) {
         return $errormsg;
     }
     $this->file = $file;
     return false;
 }
开发者ID:Br3nda,项目名称:mahara,代码行数:41,代码来源:uploadmanager.php


示例2: configure

 /**
  * Initialize instance
  *
  * @param Charcoal_Config $config   configuration data
  */
 public function configure($config)
 {
     parent::configure($config);
     $session_name = $config->getString('session_name', '');
     $save_path = $config->getString('save_path', '', TRUE);
     $lifetime = $config->getInteger('lifetime', 0);
     $valid_path = $config->getString('valid_path', '');
     $valid_domain = $config->getString('valid_domain', '');
     $ssl_only = $config->getBoolean('ssl_only', FALSE);
     $save_path = us($save_path);
     $lifetime = ui($lifetime);
     $ssl_only = ub($ssl_only);
     $session_name = us($session_name);
     // デフォルトのセッション保存先
     if (!$save_path || !is_dir($save_path)) {
         $save_path = Charcoal_ResourceLocator::getApplicationPath('sessions');
     }
     // セッション初期化処理
     //        session_set_cookie_params( $lifetime, "$valid_path", "$valid_domain", $ssl_only );
     session_save_path($save_path);
     //        $session_name = session_name( $session_name ? $session_name : APPLICATION );
     session_name("PHPSESSID");
     //session_regenerate_id( TRUE );
     if ($this->getSandbox()->isDebug()) {
         log_debug("session", "session_name:{$session_name}", self::TAG);
         log_debug("session", "save_path:{$save_path}", self::TAG);
         log_debug("session", "lifetime:{$lifetime}", self::TAG);
         log_debug("session", "valid_path:{$valid_path}", self::TAG);
         log_debug("session", "valid_domain:{$valid_domain}", self::TAG);
         log_debug("session", "ssl_only:{$ssl_only}", self::TAG);
     }
     // メンバーに保存
     $this->save_path = $save_path;
 }
开发者ID:stk2k,项目名称:charcoalphp2,代码行数:39,代码来源:DefaultSessionHandler.class.php


示例3: onPageRequest

 public function onPageRequest(PageRequestEvent $event)
 {
     global $config, $page;
     // hax.
     if ($page->mode == "page" && (!isset($page->blocks) || $this->count_main($page->blocks) == 0)) {
         $h_pagename = html_escape(implode('/', $event->args));
         $f_pagename = preg_replace("/[^a-z_\\-\\.]+/", "_", $h_pagename);
         $theme_name = $config->get_string("theme", "default");
         if (file_exists("themes/{$theme_name}/{$f_pagename}") || file_exists("lib/static/{$f_pagename}")) {
             $filename = file_exists("themes/{$theme_name}/{$f_pagename}") ? "themes/{$theme_name}/{$f_pagename}" : "lib/static/{$f_pagename}";
             $page->add_http_header("Cache-control: public, max-age=600");
             $page->add_http_header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 600) . ' GMT');
             $page->set_mode("data");
             $page->set_data(file_get_contents($filename));
             if (endsWith($filename, ".ico")) {
                 $page->set_type("image/x-icon");
             }
             if (endsWith($filename, ".png")) {
                 $page->set_type("image/png");
             }
             if (endsWith($filename, ".txt")) {
                 $page->set_type("text/plain");
             }
         } else {
             log_debug("handle_404", "Hit 404: {$h_pagename}");
             $page->set_code(404);
             $page->set_title("404");
             $page->set_heading("404 - No Handler Found");
             $page->add_block(new NavBlock());
             $page->add_block(new Block("Explanation", "No handler could be found for the page '{$h_pagename}'"));
         }
     }
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:33,代码来源:main.php


示例4: configure

 /**
  * Initialize instance
  *
  * @param Charcoal_Config $config   configuration data
  */
 public function configure($config)
 {
     parent::configure($config);
     $this->_unit = $config->getString('unit', 'mm')->getValue();
     $this->_creator = $config->getString('creator', 'CharcoalPHP')->getValue();
     $this->_authhor = $config->getString('authhor', 'CharcoalPHP')->getValue();
     $this->_zoom = $config->getString('zoom', 'real')->getValue();
     $this->_layout = $config->getString('layout', 'continuous')->getValue();
     $this->_auto_break = $config->getBoolean('auto_break', TRUE)->getValue();
     $this->_auto_break_margin = $config->getInteger('auto_break_margin', 5)->getValue();
     $this->_fill_color = $config->getArray('fill_color', array(255, 255, 255))->getValue();
     $this->_margin_left = $config->getInteger('margin_left', 10.0)->getValue();
     $this->_margin_top = $config->getInteger('margin_left', 10.0)->getValue();
     $this->_margin_right = $config->getInteger('margin_left', 10.0)->getValue();
     log_debug("debug,pdf", "unit:" . $this->_unit);
     log_debug("debug,pdf", "creator:" . $this->_creator);
     log_debug("debug,pdf", "authhor:" . $this->_authhor);
     log_debug("debug,pdf", "zoom:" . $this->_zoom);
     log_debug("debug,pdf", "layout:" . $this->_layout);
     log_debug("debug,pdf", "auto_break:" . $this->_auto_break);
     log_debug("debug,pdf", "auto_break_margin:" . $this->_auto_break_margin);
     log_debug("debug,pdf", "fill_color:" . implode(",", $this->_fill_color));
     log_debug("debug,pdf", "margin_left:" . $this->_margin_left);
     log_debug("debug,pdf", "margin_top:" . $this->_margin_top);
     log_debug("debug,pdf", "margin_right:" . $this->_margin_right);
 }
开发者ID:stk2k,项目名称:charcoalphp2,代码行数:31,代码来源:PDFWriterComponent.class.php


示例5: create_thumb

 /**
  * Generate the Thumbnail image for particular file.
  *
  * @param string $hash
  * @return bool Returns true on successful thumbnail creation.
  */
 protected function create_thumb($hash)
 {
     global $config;
     $ok = false;
     switch ($config->get_string("video_thumb_engine")) {
         default:
         case 'static':
             $outname = warehouse_path("thumbs", $hash);
             copy("ext/handle_video/thumb.jpg", $outname);
             $ok = true;
             break;
         case 'ffmpeg':
             $ffmpeg = escapeshellcmd($config->get_string("thumb_ffmpeg_path"));
             $w = (int) $config->get_int("thumb_width");
             $h = (int) $config->get_int("thumb_height");
             $inname = escapeshellarg(warehouse_path("images", $hash));
             $outname = escapeshellarg(warehouse_path("thumbs", $hash));
             if ($config->get_bool("video_thumb_ignore_aspect_ratio") == true) {
                 $cmd = escapeshellcmd("{$ffmpeg} -i {$inname} -ss 00:00:00.0 -f image2 -vframes 1 {$outname}");
             } else {
                 $scale = 'scale="' . escapeshellarg("if(gt(a,{$w}/{$h}),{$w},-1)") . ':' . escapeshellarg("if(gt(a,{$w}/{$h}),-1,{$h})") . '"';
                 $cmd = "{$ffmpeg} -i {$inname} -vf {$scale} -ss 00:00:00.0 -f image2 -vframes 1 {$outname}";
             }
             exec($cmd, $output, $returnValue);
             if ((int) $returnValue == (int) 1) {
                 $ok = true;
             }
             log_debug('handle_video', "Generating thumbnail with command `{$cmd}`, returns {$returnValue}");
             break;
     }
     return $ok;
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:38,代码来源:main.php


示例6: AddPost

 /**
  * @attribute[RequestParam('title','string')]
  * @attribute[RequestParam('body','string')]
  */
 function AddPost($title, $body)
 {
     log_debug("Add Post");
     $ds = model_datasource('system');
     $ds->ExecuteSql("INSERT INTO blog(title,body)VALUES(?,?)", array($title, $body));
     redirect('blog', 'index');
 }
开发者ID:Naveenr9,项目名称:WebFramework,代码行数:11,代码来源:blog.class.php


示例7: render_instance

 public static function render_instance(BlockInstance $instance, $editing = false)
 {
     require_once get_config('docroot') . 'artefact/lib.php';
     $smarty = smarty_core();
     $configdata = $instance->get('configdata');
     $data = array();
     // add in the selected email address
     if (!empty($configdata['email'])) {
         $configdata['artefactids'][] = $configdata['email'];
     }
     // Get data about the profile fields in this blockinstance
     if (!empty($configdata['artefactids'])) {
         $viewowner = get_field('view', 'owner', 'id', $instance->get('view'));
         foreach ($configdata['artefactids'] as $id) {
             try {
                 $artefact = artefact_instance_from_id($id);
                 if (is_a($artefact, 'ArtefactTypeProfile') && $artefact->get('owner') == $viewowner) {
                     $rendered = $artefact->render_self(array('link' => true));
                     $data[$artefact->get('artefacttype')] = $rendered['html'];
                 }
             } catch (ArtefactNotFoundException $e) {
                 log_debug('Artefact not found when rendering contactinfo block instance. ' . 'There might be a bug with deleting artefacts of this type? ' . 'Original error follows:');
                 log_debug($e->getMessage());
             }
         }
     }
     $smarty->assign('profileinfo', $data);
     return $smarty->fetch('blocktype:contactinfo:content.tpl');
 }
开发者ID:richardmansfield,项目名称:richardms-mahara,代码行数:29,代码来源:lib.php


示例8: process

function process($info)
{
    $commit_info = $info['commit_info'];
    $module = $info['module'];
    $git_path = $info['git_path'];
    $svn_path = $info['svn_path'];
    if (empty($module) || empty($git_path) || empty($svn_path)) {
        log_warning(sprintf("some parameter is invalid. " . "module[%s] git_path[%s] svn_path[%s]", $module, $git_path, $svn_path));
        return false;
    }
    $svn_path_name = basename($svn_path);
    if ($svn_path_name != $module) {
        log_warning("svn module does not match git module", $svn_path_name, $module);
        return false;
    }
    if ($commit_info['ref'] != 'refs/heads/master') {
        log_debug("omit non master commit");
        return true;
    }
    $pwd = dirname(__FILE__);
    $cmd = "(source ~/.bashrc && cd {$pwd} && nohup ./git2svn.sh {$module} {$git_path} {$svn_path}) >./log/job.\$\$.log 2>&1 & echo \$!";
    exec($cmd, $output, $ret);
    log_debug(sprintf("start background sync script. cmd[%s] ret[%s] job-pid[%s]", $cmd, $ret, $output[0]));
    if ($ret == 0) {
        return true;
    } else {
        return false;
    }
}
开发者ID:sdgdsffdsfff,项目名称:Git2Svn,代码行数:29,代码来源:gitlab-webhook-sync.php


示例9: log

 public function log($level, &$message) {
     switch ($level) {
         case LogHelper::LEVEL_DEBUG:
             log_debug($message);
             break;
         case LogHelper::LEVEL_INFO:
             log_info($message);
             break;
         case LogHelper::LEVEL_NOTICE:
             log_notice($message);
             break;
         case LogHelper::LEVEL_WARNING:
             log_warn($message);
             break;
         case LogHelper::LEVEL_ERROR:
             log_error($message);
             break;
         case LogHelper::LEVEL_CRITICAL:
             log_critical($message);
             break;
         case LogHelper::LEVEL_ALERT:
             log_alert($message);
             break;
         case LogHelper::LEVEL_EMERGENCY:
             log_emergency($message);
             break;
     }
 }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:28,代码来源:Log4DrupalMessageListener.php


示例10: log_post

 function log_post($log_type, $log_contents, $timestamp = NULL)
 {
     log_debug("changelog", "Executing log_post({$log_type}, {$log_contents}, {$timestamp})");
     // check audit logging
     if (!$GLOBALS["config"]["FEATURE_LOGS_AUDIT"] && $log_type == "audit") {
         // audit logging is disabled
         return 0;
     }
     // do retention clean check
     if ($GLOBALS["config"]["LOG_RETENTION_PERIOD"]) {
         // check when we last ran a retention clean
         if ($GLOBALS["config"]["LOG_RETENTION_CHECKTIME"] < time() - 86400) {
             $this->log_retention_clean();
         }
     }
     if (empty($timestamp)) {
         $timestamp = time();
     }
     // write log
     $sql_obj = new sql_query();
     $sql_obj->string = "INSERT INTO logs (id_server, id_domain, username, timestamp, log_type, log_contents) VALUES ('" . $this->id_server . "', '" . $this->id_domain . "', '" . $this->username . "', '{$timestamp}', '{$log_type}', '{$log_contents}')";
     $sql_obj->execute();
     // update last sync on name server
     if ($this->id_server) {
         $obj_server = new name_server();
         $obj_server->id = $this->id_server;
         $obj_server->action_update_log_version($timestamp);
     }
     return 1;
 }
开发者ID:claybbs,项目名称:namedmanager,代码行数:30,代码来源:inc_changelog.php


示例11: __construct

 /**
  * Constructor
  *
  * @access  public
  */
 function __construct($props = array())
 {
     if (count($props) > 0) {
         $this->initialize($props);
     }
     log_debug("Upload Class Initialized");
 }
开发者ID:albertobraschi,项目名称:toad,代码行数:12,代码来源:Upload.php


示例12: symbolicate

 public function symbolicate()
 {
     $addresses = null;
     $targets = null;
     $matches = null;
     $symbolicated_report = $this->report;
     if ($this->appVersion === null) {
         preg_match('/^App Version: ([^\\s]+)/m', $symbolicated_report, $matches);
         if (!isset($matches[1]) || count($matches[1]) == 0) {
             preg_match('/Version:\\s+([\\S]+)\\s+/m', $symbolicated_report, $matches);
         }
         if (!isset($matches[1]) || count($matches[1]) == 0) {
             $msg = "Unknown format of crash or exception report.";
             throw new UnknownReportFormatSymbolicatorException($msg);
         }
         $this->appVersion = $matches[1];
     }
     $full_path = sprintf("%s/tower1/%s/Tower.app/Contents/MacOS/Tower", RELEASES_DIR, $this->appVersion);
     # FIXME
     if (!file_exists($full_path)) {
         $msg = "Could not find dsym files for product `{$this->appIdentifier}`, version `{$this->appVersion}`. Please copy dsym files to `releases/PRODUCT/VERSION/`.\n\nFull path: `{$full_path}`";
         throw new ReleaseNotFoundSymbolicatorException($msg);
     }
     #
     # Find lines like this:
     #
     # 1   com.fournova.Tower            	0x00091c91 0x1000 + 593041
     #
     # Resolve address and replace starting address (0x1000) with symbolicated name.
     #
     preg_match_all('/[0-9]+\\s.+\\s(0x[0-9a-f]+)\\s(\\w+\\s\\+\\s[0-9]+)/m', $this->report, $matches);
     if (!isset($matches[1]) || count($matches[1]) == 0) {
         preg_match_all('/^(0x[0-9a-f]+)$/m', $this->report, $matches);
     }
     $addresses = $matches[1];
     if (isset($matches[2])) {
         $targets = $matches[2];
     }
     $cmd = sprintf("/usr/bin/atos -arch %s -o %s %s", $this->arch, $full_path, implode(' ', $addresses));
     log_debug($cmd);
     $output = null;
     exec($cmd, $output);
     foreach ($output as $i => $line) {
         if (substr($line, 0, 2) !== '0x') {
             $replacement = null;
             if ($targets !== null) {
                 $target = $targets[$i];
                 // e.g. "0x1000 + 593041"
                 $tokens = explode(' + ', $target);
                 $replacement = "{$line} + {$tokens[1]}";
             } else {
                 $target = $addresses[$i];
                 $replacement = $line;
             }
             $symbolicated_report = str_replace($target, $replacement, $symbolicated_report);
         }
     }
     return $symbolicated_report;
 }
开发者ID:nosnebilla,项目名称:default-hub,代码行数:59,代码来源:symbolicator.php


示例13: print_debug

function print_debug($message, $var = 'messageonly', $part = 'app', $level = 3)
{
    if ($var == 'messageonly') {
        log_debug($message);
    } else {
        log_debug($message, $var);
    }
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:8,代码来源:log_functions.inc.php


示例14: xmldb_search_elasticsearch_upgrade

function xmldb_search_elasticsearch_upgrade($oldversion = 0)
{
    if ($oldversion < 2015012800) {
        // Adding indices on the table search_elasticsearch_queue
        $table = new XMLDBTable('search_elasticsearch_queue');
        $index = new XMLDBIndex('itemidix');
        $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('itemid'));
        add_index($table, $index);
    }
    if ($oldversion < 2015060900) {
        log_debug('Add "status" and "lastprocessed" columns to search_elasticsearch_queue table');
        $table = new XMLDBTable('search_elasticsearch_queue');
        $field = new XMLDBField('status');
        $field->setAttributes(XMLDB_TYPE_INTEGER, 10, null, XMLDB_NOTNULL, null, null, null, 0);
        add_field($table, $field);
        $table = new XMLDBTable('search_elasticsearch_queue');
        $field = new XMLDBField('lastprocessed');
        $field->setAttributes(XMLDB_TYPE_DATETIME);
        add_field($table, $field);
        $table = new XMLDBTable('search_elasticsearch_queue');
        $index = new XMLDBIndex('statusix');
        $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('status'));
        add_index($table, $index);
    }
    if ($oldversion < 2015072700) {
        log_debug('Adding ability to search by "Text" blocks in elasticsearch');
        // Need to add the 'block_instance' to the default types to index for elasticsearch
        // Note: the $cfg->plugin_search_elasticsearch_types can be overriding this
        // We don't want to run the re-indexing now as that will take ages for large sites
        // It should be run from the  Extensions -> Elasticsearch -> Configuration page
        if ($types = get_field('search_config', 'value', 'plugin', 'elasticsearch', 'field', 'types')) {
            $types = explode(',', $types);
            if (!in_array('block_instance', $types)) {
                $types[] = 'block_instance';
            }
            $types = implode(',', $types);
            update_record('search_config', array('value' => $types), array('plugin' => 'elasticsearch', 'field' => 'types'));
            log_warn(get_string('newindextype', 'search.elasticsearch', 'block_instance'), true, false);
        }
    }
    if ($oldversion < 2015100800) {
        log_debug('Adding ability to search by collection in elasticsearch');
        // The code for this existed since the beginning but 'collection' was not
        // added to the $cfg->plugin_search_elasticsearch_types
        // We don't want to run the re-indexing now as that will take ages for large sites
        // It should be run from the  Extensions -> Elasticsearch -> Configuration page
        if ($types = get_field('search_config', 'value', 'plugin', 'elasticsearch', 'field', 'types')) {
            $types = explode(',', $types);
            if (!in_array('collection', $types)) {
                $types[] = 'collection';
            }
            $types = implode(',', $types);
            update_record('search_config', array('value' => $types), array('plugin' => 'elasticsearch', 'field' => 'types'));
            log_warn(get_string('newindextype', 'search.elasticsearch', 'collection'), true, false);
        }
    }
    return true;
}
开发者ID:sarahjcotton,项目名称:mahara,代码行数:58,代码来源:upgrade.php


示例15: quotes_render_summarybox

function quotes_render_summarybox($id)
{
    log_debug("inc_quotes", "quotes_render_summarybox({$id})");
    // fetch quote information
    $sql_obj = new sql_query();
    $sql_obj->string = "SELECT code_quote, amount_total, date_validtill, date_sent, sentmethod FROM account_quotes WHERE id='{$id}' LIMIT 1";
    $sql_obj->execute();
    if ($sql_obj->num_rows()) {
        $sql_obj->fetch_array();
        if ($sql_obj->data[0]["amount_total"] == 0) {
            print "<table width=\"100%\" class=\"table_highlight_important\">";
            print "<tr>";
            print "<td>";
            print "<b>Quote " . $sql_obj->data[0]["code_quote"] . " has no items on it</b>";
            print "<p>This quote needs to have some items added to it using the links in the nav menu above.</p>";
            print "</td>";
            print "</tr>";
            print "</table>";
        } else {
            if (time_date_to_timestamp($sql_obj->data[0]["date_validtill"]) <= time()) {
                print "<table width=\"100%\" class=\"table_highlight_important\">";
                print "<tr>";
                print "<td>";
                print "<p><b>Quote " . $sql_obj->data[0]["code_quote"] . " has now expired and is no longer valid.</b></p>";
                print "</td>";
                print "</tr>";
                print "</table>";
            } else {
                print "<table width=\"100%\" class=\"table_highlight_important\">";
                print "<tr>";
                print "<td>";
                print "<b>Quote " . $sql_obj->data[0]["code_quote"] . " is currently valid.</b>";
                print "<table cellpadding=\"4\">";
                print "<tr>";
                print "<td>Quote Total:</td>";
                print "<td>" . format_money($sql_obj->data[0]["amount_total"]) . "</td>";
                print "</tr>";
                print "<tr>";
                print "<td>Valid Until:</td>";
                print "<td>" . $sql_obj->data[0]["date_validtill"] . "</td>";
                print "</tr>";
                print "<tr>";
                print "<td>Date Sent:</td>";
                if ($sql_obj->data[0]["sentmethod"] == "") {
                    print "<td><i>Has not been sent to customer</i></td>";
                } else {
                    print "<td>" . $sql_obj->data[0]["date_sent"] . " (" . $sql_obj->data[0]["sentmethod"] . ")</td>";
                }
                print "</tr>";
                print "</tr></table>";
                print "</td>";
                print "</tr>";
                print "</table>";
            }
        }
        print "<br>";
    }
}
开发者ID:carriercomm,项目名称:amberdms-bs,代码行数:58,代码来源:inc_quotes.php


示例16: __initialize

 /**
  * @param float $defvalue Initial value
  * @param string $onchange onChange JS code
  */
 function __initialize($defvalue = 0, $onchange = "")
 {
     parent::__initialize("div");
     $defvalue = floatval(str_replace(",", ".", $defvalue));
     $e = floor($defvalue);
     $c = round($defvalue - $e, 2) * 100;
     log_debug("CurrencyInput({$id}): {$defvalue} {$e} {$c}");
     $id = $this->id;
     $this->class = "currencyinput ui-widget-content ui-widget ui-corner-all";
     $this->css("border", "1px solid transparent");
     $this->onmouseover = "\$(this).css({border:''});";
     $this->onmouseout = "\$(this).css({border:'1px solid transparent'});";
     $euro = new uiSlider();
     $euro->id = "{$id}_euro";
     $euro->range = 'min';
     $euro->min = 0;
     $euro->max = 100;
     $euro->value = $e;
     $euro->css("margin-bottom", "8px");
     $euro->onslide = "function(event, ui){ \$('#{$id}_euro_value').text(ui.value); ";
     $euro->onslide .= "\$('#{$id}_hidden').val( \$('#{$id}_euro_value').text()+'.'+\$('#{$id}_cent_value').text() ).change(); }";
     $euro->onmouseover = "\$('#{$id}_euro_value').css({color:'red'});";
     $euro->onmouseout = "\$('#{$id}_euro_value').css({color:'black'});";
     $cent = new uiSlider();
     $cent->id = "{$id}_cent";
     $cent->range = 'min';
     $cent->min = 0;
     $cent->max = 99;
     $cent->value = $c;
     $cent->onslide = "function(event, ui){ \$('#{$id}_cent_value').text(ui.value<10?'0'+ui.value:ui.value); ";
     $cent->onslide .= "\$('#{$id}_hidden').val( \$('#{$id}_euro_value').text()+'.'+\$('#{$id}_cent_value').text() ).change(); }";
     $cent->onmouseover = "\$('#{$id}_cent_value').css({color:'red'});";
     $cent->onmouseout = "\$('#{$id}_cent_value').css({color:'black'});";
     $container = new Control("div");
     $container->class = "container";
     $container->content($euro);
     $container->content($cent);
     $value = new Control("div");
     $value->class = "value";
     $euroval = new Control("div");
     $euroval->id = "{$id}_euro_value";
     $euroval->css("float", "left");
     $euroval->content($e);
     $centval = new Control("div");
     $centval->id = "{$id}_cent_value";
     $centval->css("float", "left");
     $centval->content($c < 9 ? "0{$c}" : $c);
     $value->content("<div style='float:left'>€</div>");
     $value->content($euroval);
     $value->content("<div style='float:left'>,</div>");
     $value->content($centval);
     $this->content($container);
     $this->content($value);
     $this->content("<input type='hidden' id='{$id}_hidden' name='{$id}' value='{$defvalue}' onchange='{$onchange}'/>");
     $this->content("<br style='clear:both; line-height:0'/>");
 }
开发者ID:Naveenr9,项目名称:WebFramework,代码行数:60,代码来源:uicurrencyinput.class.php


示例17: __construct

 /**
  * Constructor method
  *
  * @param call stack $m
  */
 function __construct($m)
 {
     $msg = urlencode($m);
     // log the exception
     log_debug($m);
     // do the cleanup
     $this->cleanUp($msg);
     // send out the pretty error page
     $this->diePage($msg);
 }
开发者ID:ookwudili,项目名称:chisimba,代码行数:15,代码来源:customexception_class_inc.php


示例18: storage_s3_file_exists

function storage_s3_file_exists($object_id, $more = array())
{
    $rsp = s3_head(storage_s3_bucket(), $object_id);
    if ($rsp['ok']) {
        log_debug('s3', "exists: {$object_id}");
        return 1;
    } else {
        return 0;
    }
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:10,代码来源:lib_storage_s3.php


示例19: render_instance

 public static function render_instance(BlockInstance $instance, $editing = false)
 {
     require_once get_config('docroot') . 'artefact/lib.php';
     $smarty = smarty_core();
     $configdata = $instance->get('configdata');
     $data = array();
     $data['socialprofiles'] = array();
     // add in the selected email address
     if (!empty($configdata['email'])) {
         $configdata['artefactids'][] = $configdata['email'];
     }
     $viewowner = get_field('view', 'owner', 'id', $instance->get('view'));
     // Get data about the profile fields in this blockinstance
     if (!empty($configdata['artefactids'])) {
         foreach ($configdata['artefactids'] as $id) {
             try {
                 $artefact = artefact_instance_from_id($id);
                 if (is_a($artefact, 'ArtefactTypeProfile') && $artefact->get('owner') == $viewowner) {
                     $rendered = $artefact->render_self(array('link' => true));
                     $artefacttype = $artefact->get('artefacttype');
                     if ($artefacttype == 'socialprofile') {
                         if (get_record('blocktype_installed', 'active', 1, 'name', 'socialprofile', 'artefactplugin', 'internal')) {
                             $data['socialprofiles'][] = array('link' => ArtefactTypeSocialprofile::get_profile_link($artefact->get('title'), $artefact->get('note')), 'title' => $artefact->get('title'), 'description' => $artefact->get('description'), 'note' => $artefact->get('note'));
                         }
                     } else {
                         $data[$artefacttype] = $rendered['html'];
                     }
                 }
             } catch (ArtefactNotFoundException $e) {
                 log_debug('Artefact not found when rendering a block instance. ' . 'There might be a bug with deleting artefacts of this type? ' . 'Original error follows:');
                 log_debug($e->getMessage());
             }
         }
         // Sort social profiles alphabetically (in ASC order)
         $description = array();
         foreach ($data['socialprofiles'] as $key => $row) {
             $description[$key] = $row['description'];
         }
         array_multisort($description, SORT_ASC, $data['socialprofiles']);
     }
     // Work out the path to the thumbnail for the profile image
     if (!empty($configdata['profileicon'])) {
         $downloadpath = get_config('wwwroot') . 'thumb.php?type=profileiconbyid&id=' . $configdata['profileicon'];
         $downloadpath .= '&maxwidth=80';
         $smarty->assign('profileiconpath', $downloadpath);
         $smarty->assign('profileiconalt', get_string('profileimagetext', 'mahara', display_default_name(get_user($viewowner))));
     }
     // Override the introduction text if the user has any for this
     // particular blockinstance
     if (!empty($configdata['introtext'])) {
         $data['introduction'] = $configdata['introtext'];
     }
     $smarty->assign('profileinfo', $data);
     return $smarty->fetch('blocktype:profileinfo:content.tpl');
 }
开发者ID:sarahjcotton,项目名称:mahara,代码行数:55,代码来源:lib.php


示例20: xmldb_interaction_forum_upgrade

function xmldb_interaction_forum_upgrade($oldversion = 0)
{
    if ($oldversion < 2009062300) {
        foreach (array('topic', 'forum') as $type) {
            log_debug("Subscription upgrade for {$type}s");
            // Add missing primary key to the subscription tables
            // Step 1: remove duplicates
            if ($dupes = get_records_sql_array('
                SELECT "user", ' . $type . ', COUNT(*)
                FROM {interaction_forum_subscription_' . $type . '}
                GROUP BY "user", ' . $type . '
                HAVING COUNT(*) > 1', array())) {
                // We found duplicate subscriptions to a topic/forum
                foreach ($dupes as $dupe) {
                    log_debug("interaction.forum: Removing duplicate {$type} subscription for {$dupe->user}");
                    delete_records('interaction_forum_subscription_' . $type, 'user', $dupe->user, $type, $dupe->{$type});
                    insert_record('interaction_forum_subscription_' . $type, (object) array('user' => $dupe->user, $type => $dupe->{$type}));
                }
            }
            // Step 2: add the actual key
            $table = new XMLDBTable('interaction_forum_subscription_' . $type);
            $key = new XMLDBKey('primary');
            $key->setAttributes(XMLDB_KEY_PRIMARY, array('user', $type));
            add_key($table, $key);
            // Add a 'key' column, used for unsubscriptions
            $field = new XMLDBField('key');
            $field->setAttributes(XMLDB_TYPE_CHAR, 50, XMLDB_UNSIGNED, null);
            add_field($table, $field);
            $key = new XMLDBKey('keyuk');
            $key->setAttributes(XMLDB_KEY_UNIQUE, array('key'));
            add_key($table, $key);
            // Populate the key column
            if ($records = get_records_array('interaction_forum_subscription_' . $type, '', '', '', '"user", ' . $type)) {
                foreach ($records as $where) {
                    $new = (object) array('user' => $where->user, $type => $where->{$type}, 'key' => dechex(mt_rand()));
                    update_record('interaction_forum_subscription_' . $type, $new, $where);
                }
            }
            // Now make the key column not null
            $field->setAttributes(XMLDB_TYPE_CHAR, 50, XMLDB_UNSIGNED, XMLDB_NOTNULL);
            change_field_notnull($table, $field);
        }
    }
    if ($oldversion < 2009081700) {
        if (!get_record('interaction_config', 'plugin', 'forum', 'field', 'postdelay')) {
            insert_record('interaction_config', (object) array('plugin' => 'forum', 'field' => 'postdelay', 'value' => 30));
        }
    }
    if ($oldversion < 2009081800) {
        $subscription = (object) array('plugin' => 'forum', 'event' => 'creategroup', 'callfunction' => 'create_default_forum');
        ensure_record_exists('interaction_event_subscription', $subscription, $subscription);
    }
    return true;
}
开发者ID:richardmansfield,项目名称:richardms-mahara,代码行数:54,代码来源:upgrade.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP log_error函数代码示例发布时间:2022-05-15
下一篇:
PHP log_cron_action函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap