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


PHP COM_errorLog函数代码示例

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


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

示例1: plugin_install_captcha

function plugin_install_captcha()
{
    global $pi_name, $pi_version, $gl_version, $pi_url, $NEWTABLE, $DEFVALUES, $NEWFEATURE;
    global $_TABLES, $_CONF, $LANG_CP00, $_DB_dbms;
    COM_errorLog("Attempting to install the {$pi_name} Plugin", 1);
    $_SQL['cp_config'] = "CREATE TABLE {$_TABLES['cp_config']} ( " . "  `config_name` varchar(255) NOT NULL default '', " . "  `config_value` varchar(255) NOT NULL default '', " . "   PRIMARY KEY  (`config_name`) " . " );";
    $_SQL['cp_sessions'] = "CREATE TABLE {$_TABLES['cp_sessions']} ( " . "  `session_id` varchar(40) NOT NULL default '', " . "  `cptime`  INT(11) NOT NULL default 0, " . "  `validation` varchar(40) NOT NULL default '', " . "  `counter`    TINYINT(4) NOT NULL default 0, " . "  PRIMARY KEY (`session_id`) " . " );";
    foreach ($_SQL as $table => $sql) {
        COM_errorLog("Creating {$table} table", 1);
        DB_query($sql, 1);
        if (DB_error()) {
            COM_errorLog("Error Creating {$table} table", 1);
            plugin_uninstall_captcha();
            return false;
            exit;
        }
        COM_errorLog("Success - Created {$table} table", 1);
    }
    $SQL_DEFAULTS = "INSERT INTO `{$_TABLES['cp_config']}` (`config_name`, `config_value`) VALUES " . " ('anonymous_only', '1'), " . " ('remoteusers','0'), " . " ('debug', '0'), " . " ('enable_comment', '0'), " . " ('enable_contact', '0'), " . " ('enable_emailstory', '0'), " . " ('enable_forum', '0'), " . " ('enable_registration', '0'), " . " ('enable_story', '0'), " . " ('gfxDriver', '2'), " . " ('gfxFormat', 'jpg'), " . " ('gfxPath', '');";
    DB_query($SQL_DEFAULTS, 1);
    // Register the plugin with Geeklog
    COM_errorLog("Registering {$pi_name} plugin with Geeklog", 1);
    DB_delete($_TABLES['plugins'], 'pi_name', 'captcha');
    DB_query("INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_homepage, pi_enabled) " . "VALUES ('{$pi_name}', '{$pi_version}', '{$gl_version}', '{$pi_url}', 1)");
    if (DB_error()) {
        COM_errorLog("Failure registering plugin with Geeklog");
        plugin_uninstall_captcha();
        return false;
        exit;
    }
    // Create initial log entry
    CAPTCHA_errorLog("CAPTCHA Plugin Successfully Installed");
    COM_errorLog("Successfully installed the {$pi_name} Plugin!", 1);
    return true;
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:35,代码来源:install.php

示例2: EXP_upgrade_sql

/**
*   Execute the SQL statement to perform a version upgrade.
*   An empty SQL parameter will return success.
*
*   @param string   $version  Version being upgraded to
*   @param array    $sql      SQL statement to execute
*   @return integer Zero on success, One on failure.
*/
function EXP_upgrade_sql($version = 'Undefined', $sql = '')
{
    global $_TABLES, $_CONF_EXP;
    // We control this, so it shouldn't happen, but just to be safe...
    if ($version == 'Undefined') {
        COM_errorLog("Error updating {$_CONF_EXP['pi_name']} - Undefined Version");
        return 1;
    }
    // If no sql statements passed in, return success
    if (!is_array($sql)) {
        return 0;
    }
    // Execute SQL now to perform the upgrade
    COM_errorLOG("--Updating External Pages to version {$version}");
    for ($i = 1; $i <= count($sql); $i++) {
        COM_errorLOG("External Pages Plugin {$version} update: Executing SQL => " . current($sql));
        DB_query(current($sql), '1');
        if (DB_error()) {
            COM_errorLog("SQL Error during External Pages plugin update", 1);
            return 1;
            break;
        }
        next($sql);
    }
    return 0;
}
开发者ID:JohnToro,项目名称:external,代码行数:34,代码来源:upgrade.inc.php

示例3: nexform_importForm

function nexform_importForm($_SQL, $cntr)
{
    global $CONF_FE, $_TABLES;
    DB_query($_SQL[0], '1');
    if (DB_error()) {
        COM_errorLog("nexform SQL error importing form: {$_SQL[0]}");
    }
    $newformid = DB_insertID();
    /* Delete any previous imported form field definition records
          New field definition records will have a formid of '99999' assigned
          Insert the new records and then update to match the new form definition
       */
    DB_query("DELETE FROM {$_TABLES['nxform_fields']} WHERE formid='{$cntr}'");
    next($_SQL);
    // Increment to the field definition records
    for ($i = 1; $i < count($_SQL); $i++) {
        DB_query(current($_SQL), '1');
        if (DB_error()) {
            COM_errorLog("executing " . current($_SQL));
            COM_errorLog("Error executing SQL", 1);
            exit;
        }
        next($_SQL);
    }
    DB_query("UPDATE {$_TABLES['nxform_fields']} set formid='{$newformid}' WHERE formid='{$cntr}'");
    // Need to cycle thru the fields now and update any fieldnames if auto fieldname used
    $query = DB_query("SELECT id,type FROM {$_TABLES['nxform_fields']} WHERE formid='{$newformid}' AND field_name LIKE '%_frm%'");
    while (list($fieldid, $fieldtype) = DB_fetchArray($query)) {
        $fieldname = "{$CONF_FE['fieldtypes'][$fieldtype][0]}{$newformid}_{$fieldid}";
        DB_query("UPDATE {$_TABLES['nxform_fields']} set field_name='{$fieldname}' WHERE id='{$fieldid}'");
    }
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:32,代码来源:import.php

示例4: update_150_to_151

function update_150_to_151()
{
    global $_TABLES, $_CONF, $_SP_CONF;
    $P_SQL = array();
    $P_SQL[] = "ALTER TABLE {$_TABLES['staticpage']} ADD sp_search tinyint(4) NOT NULL default '1' AFTER postmode";
    // allow searching on all existing static pages
    $P_SQL[] = "UPDATE {$_TABLES['staticpage']} SET sp_search = 1";
    $P_SQL[] = "UPDATE {$_TABLES['plugins']} SET pi_version = '1.5.1', pi_gl_version = '1.1.0', pi_homepage='http://www.glfusion.org' WHERE pi_name = 'staticpages'";
    foreach ($P_SQL as $sql) {
        $rst = DB_query($sql, 1);
        if (DB_error()) {
            COM_errorLog("StaticPage Update Error: Could not execute the following SQL: " . $sql);
            return false;
        }
    }
    $res = DB_query("SELECT * FROM {$_TABLES['vars']} WHERE name='sp_fix_01'");
    if (DB_numRows($res) < 1) {
        $sql = "SELECT * FROM {$_TABLES['staticpage']}";
        $result = DB_query($sql);
        while ($A = DB_fetchArray($result)) {
            $newcontent = stripslashes($A['sp_content']);
            $newcontent = mysql_real_escape_string($newcontent);
            DB_query("UPDATE {$_TABLES['staticpage']} SET sp_content='" . $newcontent . "' WHERE sp_id='" . $A['sp_id'] . "'");
        }
        DB_query("INSERT INTO {$_TABLES['vars']} VALUES ('sp_fix_01', 1)", 1);
    }
    return true;
}
开发者ID:NewRoute,项目名称:glfusion,代码行数:28,代码来源:upgrade.php

示例5: update_tables

function update_tables()
{
    global $_TABLES;
    global $_CONF;
    //マスタのデータ
    $_SQL = array();
    //=====SQL 定義 ココから
    //  更新が必要なところの条件を変更して使用してください
    if (1 === 0) {
        //カテゴリ定義に親カテゴリIDとグループID追加
        $_SQL[] = "\n\t\tCREATE TABLE {$_TABLES['DATABOX_def_fieldset']} (\n\t\t`fieldset_id` int(11) NOT NULL,\n\t\t`name` varchar(64) NOT NULL,\n\t\t`description` mediumtext,\n\t\t`udatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t`uuid` mediumint(8) NOT NULL,\n\t\tPRIMARY KEY (`fieldset_id`)\n\t\t) ENGINE=MyISAM\n\t\t";
        //属性セット関連
        $_SQL[] = "\n\t\tCREATE TABLE {$_TABLES['DATABOX_def_fieldset_assignments']} (\n\t\t`seq` int(11) NOT NULL AUTO_INCREMENT,\n\t\t`fieldset_id` int(11) NOT NULL,\n\t\t`field_id` int(11) NOT NULL,\n\t\tPRIMARY KEY (`seq`),\n\t\tKEY `fieldset_id` (`fieldset_id`)\n\t\t) ENGINE=MyISAM\n\t\t";
        $_SQL[] = "\n        ALTER TABLE {$_TABLES['DATABOX_base']}\n\t\tADD `fieldset_id` int(11) NOT NULL default 0 AFTER `orderno`,\n       ";
    }
    //=====SQL 定義 ココまで
    //------------------------------------------------------------------
    for ($i = 1; $i <= count($_SQL); $i++) {
        $w = current($_SQL);
        DB_query(current($_SQL));
        next($_SQL);
    }
    if (DB_error()) {
        COM_errorLog("error DataBox table update ", 1);
        return false;
    }
    COM_errorLog("Success - DataBox table update", 1);
    return "end";
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:29,代码来源:updatetable0509.php

示例6: ReSize

 /**
  *  Resize an image to the specified dimensions, placing the resulting
  *  image in the specified location.  At least one of $newWidth or
  *  $newHeight must be specified.
  *
  *  @param  string  $type       Either 'thumb' or 'disp'
  *  @param  integer $newWidth   New width, in pixels
  *  @param  integer $newHeight  New height, in pixels
  *  @return string  Blank if successful, error message otherwise.
  */
 public static function ReSize($src, $dst, $newWidth = 0, $newHeight = 0)
 {
     global $_LGLIB_CONF;
     // Calculate the new dimensions
     $A = self::reDim($src, $newWidth, $newHeight);
     if ($A === false) {
         COM_errorLog("Invalid image {$src}");
         return 'invalid image conversion';
     }
     list($sWidth, $sHeight, $dWidth, $dHeight) = $A;
     // Get the mime type for the glFusion resizing functions
     $mime_type = image_type_to_mime_type(exif_imagetype($src));
     // Returns an array, with [0] either true/false and [1]
     // containing a message.
     $result = array();
     if (function_exists(_img_resizeImage)) {
         $result = _img_resizeImage($src, $dst, $sHeight, $sWidth, $dHeight, $dWidth, $mime_type);
     } else {
         $result[0] = false;
     }
     if ($result[0] == true) {
         return '';
     } else {
         COM_errorLog("Failed to convert {$src} ({$sHeight} x {$sWidth}) to {$dst} ({$dHeight} x {$dWidth})");
         return 'invalid image conversion';
     }
 }
开发者ID:NewRoute,项目名称:lglib,代码行数:37,代码来源:image.class.php

示例7: nf_check4files

function nf_check4files($projectid, $taskid, $fieldname)
{
    global $_FILES, $_CONF, $_TABLES, $_USER, $CONF_NF, $LANG_GF00;
    $errmsg = '';
    $uploadfile = $_FILES[$fieldname];
    // Check if there is a request to delete any attachments
    if (isset($_POST['chk_removeattachment'])) {
        foreach ($_POST['chk_removeattachment'] as $id) {
            $filename = DB_getItem($_TABLES['nf_projectattachments'], 'filename', "id={$id}");
            $parts = explode(':', $filename);
            COM_errorLog("{$CONF_NF['uploadpath']}/{$parts[0]}");
            DB_query("DELETE FROM {$_TABLES['nf_projectattachments']} WHERE id={$id}");
            @unlink("{$CONF_NF['uploadpath']}/{$parts[0]}");
        }
    }
    if ($uploadfile['name'] != '') {
        $uploadfilename = ppRandomFilename();
        $pos = strrpos($uploadfile['name'], '.') + 1;
        $ext = strtolower(substr($uploadfile['name'], $pos));
        $filename = "{$uploadfilename}.{$ext}";
        COM_errorlog("Workflow file upload: Original file: {$uploadfile['name']} and new filename: {$filename}");
        $filestore_path = $CONF_NF['uploadpath'];
        if (nf_uploadfile($filename, $uploadfile, $CONF_NF['allowablefiletypes'], $filestore_path)) {
            // Store both the created filename and the real file source filename
            $filename = "{$filename}:{$uploadfile['name']}";
            DB_query("INSERT INTO {$_TABLES['nf_projectattachments']} (project_id,task_id,fieldname,filename)\r\n                    VALUES ({$projectid},{$taskid},'{$fieldname}','{$filename}')");
        } else {
            COM_errorlog("upload error:" . $GLOBALS['nf_errmsg']);
            $errmsg = $GLOBALS['nf_errmsg'];
        }
    }
    return $errmsg;
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:33,代码来源:libuploadfiles.php

示例8: setSystemTimeZone

 /**
  * Set the system's timezone
  *
  * @param    string  $tz     timezone to set; use $_CONF['timezone'] if empty
  * @return   void
  * @static
  *
  */
 public static function setSystemTimeZone($tz = '')
 {
     global $_CONF;
     static $system_timezone = '';
     if (empty($tz) && !empty($_CONF['timezone'])) {
         $tz = $_CONF['timezone'];
     }
     if (!empty($tz)) {
         if ($tz != $system_timezone) {
             if (function_exists('date_default_timezone_set')) {
                 if (!@date_default_timezone_set($tz)) {
                     date_default_timezone_set('UTC');
                     COM_errorLog("Timezone '{$tz}' not valid - using 'UTC' instead", 1);
                     $system_timezone = 'UTC';
                 } else {
                     $system_timezone = $tz;
                 }
             } elseif (!ini_get('safe_mode') && function_exists('putenv')) {
                 // aka "Timezone Hack"
                 putenv('TZ=' . $tz);
                 $system_timezone = $tz;
             }
         }
     } elseif (function_exists('date_default_timezone_get')) {
         // this is not ideal but will stop PHP 5.3.0ff from complaining ...
         $system_timezone = @date_default_timezone_get();
         date_default_timezone_set($system_timezone);
     }
 }
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:37,代码来源:timezoneconfig.class.php

示例9: plugin_load_configuration_external

/**
* Loads the configuration records for the Online Config Manager
* @return   boolean     true = proceed with install, false = an error occured
*/
function plugin_load_configuration_external()
{
    global $_CONF, $_CONF_EXP, $_TABLES;
    COM_errorLog("Loading the configuration for the External plugin", 1);
    require_once $_CONF['path'] . 'plugins/' . $_CONF_EXP['pi_name'] . '/install_defaults.php';
    // Get the admin group ID that was saved previously.
    $group_id = (int) DB_getItem($_TABLES['groups'], 'grp_id', "grp_name='{$_CONF_EXP['pi_name']} Admin'");
    return plugin_initconfig_external($group_id);
}
开发者ID:JohnToro,项目名称:external,代码行数:13,代码来源:autoinstall.php

示例10: plugin_install_lglib

/**
*   Puts the datastructures for this plugin into the glFusion database
*   Note: Corresponding uninstall routine is in functions.inc
*
*   @return boolean     True if successful False otherwise
*/
function plugin_install_lglib()
{
    global $INSTALL_plugin, $_LGLIB_CONF;
    COM_errorLog("Attempting to install the {$_LGLIB_CONF['pi_name']} plugin", 1);
    $ret = INSTALLER_install($INSTALL_plugin[$_LGLIB_CONF['pi_name']]);
    if ($ret > 0) {
        return false;
    } else {
        return true;
    }
}
开发者ID:NewRoute,项目名称:lglib,代码行数:17,代码来源:autoinstall.php

示例11: plugin_install_mediagallery

/**
* Puts the datastructures for this plugin into the glFusion database
*
* Note: Corresponding uninstall routine is in functions.inc
*
* @return   boolean True if successful False otherwise
*
*/
function plugin_install_mediagallery()
{
    global $INSTALL_plugin, $_MG_CONF;
    $pi_name = $_MG_CONF['pi_name'];
    $pi_display_name = $_MG_CONF['pi_display_name'];
    $pi_version = $_MG_CONF['pi_version'];
    COM_errorLog("Attempting to install the {$pi_display_name} plugin", 1);
    $ret = INSTALLER_install($INSTALL_plugin[$pi_name]);
    if ($ret > 0) {
        return false;
    }
    return true;
}
开发者ID:NewRoute,项目名称:glfusion,代码行数:21,代码来源:autoinstall.php

示例12: plugin_install_filemgmt

/**
* Puts the datastructures for this plugin into the glFusion database
*
* Note: Corresponding uninstall routine is in functions.inc
*
* @return   boolean True if successful False otherwise
*
*/
function plugin_install_filemgmt()
{
    global $INSTALL_plugin, $CONF_FM;
    $pi_name = $CONF_FM['pi_name'];
    $pi_display_name = $CONF_FM['pi_display_name'];
    $pi_version = $CONF_FM['pi_version'];
    COM_errorLog("Attempting to install the {$pi_display_name} plugin", 1);
    $ret = INSTALLER_install($INSTALL_plugin[$pi_name]);
    if ($ret > 0) {
        return false;
    }
    return true;
}
开发者ID:NewRoute,项目名称:glfusion,代码行数:21,代码来源:autoinstall.php

示例13: plugin_install_classifieds

/**
*   Puts the datastructures for this plugin into the glFusion database.
*   Note: Corresponding uninstall routine is in functions.inc.
*
*   @return boolean     True if successful, False otherwise
*/
function plugin_install_classifieds()
{
    global $INSTALL_plugin, $_CONF_ADVT;
    $pi_name = $_CONF_ADVT['pi_name'];
    $pi_display_name = $_CONF_ADVT['pi_display_name'];
    $pi_version = $_CONF_ADVT['pi_version'];
    COM_errorLog("Attempting to install the {$pi_display_name} plugin", 1);
    $ret = INSTALLER_install($INSTALL_plugin[$pi_name]);
    if ($ret > 0) {
        return false;
    }
    return true;
}
开发者ID:NewRoute,项目名称:classifieds,代码行数:19,代码来源:autoinstall.php

示例14: MG_approveSubmission

function MG_approveSubmission($media_id)
{
    global $_CONF, $_TABLES, $LANG_MG01;
    $mid = addslashes($media_id);
    $owner_uid = DB_getItem($_TABLES['mg_mediaqueue'], 'media_user_id', "media_id='" . $mid . "'");
    DB_delete($_TABLES['mg_mediaqueue'], 'media_id', $mid);
    $album_id = DB_getItem($_TABLES['mg_media_album_queue'], 'album_id', "media_id='" . $mid . "'");
    DB_save($_TABLES['mg_media_albums'], 'album_id, media_id, media_order', "{$album_id}, '{$mid}', 0");
    require_once $_CONF['path'] . 'plugins/mediagallery/include/sort.php';
    MG_SortMedia($album_id);
    DB_delete($_TABLES['mg_media_album_queue'], 'media_id', $mid);
    $sql = "SELECT media_filename, media_type " . "FROM {$_TABLES['mg_media']} WHERE media_id='" . $mid . "'";
    $result = DB_query($sql);
    list($media_filename, $media_type) = DB_fetchArray($result);
    $media_count = DB_getItem($_TABLES['mg_albums'], 'media_count', 'album_id=' . $album_id);
    $media_count++;
    DB_change($_TABLES['mg_albums'], 'media_count', $media_count, 'album_id', $album_id);
    MG_updateAlbumLastUpdate($album_id);
    $album_cover = DB_getItem($_TABLES['mg_albums'], 'album_cover', 'album_id=' . $album_id);
    if ($album_cover == -1 && $media_type == 0) {
        DB_change($_TABLES['mg_albums'], 'album_cover_filename', $media_filename, 'album_id', $album_id);
    }
    // email the owner / uploader that the item has been approved.
    COM_clearSpeedlimit(600, 'mgapprove');
    $last = COM_checkSpeedlimit('mgapprove');
    if ($last == 0) {
        $result2 = DB_query("SELECT username, fullname, email FROM {$_TABLES['users']} WHERE uid='" . $owner_uid . "'");
        list($username, $fullname, $email) = DB_fetchArray($result2);
        if ($email != '') {
            $subject = $LANG_MG01['upload_approved'];
            $body = $LANG_MG01['upload_approved'];
            $body .= '<br' . XHTML . '><br' . XHTML . '>';
            $body .= $LANG_MG01['thanks_submit'];
            $body .= '<br' . XHTML . '><br' . XHTML . '>';
            $body .= $_CONF['site_name'] . '<br' . XHTML . '>';
            $body .= $_CONF['site_url'] . '<br' . XHTML . '>';
            $to = array();
            $from = array();
            $to = COM_formatEmailAddress($username, $email);
            $from = COM_formatEmailAddress($_CONF['site_name'], $_CONF['site_mail']);
            if (!COM_mail($to, $subject, $body, $from, true)) {
                COM_errorLog("Media Gallery Error - Unable to send queue notification email");
            }
            COM_updateSpeedlimit('mgapprove');
        }
    }
    // PLG_itemSaved($media_id, 'mediagallery');
    // COM_rdfUpToDateCheck();
    // COM_olderStuff();
    return;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:51,代码来源:moderate.php

示例15: COM_errorLog

 /**
  * Return an instance of a report formatter class
  *
  * @param  string  $type     Name of the formatter
  * @return mixed Instance of the formatter object.
  */
 function &factory($type)
 {
     $classfile = "format/{$type}.class.php";
     if (include_once $classfile) {
         $class = "{$type}_format";
         if (class_exists($class)) {
             $object =& new $class($options);
             return $object;
         } else {
             COM_errorLog("report.class - Unable to instantiate class {$class} from {$classfile}");
         }
     } else {
         COM_errorLog("report.class - Unable to include file: {$classfile}");
     }
 }
开发者ID:hostellerie,项目名称:nexpro,代码行数:21,代码来源:formatter.class.php


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