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


PHP debug_msg函数代码示例

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


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

示例1: imageFromId

 private function imageFromId($imageId)
 {
     if ($this->connection->isConnected()) {
         // make sure it's a valid id
         //if(isValidDespotifyId($trackId))
         //{
         if (DEBUG_MODE) {
             debug_msg('writing:' . 'image ' . $imageId . '\\n');
         }
         $this->connection->write('image ' . $imageId . "\n");
         if (($length = $this->connection->readHeader()) === false) {
             return false;
         }
         if (DEBUG_MODE) {
             debug_msg('received image data');
         }
         $imageData = $this->connection->read($length);
         $this->image = $imageData;
         //$this->imageFromXMLObject($xmlObject);
         /*}
         		else
         		{
         			echo 'invalid id: ' . $imageId . '<br/>';
         			return false;
         		}
         		*/
     } else {
         return false;
     }
 }
开发者ID:sam0426933,项目名称:despotify,代码行数:30,代码来源:Image.php

示例2: config_write

function config_write()
{
    debug_msg("FUNCTION: " . __FUNCTION__, 3);
    global $dbcfg_type, $dbcfg_host, $dbcfg_name, $dbcfg_user, $dbcfg_password, $dbcfg_prefix, $dbcfg_port, $dbcfg_persistent, $dbcfg_path, $action;
    // Location of the main configuration file
    $config_file = '../config.php';
    // Contents of the main configuration file
    $config_contents = "<?php\n/*\nconfig.php\n\nGeneral Configuration\n*/\n\n// Debug level\nif(!defined('S9YCONF_DEBUG_LEVEL')) define('S9YCONF_DEBUG_LEVEL', 0);\n\n// Installed\nif(!defined('S9YCONF_INSTALLED')) define('S9YCONF_INSTALLED', TRUE);\n\n// Version\nif(!defined('S9YCONF_VERSION')) define('S9YCONF_VERSION', '2.0');\n\n// Program Name\nif(!defined('S9YCONF_PROGRAM_NAME')) define('S9YCONF_PROGRAM_NAME', 'S9Y_Conf');\n\n// path to include files\nif(!defined('S9YCONF_INC_PATH')) define('S9YCONF_INC_PATH', './inc/');\n\n// DB Type\nif(!defined('S9YCONF_DBTYPE')) define('S9YCONF_DBTYPE', '" . $dbcfg_type . "');\n\n// path to DB config file\nif(!defined('S9YCONF_DBCFG_PATH')) define('S9YCONF_DBCFG_PATH', '" . $dbcfg_path . "');\n\n// Include functions\n\n// General Uncategorised Functions\ninclude_once S9YCONF_INC_PATH.'functions.inc.php';\n\n// Database Funcctions\ninclude_once S9YCONF_INC_PATH.'db.inc.php';\n\n// HTML Functions\ninclude_once S9YCONF_INC_PATH.'html.functions.inc.php';\n\n// Include DB configuration\ninclude_once S9YCONF_DBCFG_PATH.'dbconfig.php';\n\ndebug_msg (\"FILE: \".__FILE__,3);\n\n?>";
    debug_msg(nl2br(htmlentities($config_contents, ENT_COMPAT, LANG_CHARSET)), 5);
    // Open the file for writing
    if (!($file_handle = @fopen($config_file, 'wb'))) {
        // Failed to open the file?
        return 1;
    }
    // Write the file
    if (fwrite($file_handle, $config_contents) === FALSE) {
        fclose($file_handle);
        return 2;
    }
    // Close the file
    fclose($file_handle);
    // File written readable?
    if (!is_readable($config_file)) {
        return 4;
    }
    return 0;
}
开发者ID:sqall01,项目名称:additional_plugins,代码行数:27,代码来源:config.write.php

示例3: save_xml_tutorial

function save_xml_tutorial(&$file)
{
    global $username;
    debug_msg("File type is XML");
    $tmpfile = $file["tmp_name"];
    $filename = $file["name"];
    $filepath = "users/{$username}";
    debug_msg("Path: {$filepath}");
    $pathname = "../run/{$filepath}/{$filename}";
    debug_msg("File will be saved as {$pathname}");
    // Check if file exists and if not, write the data
    if (file_exists($pathname)) {
        debug_msg("File exists - temporary storage");
        if (!is_dir("../run/{$filepath}/temp/")) {
            mkdir("../run/{$filepath}/temp/");
        }
        move_uploaded_file($tmpfile, "../run/{$filepath}/temp/{$filename}");
        $result = false;
    } else {
        move_uploaded_file($tmpfile, $pathname);
        debug_msg("Move succeeded");
        // update database
        $filenoext = stripextension($filename);
        open_db();
        $date = date("Y-m-d");
        $sql = "INSERT INTO file (file_date, file_author, file_path, file_name)" . " VALUES ('{$date}','{$username}','{$filepath}','{$filenoext}')" . " ON DUPLICATE KEY UPDATE file_date='{$date}';";
        query_db($sql);
        $result = $filenoext;
    }
    return $result;
}
开发者ID:boisvert,项目名称:elcid,代码行数:31,代码来源:edit_file.php

示例4: check_mysql_connection

/**
 * Checks if password is correct or database exists
 */
function check_mysql_connection($host, $user, $password, $database)
{
    $link = mysqli_connect($host, $user, $password, $database);
    if (!$link) {
        debug_msg('Unable to connect to MySQL, errorno: ' . mysqli_connect_errno());
        debug_msg(mysqli_connect_error());
        return false;
    }
    mysqli_close($link);
    return true;
}
开发者ID:devgeniem,项目名称:better-wp-db-error,代码行数:14,代码来源:db-error.php

示例5: url_maybe_adapt_idp

function url_maybe_adapt_idp($url, $idpAuthnRequest_url)
{
    if (!$idpAuthnRequest_url) {
        return $url;
    }
    global $currentIdpId;
    global $entityID_to_AuthnRequest_url;
    $currentAuthnRequest = $entityID_to_AuthnRequest_url[$currentIdpId];
    $url_ = removePrefixOrNULL($url, $currentAuthnRequest);
    if ($url_) {
        $url = $idpAuthnRequest_url . $url_;
        debug_msg("personalized shib url is now {$url}");
    }
    return $url;
}
开发者ID:prigaux,项目名称:bandeau-ENT,代码行数:15,代码来源:common.inc.php

示例6: overwrite_old_file

function overwrite_old_file($fname)
{
    debug_msg("overwrite {$fname}");
    global $username;
    $filepath = "users/{$username}";
    $pathname = "../{$filepath}/{$fname}";
    debug_msg("File will be saved as {$pathname}");
    // move the file
    move_uploaded_file("../{$filepath}/temp/{$filename}", $pathname);
    debug_msg("Move succeeded");
    // update database
    $filenoext = stripextension($fname);
    open_db();
    $date = date("Y-m-d");
    $sql = "INSERT INTO file (file_date, file_author, file_path, file_name)" . " VALUES ('{$date}','{$username}','{$filepath}','{$filenoext}')" . " ON DUPLICATE KEY UPDATE file_date='{$date}';";
    query_db($sql);
}
开发者ID:boisvert,项目名称:elcid,代码行数:17,代码来源:overwrite_confirm.php

示例7: driver_apply

/**
* My Handy Restaurant
*
* http://www.myhandyrestaurant.org
*
* My Handy Restaurant is a restaurant complete management tool.
* Visit {@link http://www.myhandyrestaurant.org} for more info.
* Copyright (C) 2003-2005 Fabio De Pascale
* 
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
* @author		Fabio 'Kilyerd' De Pascale <public@fabiolinux.com>
* @package		MyHandyRestaurant
* @copyright		Copyright 2003-2005, Fabio De Pascale
*/
function driver_apply($driver, $msg)
{
    $debug = _FUNCTION_ . ' - Applying driver ' . $driver . ' - to msgline ' . $msg . ' ' . "\n";
    debug_msg(__FILE__, __LINE__, $debug);
    $driver_function = 'driver_' . $driver;
    if (function_exists($driver_function)) {
        $msg = $driver_function($msg);
    } else {
        echo 'driver not found: ' . $driver . '<br>' . "\n";
        $debug = _FUNCTION_ . ' - driver ' . $driver . ' not found' . "\n";
        error_msg(__FILE__, __LINE__, $debug);
    }
    if (!CONF_DEBUG_PRINT_MARKUP) {
        // cleans all not used markups
        $msg = preg_replace("/{[^}]*}/", "", $msg);
    }
    return $msg;
}
开发者ID:jaimeivan,项目名称:smart-restaurant,代码行数:45,代码来源:drivers_waiter.php

示例8: save_media

function save_media(&$file)
{
    global $username;
    debug_msg("File type is supported media");
    if ($file["size"] > 9999999) {
        debug_msg("File too large - no upload");
        move_uploaded_file($tmpfile, "../{$filepath}/temp/{$filename}");
        $result = false;
    } else {
        $tmpfile = $file["tmp_name"];
        $filename = $file["name"];
        $filepath = "../users/{$username}";
        debug_msg("Path: {$filepath}");
        $pathname = "{$filepath}/{$filename}";
        debug_msg("File will be saved as {$pathname}");
        // Check if file exists and if not, write the data
        move_uploaded_file($tmpfile, $pathname);
        debug_msg("Move succeeded");
        $result = $filename;
    }
    return $result;
}
开发者ID:boisvert,项目名称:elcid,代码行数:22,代码来源:upload_file.php

示例9: fz_log

function fz_log($message, $type = null, $vars = null)
{
    if ($type == FZ_LOG_DEBUG && option('debug') !== true) {
        return;
    }
    if ($type !== null) {
        $type = '-' . $type;
    }
    $message = trim($message);
    if ($vars !== null) {
        $message .= var_export($vars, true) . "\n";
    }
    $message = str_replace("\n", "\n   ", $message);
    $message = '[' . strftime('%F %T') . '] ' . str_pad('[' . $_SERVER["REMOTE_ADDR"] . ']', 18) . $message . "\n";
    if (fz_config_get('app', 'log_dir') !== null) {
        $log_file = fz_config_get('app', 'log_dir') . '/filez' . $type . '.log';
        if (file_put_contents($log_file, $message, FILE_APPEND) === false) {
            trigger_error('Can\'t open log file (' . $log_file . ')', E_USER_WARNING);
        }
    }
    if (option('debug') === true) {
        debug_msg($message);
    }
}
开发者ID:nahuelange,项目名称:FileZ,代码行数:24,代码来源:fz_log.php

示例10: trim

<?php

// secure page
require 'login.php';
// uncomment the line below to get execution detail
// $debug=true;
$file_id = trim($_POST["file"]);
$tags = $_POST["tags"];
if ($file_id != "") {
    $tagsArray = explode(";", $tags);
    debug_msg("Tags:" . $tags);
    // open database
    open_db();
    // Remove existing tags
    $sql = "DELETE FROM file_tag WHERE (file_id={$file_id})";
    query_db($sql);
    foreach ($tagsArray as $tag) {
        $tag = trim($tag);
        if ($tag != "") {
            $sql = "INSERT INTO tag(tag,tag_author) VALUES ('{$tag}','{$username}')";
            query_db($sql);
            $sql = "INSERT INTO file_tag VALUES ({$file_id},'{$tag}','{$username}')";
            query_db($sql);
        }
    }
    close_db();
    // on ferme la connexion
}
开发者ID:boisvert,项目名称:elcid,代码行数:28,代码来源:set_tags.php

示例11: fwrite

    fwrite($file, $data);
    fclose($file);
    debug_msg("File written");
    // select database
    open_db();
    // Is there a file in the DB with this name & path?
    $sql = "SELECT file_id FROM file WHERE file_name='{$filename}' AND file_path='{$filepath}';";
    $date = date("Y-m-d");
    $reply = "File {$filename} ";
    if ($key = query_one_item($sql)) {
        $sql = "UPDATE file SET file_date='" . $date . "' WHERE file_id = " . $key . ";";
        $reply .= "updated.";
    } else {
        $sql = "INSERT INTO file (file_date, file_author, file_path, file_name) " . "VALUES ('" . $date . "','" . $username . "','" . $filepath . "','" . $filename . "')";
        $reply .= "created.";
    }
    query_db($sql);
    // if a temp save exists, delete it
    $pathname = "../run/users/{$username}/temp/{$filename}.xml";
    if (file_exists($pathname)) {
        unlink($pathname);
        debug_msg("Temp save removed");
    }
    echo $reply . "\n";
    echo "../users/{$username}/{$filename}.xml";
} else {
    // file does not exist despite fopen
    header("HTTP/1.1 500 Internal Server Error");
    echo "\nFile could not be created";
}
exit;
开发者ID:boisvert,项目名称:elcid,代码行数:31,代码来源:upload.php

示例12: dbconfig_write

function dbconfig_write()
{
    debug_msg("FUNCTION: " . __FUNCTION__, 3);
    global $dbcfg_type, $dbcfg_host, $dbcfg_name, $dbcfg_user, $dbcfg_password, $dbcfg_prefix, $dbcfg_port, $dbcfg_persistent, $dbcfg_path, $action;
    $path_separator = '/';
    if ($dbcfg_path == '') {
        // If no path entered then default to ./
        $dbcfg_path = './';
        $path_separator = '';
    }
    debug_msg('dbcfg_path after checking blank: "' . $dbcfg_path . '"', 5);
    if ($dbcfg_path[0] == '/') {
        // full path will start with /
        $path_modifier = '';
        // so we have all the information we need
        $path_separator = '';
    } else {
        // must be a relative path or below main directory
        $path_modifier = '../';
        // so we need to start from the main directory
    }
    debug_msg('First 2 chars: "' . substr($dbcfg_path, 0, 2) . '"', 5);
    debug_msg('First 3 chars: "' . substr($dbcfg_path, 0, 3) . '"', 5);
    if ($dbcfg_path[0] == '/') {
        // full path
        $final_path = $dbcfg_path;
    } elseif (substr($dbcfg_path, 0, 2) == './') {
        // relative path starting with ./
        $final_path = realpath('../') . $path_separator . substr($dbcfg_path, 2, strlen($dbcfg_path) - 2);
    } elseif (substr($dbcfg_path, 0, 3) == '../') {
        // relative path starting with ../
        $final_path = realpath('../../') . $path_separator . substr($dbcfg_path, 3, strlen($dbcfg_path) - 3);
    } else {
        // must be a subdirectory of main directory
        $final_path = realpath('../') . $path_separator . $dbcfg_path;
    }
    debug_msg('path_modifier: "' . $path_modifier . '"', 5);
    debug_msg('path_separator: "' . $path_separator . '"', 5);
    debug_msg('final_path: "' . $final_path . '"', 5);
    if (substr($dbcfg_path, -1) != '/') {
        $dbcfg_path = $dbcfg_path . '/';
    }
    debug_msg('Final dbcfg_path after end slash: "' . $dbcfg_path . '"', 5);
    // Location of the main configuration file
    $dbconfig_file = $final_path . 'dbconfig.php';
    // Contents of the main configuration file
    $dbconfig_contents = "<?php\n/*\ndbconfig.php\n\nDatabase specific configuration\n*/\ndebug_msg (\"FILE: \".__FILE__,3);\n\n\n################################################################################\n#           mySQL SETTINGS                                                     #\n################################################################################\ndefine('S9YCONF_DB_HOST'      , '" . $dbcfg_host . "'); // MySQL server hostname\ndefine('S9YCONF_DB_NAME'      , '" . $dbcfg_name . "'); // name of your database\ndefine('S9YCONF_DB_USER'      , '" . $dbcfg_user . "'); // username\ndefine('S9YCONF_DB_PWD'       , '" . $dbcfg_password . "'); // password\n\n######## optional settings: ####################################################\n\n// Leaving this empty defaults to port 3306\ndefine('S9YCONF_DB_PORT'      , '" . $dbcfg_port . "');\n// To use persistent connections, change this to TRUE\ndefine('S9YCONF_DB_PERSISTENT', ";
    // Set TRUE/FALSE for persistent connections
    if ($dbcfg_persistent == '1') {
        $dbconfig_contents = $dbconfig_contents . "FALSE";
    } else {
        $dbconfig_contents = $dbconfig_contents . "TRUE";
    }
    $dbconfig_contents = $dbconfig_contents . ");\n\n#//in case you need a prefix in front of your tables...\ndefine('S9YCONF_DB_PREFIX'    , '" . $dbcfg_prefix . "');\n#\n#//please enter your old prefix here. The update-script\n#//going to change all your tables automatically to the\n#//new prefix set above.\n#define('S9YCONF_DB_PREFIX_OLD', '');\n################################################################################\n\n?>";
    debug_msg(nl2br(htmlentities($dbconfig_contents, ENT_COMPAT, LANG_CHARSET)), 5);
    // Open the file for writing
    if (!($file_handle = @fopen($dbconfig_file, 'wb'))) {
        // Failed to open the file?
        return 1;
    }
    if (fwrite($file_handle, $dbconfig_contents) === FALSE) {
        fclose($file_handle);
        return 2;
    }
    // Close the file
    fclose($file_handle);
    // File written readable?
    if (!is_readable($dbconfig_file)) {
        return 4;
    }
    return 0;
}
开发者ID:sqall01,项目名称:additional_plugins,代码行数:72,代码来源:dbconfig.write.php

示例13: menu

function menu($action)
{
    global $menu_arr;
    // Debugging - Fenster �ffnen
    if ($_SESSION['debugging'] === true) {
        debug_open_window();
        debug_var('Seite: ', $_SERVER['PHP_SELF']);
        debug_var('Action: ', $_REQUEST);
        debug_msg('Debugging ist aktiv');
        debug_finish();
        $message = 'Debugging: aktiv!';
    }
    $html = '';
    $html .= '<h2>Menu</h2>' . "\n";
    $html .= '<ul>' . "\n";
    if (in_array($GLOBALS['CMS']['MENU01'], $menu_arr)) {
        $html .= '<li class="' . set_class($action, 'NAVIGA') . '"><a href="#" onclick="javascript:start_form(\'naviga\');">' . $GLOBALS['CMS']['MENU01'] . '</a></li>' . "\n";
    }
    if (in_array($GLOBALS['CMS']['MENU02'], $menu_arr)) {
        $html .= '<li class="' . set_class($action, 'SEITEN') . '"><a href="#" onclick="javascript:start_form(\'seiten\');">' . $GLOBALS['CMS']['MENU02'] . '</a></li>' . "\n";
    }
    if (in_array($GLOBALS['CMS']['MENU11'], $menu_arr)) {
        $html .= '<li class="' . set_class($action, 'FRGMNT') . '"><a href="#" onclick="javascript:start_form(\'frgmnt\');">' . $GLOBALS['CMS']['MENU11'] . '</a></li>' . "\n";
    }
    if (in_array($GLOBALS['CMS']['MENU12'], $menu_arr)) {
        $html .= '<li class="' . set_class($action, 'ADDONS') . '"><a href="#" onclick="javascript:start_form(\'addons\');">' . $GLOBALS['CMS']['MENU12'] . '</a></li>' . "\n";
    }
    if (in_array($GLOBALS['CMS']['MENU03'], $menu_arr)) {
        $html .= '<li class="' . set_class($action, 'MEDIEN') . '"><a href="#" onclick="javascript:start_form(\'medien\');">' . $GLOBALS['CMS']['MENU03'] . '</a></li>' . "\n";
    }
    if (in_array($GLOBALS['CMS']['MENU10'], $menu_arr)) {
        $html .= '<li class="' . set_class($action, 'CONFIG') . '"><a href="#" onclick="javascript:start_form(\'config\');">' . $GLOBALS['CMS']['MENU10'] . '</a></li>' . "\n";
    }
    if (in_array($GLOBALS['CMS']['MENU06'], $menu_arr)) {
        $html .= '<li class="' . set_class($action, 'XLINKS') . '"><a href="#" onclick="javascript:start_form(\'xlinks\');">' . $GLOBALS['CMS']['MENU06'] . '</a></li>' . "\n";
    }
    if (in_array($GLOBALS['CMS']['MENU07'], $menu_arr)) {
        $html .= '<li class="' . set_class($action, 'BACKUP') . '"><a href="#" onclick="javascript:start_form(\'backup\');">' . $GLOBALS['CMS']['MENU07'] . '</a></li>' . "\n";
    }
    if (in_array($GLOBALS['CMS']['MENU08'], $menu_arr)) {
        $html .= '<li class="' . set_class($action, 'DOKU') . '"><a href="#" onclick="javascript:start_form(\'docu\');">' . $GLOBALS['CMS']['MENU08'] . '</a></li>' . "\n";
    }
    $html .= '<li class="even">' . "\n";
    $html .= '<p><font color="#00CC00">' . $GLOBALS['TEXTE']['ANGEMELDET'] . ' ' . $_SESSION['username'] . '</font><br />' . "\n";
    if ($message != '') {
        $html .= $message;
    }
    $html .= '</p>' . "\n";
    $html .= '</li>' . "\n";
    $html .= '<li class="even"><a href="#" onclick="javascript:start_form(\'logout\');">' . $GLOBALS['CMS']['MENU09'] . '</a></li>' . "\n";
    $html .= '</ul>' . "\n";
    return $html;
}
开发者ID:rhempen,项目名称:cms,代码行数:53,代码来源:cmslogin.php

示例14: Copyright

Copyright (C) 2006 Chris Lander

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

Contact:
	Chris Lander		Email: clander@labbs.com

	LABBS Web Services
	54 Stanley Street
	Luton
	Bedfordshire
	United Kingdom
	LU1 5AN
*/
debug_msg("FILE: " . __FILE__, 3);
if (S9YCONF_DBTYPE == 'MYSQL') {
    include_once S9YCONF_INC_PATH . 'mysql.functions.inc.php';
}
开发者ID:sqall01,项目名称:additional_plugins,代码行数:30,代码来源:db.inc.php

示例15: disconnect

 function disconnect()
 {
     $msg = 'INFO destroy.php - ' . $this->data['name'] . ' (' . $this->id . ') disconnected';
     debug_msg(__FILE__, __LINE__, $msg);
     $_SESSION = array();
     unset($_COOKIE[session_name()]);
     session_unset();
     session_destroy();
     if (isset($_SESSION['userid'])) {
         return true;
     }
     return 0;
 }
开发者ID:jaimeivan,项目名称:smart-restaurant,代码行数:13,代码来源:user_class.php


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