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

PHP writeErrorLog函数代码示例

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

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



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

示例1: addProduct

 public function addProduct($product)
 {
     if ($product->yourprice > 0) {
         $this->prods[$product->productid] = $product;
     } else {
         writeErrorLog('Won\'t add a line-item with a price <= 0 for: ', $product->productid);
     }
 }
开发者ID:EScuba,项目名称:RSD,代码行数:8,代码来源:fieldpricer.inc.php


示例2: createDBInstance

 public function createDBInstance()
 {
     // always use the db version, no support for the simple file based storage
     include CARTREVISION . '/phphosted/fbase.cls.php';
     if (!class_exists('HostedFBase')) {
         writeErrorLog('Tried to include "phphosted/fbase.cls.php", but "HostedFBase" still doesn\'t exist.');
         return false;
     }
     return new HostedFBase(TTRANS);
 }
开发者ID:EScuba,项目名称:RSD,代码行数:10,代码来源:transactionlogger.cls.php


示例3: _do_call

 function _do_call($fields = '')
 {
     if (!$this->base_url) {
         return;
     }
     curl_setopt($this->curl, CURLOPT_URL, $this->base_url);
     curl_setopt($this->curl, CURLOPT_POSTFIELDS, $this->base_fields . $fields);
     curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, 1);
     // ensure the page won't wait too long
     $response = curl_exec($this->curl);
     if (curl_errno($this->curl)) {
         $effurl = curl_getinfo($this->curl, CURLINFO_EFFECTIVE_URL);
         writeErrorLog('Stats Reporter error - ' . curl_errno($this->curl) . ': ' . curl_error($this->curl), $effurl . '   ' . $this->base_fields . $fields);
         return false;
     }
     #echo $this->base_fields;
     #writeErrorLog( 'Stats Reporter success - ' . $response, $fields );
     return true;
 }
开发者ID:EScuba,项目名称:RSD,代码行数:19,代码来源:statsreporter.cls.php


示例4: _Connect

 private function _Connect()
 {
     // connect to the database
     if ($this->db === false) {
         if (Config::GetInstance()->sdrive) {
             $this->db = new DataAccessSQLite('save_sqlite');
             // attach the transaction database if the form uses payments
             if (Config::GetInstance()->UsePayments()) {
                 $dbfile = TransactionLogger::GetInstance()->GetSqliteFile();
                 if (empty($dbfile) || !file_exists($dbfile)) {
                     writeErrorLog('Tried to attach transaction log, but file is not defined or doesn\'t exist:', $dbfile);
                 } else {
                     $this->transacts = $this->db->AttachTransActions($dbfile);
                 }
             }
         } else {
             $this->db = new DataAccessMySQL('save_database');
         }
     }
 }
开发者ID:EScuba,项目名称:RSD,代码行数:20,代码来源:dashboarddata.cls.php


示例5: _CheckSubmitLimitReset

 private function _CheckSubmitLimitReset()
 {
     $upgrade_date = Config::GetInstance()->getSubmitLimitUpgradeDate();
     if ($upgrade_date && $upgrade_date != $this->GetSetting(FB_SETTING_SUBMITLIMIT)) {
         // store the new date so that we know if it changed or not
         $this->SetSetting(array(FB_SETTING_SUBMITLIMIT => $upgrade_date));
         // clear the flags for the month that the date is set
         $qry = 'UPDATE ' . $this->_EscapeName($this->table) . ' SET _flags_ = _flags_&' . ~FLAG_OVERSUBMITLIMIT . ' WHERE strftime(\'%Y-%m\', _submitted_) = \'' . substr($upgrade_date, 0, 7) . '\';';
         $count = $this->db->exec($qry);
     }
     if ($count === false) {
         writeErrorLog(__METHOD__, $this->db->errorInfo());
         return 0;
     }
     return $count;
 }
开发者ID:EScuba,项目名称:RSD,代码行数:16,代码来源:datasavesqlite.cls.php


示例6: _MoveFile

 function _MoveFile($fieldname, $filedata)
 {
     $fp = fopen($filedata['tmp_name'], 'r');
     $content = fread($fp, $filedata['size']);
     $sql = 'INSERT INTO ' . $this->_EscapeName($this->table . CC_FB_FILEUPLOAD_EXT) . ' (name, fdata) VALUES (?,?)';
     $sth = $this->db->prepare($sql);
     if ($sth === false) {
         writeErrorLog('Failed compile query:', $sql);
     } else {
         if (!$sth->execute(array($fieldname, $content))) {
             writeErrorLog('Failed to insert file data:', $sth->errorInfo());
         } else {
             // remember the id
             $res = $this->db->query('SELECT LAST_INSERT_ID();');
             if ($res !== false) {
                 $this->stored_file_rowids[] = $res->fetchColumn(0);
                 $res->closeCursor();
             }
         }
     }
 }
开发者ID:EScuba,项目名称:RSD,代码行数:21,代码来源:datasavemysql.cls.php


示例7: writeErrorLog

@(include_once 'SdriveConfig.php');
// initialize the singleton with the form-name
// the global $myPage is used in older code, don't remove it!
$myPage = FormPage::GetInstance($myName);
if (isset($sdrive_config)) {
    $errorLoggingType = 0;
    // better send writeErrorLog output to the server log
    // $myPage->sdrive is initialized to false
    Config::GetInstance()->LoadConfig($sdrive_config);
    if (isset($sdrive_model)) {
        Config::GetInstance()->sdrive_model = $sdrive_model;
    }
    // on S-Drive the cart scripts are taken directly from the resources
    $buildnum = Config::GetInstance()->GetConfig('resource_version');
    if (!$buildnum) {
        writeErrorLog('Parameter missing or empty in form.cfg.dat', 'resource_version');
    }
    $cartpath = CC_HOSTING_RESOURCES . DIRECTORY_SEPARATOR . 'FB' . DIRECTORY_SEPARATOR . $buildnum . DIRECTORY_SEPARATOR . 'fb';
    set_include_path(get_include_path() . PATH_SEPARATOR . $cartpath);
    // add this constant to the file names to include instead of adding it to the include path
    // as a type of name spacing
    define('CARTREVISION', 'cartapp');
} else {
    // A version number is added to the folder name for forward compatibility. FB increments this
    // number if changes are NOT backward compatible. FB must also create the corrresponding
    // folder (leaving the old folder for forms made and uploaded with a previous version).
    define('CARTREVISION', 'cartapp_v1');
    Config::GetInstance()->LoadConfig();
}
// catch warnings with our own error handler to ignore them as appropriate
set_error_handler('myErrorHandler', E_WARNING);
开发者ID:EScuba,项目名称:RSD,代码行数:31,代码来源:config.inc.php


示例8: sqlGetServerStats

function sqlGetServerStats($mySQLiConn)
{
    $ServerStats["GameID"] = 0;
    $ServerStats["ServerState"] = 0;
    $ServerStats["SessionStart"] = 0;
    $ServerStats["SessionID"] = 0;
    $ServerStats["SessionState"] = 0;
    $ServerStats["SessionTime"] = 0;
    $ServerStats["SessionEnd"] = 0;
    $ServerStats["CurLaps"] = 0;
    $ServerStats["MaxLaps"] = 0;
    $ServerStats["NumVehicles"] = 0;
    $ServerStats["TrackName"] = "No Session";
    $ServerStats["AmbientTemp"] = 0;
    $ServerStats["TrackTemp"] = 0;
    if (!$mySQLiConn->connect_error) {
        $selectSessionInfos = "SELECT SQL_CACHE * FROM `sessioninfos` LIMIT 1";
        if ($resultSessionInfos = $mySQLiConn->query($selectSessionInfos)) {
            if ($resultSessionInfos->num_rows == 1) {
                while ($rowSessionInfos = $resultSessionInfos->fetch_assoc()) {
                    $ServerStats["GameID"] = $rowSessionInfos["GameID"];
                    $ServerStats["ServerState"] = $rowSessionInfos["ServerState"];
                    $ServerStats["SessionStart"] = $rowSessionInfos["SessionStart"];
                    $ServerStats["SessionID"] = $rowSessionInfos["SessionID"];
                    $ServerStats["SessionState"] = $rowSessionInfos["SessionState"];
                    $ServerStats["SessionTime"] = $rowSessionInfos["SessionTime"];
                    $ServerStats["SessionEnd"] = $rowSessionInfos["SessionEnd"];
                    $ServerStats["CurLaps"] = $rowSessionInfos["CurLaps"];
                    $ServerStats["MaxLaps"] = $rowSessionInfos["MaxLaps"];
                    $ServerStats["NumVehicles"] = $rowSessionInfos["NumVehicles"];
                    $ServerStats["TrackName"] = $rowSessionInfos["TrackName"];
                    $ServerStats["AmbientTemp"] = $rowSessionInfos["AmbientTemp"];
                    $ServerStats["TrackTemp"] = $rowSessionInfos["TrackTemp"];
                }
            }
            $resultSessionInfos->free();
        } else {
            writeErrorLog("inc.common.php", "sqlGetServerStats()", "Error: (" . $mySQLiConn->error . ") Query: (" . $selectSessionInfos . ")");
        }
    } else {
        writeErrorLog("inc.common.php", "sqlGetServerStats()", "Error: (" . $mySQLiConn->connect_error . ")");
    }
    return $ServerStats;
}
开发者ID:knackko,项目名称:vmliveview_bs,代码行数:44,代码来源:inc.common.php


示例9: _Archive

 function _Archive()
 {
     $i = 1;
     do {
         $newname = str_replace('.', $i . '.', $this->output_file);
         $i++;
     } while (file_exists($newname));
     if (!rename($this->output_file, $newname)) {
         writeErrorLog('Failed to archive ' . $this->output_file . ' to:', $newname);
         $this->errors[] = array('err' => _T('Failed to archive data file.'));
         return false;
     }
     return true;
 }
开发者ID:EScuba,项目名称:RSD,代码行数:14,代码来源:datasavecsv.cls.php


示例10: SaveUploadAsFile

function SaveUploadAsFile($dest, $filedata)
{
    if (!is_dir($dest) && !mkdir($dest, 0755, true)) {
        writeErrorLog('Could not create file upload directory \'' . $dest . '\'');
        return false;
    }
    // filename may or may not have an extension that must be preserved
    $pos = strrpos($filedata['name'], '.');
    $basename = $filedata['name'];
    // replace any dots left with a _ for scripts diguised as an image (e.g. exploit-db.php.jpg)
    if ($pos !== false) {
        $tmp = substr($basename, 0, $pos);
        $basename = str_replace('.', '_', $tmp) . substr($basename, $pos);
    }
    // try the org name first, only if it exists add the random string
    $uploadname = $basename;
    while (file_exists($dest . $uploadname)) {
        $rand = makeRandomString();
        if ($pos === false) {
            $uploadname = $basename . '_' . $rand;
        } else {
            $uploadname = substr($basename, 0, $pos) . '_' . $rand . substr($basename, $pos);
        }
    }
    if (empty($filedata['tmp_name'])) {
        writeErrorLog('Could not move uploaded file because the tmp_name is empty.');
        return false;
    }
    $rc = move_uploaded_file($filedata["tmp_name"], $dest . $uploadname);
    if ($rc) {
        return $uploadname;
    }
    writeErrorLog('Moving file ' . $filedata['tmp_name'] . ' to ' . $uploadname . ' failed.');
    return false;
}
开发者ID:Methunter,项目名称:agency,代码行数:35,代码来源:utilities.inc.php


示例11: _SubstituteAddress

 function _SubstituteAddress($name)
 {
     $matches = array();
     $r = preg_match_all('\'\\[([^\\]]+)\\]\'', $name, $matches, PREG_PATTERN_ORDER);
     if ($r === false) {
         writeErrorLog('Error in regex parsing:', $name);
     }
     if (!$r) {
         return trim($name);
     }
     foreach ($matches[1] as $match) {
         // check if this is an email field and get its value if it is
         $match = strtolower($match);
         if ((Config::GetInstance()->GetConfig('rules', $match, 'fieldtype') == 'email' || Config::GetInstance()->GetConfig('rules', $match, 'contactList')) && isset(FormPage::GetInstance()->post[$match])) {
             $name = str_ireplace('[' . $match . ']', FormPage::GetInstance()->post[$match], $name);
         }
     }
     return trim($name);
 }
开发者ID:rtw314,项目名称:aardvark,代码行数:19,代码来源:datasavemailer.cls.php


示例12: SetSelection

 function SetSelection($selection, $with_limit_exceeded = -1)
 {
     // don't use any alias field names in this where clause because they won't
     // be defined when counting the records with a select count(*) from ... where ...
     switch ((int) $with_limit_exceeded) {
         case -1:
             $this->where = '1';
             break;
         case 0:
             $this->where = '(_flags_&' . FLAG_OVERSUBMITLIMIT . '=0)';
             break;
         case 1:
             $this->where = '_flags_&' . FLAG_OVERSUBMITLIMIT;
             break;
     }
     if ($selection === false) {
         return true;
     }
     // check the syntax and build a where clause
     // possible formats are:
     //		3days						last 3 days
     //		from20to40					from row 20 to row 40
     //		from2011-07-29 10:27:18to2011-07-30 10:27:18
     //									from date_time to date_time
     //		new							rows that don't have the _read_ flag set
     //		starred						rows that have the _starred_ flag set
     //		1,2,3						rows with ids 1, 2 and 3
     $matches = array();
     if ($selection == 'new') {
         $this->where .= ' AND (_flags_&' . FLAG_READ . ')=0';
     } else {
         if ($selection == 'starred') {
             $this->where .= ' AND _flags_&' . FLAG_STARRED;
         } else {
             if ($selection == 'all') {
                 // nothing needed
             } else {
                 if (preg_match('/(\\d+)days?/', $selection, $matches) == 1) {
                     $start = time() - $matches[1] * 24 * 60 * 60;
                     $this->where .= ' AND _submitted_ >=\'' . date('Y-m-d', $start) . ' 00:00:00\'';
                 } else {
                     if (preg_match('/from(\\d+)to(\\d+)/', $selection, $matches) == 1) {
                         $this->where .= ' AND _rowid_>=' . $matches[1] . ' AND ' . '_rowid_<=' . $matches[2];
                     } else {
                         if (preg_match('/from([ \\d-:]+)to([ \\d-:]+)/', $selection, $matches) == 1) {
                             $this->where .= ' AND _submitted_ >=\'' . Config::GetInstance()->MakeUTC($matches[1]) . '\' AND _submitted_ <\'' . Config::GetInstance()->MakeUTC($matches[2]) . '\'';
                         } else {
                             if (preg_match('/[\\d,]/', $selection)) {
                                 $this->where .= ' AND rowid IN (' . $selection . ')';
                             } else {
                                 writeErrorLog('Failed to interpret record selector:', $selection);
                                 $this->error = 'Failed to interpret record selector. Allowed formats are: "all", "4,6,7", "new", "starred", "3days", "from20to40" and "from2011-07-29 10:27:18to2011-07-30 10:27:18"';
                                 return false;
                             }
                         }
                     }
                 }
             }
         }
     }
     return true;
 }
开发者ID:EScuba,项目名称:RSD,代码行数:62,代码来源:datareporter.cls.php


示例13: _makePublicUrl

 private function _makePublicUrl($fieldname, $filename)
 {
     // ensure the publicly visible folder exists
     if (!file_exists(Config::GetInstance()->getStorageFolder(4))) {
         mkdir(Config::GetInstance()->getStorageFolder(4));
     }
     // use the rules to find out where the file is
     if (Config::GetInstance()->GetRulePropertyByName($fieldname, 'files') == true) {
         if (!copy(Config::GetInstance()->getStorageFolder(1) . $filename, Config::GetInstance()->getStorageFolder(4) . $filename)) {
             writeErrorLog('MailChimp plugin couldn\'t copy the uploaded file to a public folder', $filename);
             $this->setError(_T('Failed to copy the uploaded file %s to a publicly visible folder.', $filename));
             return;
         }
     } else {
         // look for it in the uploads table
         if (isset($_FILES[$fieldname]) && file_exists($_FILES[$fieldname]['tmp_name'])) {
             $filename = SaveUploadAsFile(Config::GetInstance()->getStorageFolder(4), $_FILES[$fieldname]);
             if ($filename == false) {
                 writeErrorLog('MailChimp plugin couldn\'t move the uploaded file to a public folder', $filename);
                 $this->setError(_T('Failed to move the uploaded file %s to a publicly visible folder.', $filename));
                 return;
             }
         }
     }
     $servername = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];
     $path = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF'];
     $path = substr($path, 0, strrpos($path, '/'));
     // encode the folders, not the '/'!
     $tmp = explode('/', $path);
     for ($i = 0; $i < count($tmp); ++$i) {
         $tmp[$i] = rawurlencode($tmp[$i]);
     }
     $path = implode('/', $tmp);
     // windows servers may set [HTTPS] => off, linux server usually don't set [HTTPS] at all
     if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
         $protocol = 'https';
     } else {
         $protocol = 'http';
     }
     $url = $protocol . '://' . $servername;
     // only add the serverport when it differs from the default
     if (strpos($servername, ':') === false && ($_SERVER['SERVER_PORT'] != '80' || $protocol != 'http')) {
         $url .= ':' . $_SERVER['SERVER_PORT'];
     }
     return $url . $path . '/' . FormPage::GetInstance()->GetFormName() . CC_FB_STORAGE_FOLDER . CC_FB_PUBLIC_DIRECTORY . $filename;
 }
开发者ID:EScuba,项目名称:RSD,代码行数:46,代码来源:mailchimp.cls.php


示例14: callBack

 public function callBack()
 {
     $callback_data = $this->input['data'];
     $shift = json_decode(html_entity_decode($callback_data), 1);
     /*****************************根据时移反馈的信息,更新时移日志的状态*******************************/
     $sql = 'SELECT * FROM ' . DB_PREFIX . 'time_shift_log WHERE id = ' . (int) $shift['id'];
     $shift_info = $this->db->query_first($sql);
     if (empty($shift_info)) {
         $this->errorOutput('时移数据不存在');
     }
     if ($shift) {
         switch ($shift['exit_status']) {
             case 0:
                 $status = 0;
                 break;
             case 1:
                 $status = 1;
                 break;
         }
         //更新时移状态
         $this->mode->update($shift['id'], array('status' => $status));
     }
     if (!$status) {
         writeErrorLog("时移失败:\n" . var_export($shift, 1));
         $this->errorOutput('时移失败');
     }
     /*****************************根据时移反馈的信息,更新时移日志的状态*******************************/
     /****************************将时移好的视频提交到mediaserver进行转码*****************************/
     if (!$this->settings['App_mediaserver']) {
         $this->errorOutput('未安装mediaserver');
     }
     $curl = new curl($this->settings['App_mediaserver']['host'], $this->settings['App_mediaserver']['dir'] . 'admin/');
     $curl->setSubmitType('post');
     $curl->initPostData();
     //构建需要提交的数据
     $data = array('filepath' => $shift['file_path'], 'vod_sort_id' => $shift['vod_sort_id'], 'vod_leixing' => 3, 'start' => '0', 'duration' => '');
     if ($shift_info['live_split_callback']) {
         $data['app_uniqueid'] = 'live_split_data';
         $data['mod_uniqueid'] = 'live_split_data';
     }
     if (!empty($shift) && $shift['extend']) {
         $shift['extend'] = json_decode(base64_decode($shift['extend']), 1);
         foreach ($shift['extend'] as $k => $v) {
             $curl->addRequestData($k, $v);
         }
     }
     foreach ($data as $k => $v) {
         $curl->addRequestData($k, $v);
     }
     $ret = $curl->request('create.php');
     /****************************将时移好的视频提交到mediaserver进行转码*****************************/
     /****************************提交之后的回调处理************************************************/
     if ($ret && $ret[0]['id']) {
         //更新时移的视频id
         $this->mode->update($shift['id'], array('video_id' => $ret[0]['id']));
         $shift_info['live_split_callback'] && $this->live_split_callback($shift_info['live_split_callback'], $callback_data, $ret[0]['id']);
     } else {
         //时移成功,但是提交mediserver失败
         $this->mode->update($shift['id'], array('status' => 3));
         $shift_info['live_split_callback'] && $this->live_split_callback($shift_info['live_split_callback'], $callback_data, 0);
         writeErrorLog("时移成功,提交转码失败:\n" . var_export($ret, 1));
     }
     $this->addItem($ret);
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:65,代码来源:live_time_shift_callback.php


示例15: AddAttachment

 /**
  * Adds an attachment from a path on the filesystem.
  * Returns false if the file could not be found
  * or accessed.
  * @param string $path Path to the attachment.
  * @param string $name Overrides the attachment name.
  * @param string $encoding File encoding (see $Encoding).
  * @param string $type File extension (MIME) type.
  * @return bool
  */
 public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream')
 {
     try {
         if (!@is_file($path)) {
             throw new phpmailerException($this->Lang('file_access') . $path, self::STOP_CONTINUE);
         }
         $filename = basename($path);
         if ($name == '') {
             $name = $filename;
         }
         $this->attachment[] = array(0 => $path, 1 => $filename, 2 => $name, 3 => $encoding, 4 => $type, 5 => false, 6 => 'attachment', 7 => 0);
     } catch (phpmailerException $e) {
         $this->SetError($e->getMessage());
         if ($this->exceptions) {
             throw $e;
         }
         writeErrorLog($e->getMessage());
         if ($e->getCode() == self::STOP_CRITICAL) {
             return false;
         }
     }
     return true;
 }
开发者ID:EScuba,项目名称:RSD,代码行数:33,代码来源:phpmailer.cls.php


示例16: PrepareInlineMessage

 function PrepareInlineMessage($messagenode, $replaceFormByDiv = false)
 {
     // get the html
     $this->ReadSource();
     $dom = new DOMDocument('1.0', 'UTF-8');
     if ($dom->loadHTML($this->source) === false) {
         writeErrorLog('Failed to parse HTML form.');
         return false;
     }
     // find the container for the message
     $container = $dom->getElementById('fb_confirm_inline');
     if (!$container) {
         writeErrorLog('Parsed HTML form, but can\'t locate element with id "#fb_confirm_inline".');
         return false;
     }
     // remove all child nodes
     while ($container->hasChildNodes()) {
         $container->removeChild($container->firstChild);
     }
     // add our html and change the 'display:none' style to 'display:block'
     $usernode = $dom->importNode($messagenode, true);
     $container->appendChild($usernode);
     $style = str_replace('none', 'block', $container->getAttribute('style'));
     $container->setAttribute('style', $style);
     // remove all siblings, go up to parent ... until we arrive at the form
     do {
         while ($container->previousSibling) {
             $container->parentNode->removeChild($container->previousSibling);
         }
         while ($container->nextSibling) {
             $container->parentNode->removeChild($container->nextSibling);
         }
         $container = $container->parentNode;
     } while ($container->getAttribute('id') != 'docContainer');
     // replace the form by a div container, because forms can't be nested
     if ($replaceFormByDiv) {
         $old = $dom->getElementById('docContainer');
         $new = $dom->createElement('div');
         $new->setAttributeNode($old->getAttributeNode('id'));
         $new->setAttributeNode($old->getAttributeNode('class'));
         if ($old->hasAttribute('style')) {
             $new->setAttributeNode($old->getAttributeNode('style'));
         }
         $new->appendChild($old->firstChild);
         $old->parentNode->replaceChild($new, $old);
     }
     $this->source = $dom->saveHTML();
     return true;
 }
开发者ID:rtw314,项目名称:aardvark,代码行数:49,代码来源:formpage.cls.php


示例17: _loadOriginalPostNames

 private function _loadOriginalPostNames()
 {
     if ($this->fieldnamesloaded) {
         return;
     }
     $this->fieldnamesloaded = true;
     if (!$this->_TableExists(FB_KEYNAMES_TABLE)) {
         return;
     }
     $qry = 'SELECT * FROM ' . FB_KEYNAMES_TABLE . ';';
     $r = $this->db->query($qry);
     if ($r == false) {
         writeErrorLog('Error in query: ' . $qry, $this->db->errorInfo());
         $this->error = implode(' ,', $this->db->errorInfo());
         return;
     }
     while ($row = $r->fetch(PDO::FETCH_ASSOC)) {
         $this->fieldnameMap[$row['colname']] = $row['orgname'];
     }
     $r->closeCursor();
 }
开发者ID:EScuba,项目名称:RSD,代码行数:21,代码来源:dataaccesssqlite.cls.php


示例18: implode

            // 获取管理用户组
            $admin_group_sql = 'SELECT p.* FROM `' . $old_db_conf['DB_PREFIX'] . 'user_group_popedom` AS p LEFT JOIN `' . $old_db_conf['DB_PREFIX'] . 'node` AS n ON p.`node_id` = n.`node_id` WHERE n.`app_name` = \'admin\' AND n.`mod_name` = \'*\' AND n.`act_name` = \'*\'';
            $admin_group_info = $old_db->query($admin_group_sql);
            if (empty($user_group_info) || $user_group_info[0]['user_group_id'] != $admin_group_info[0]['user_group_id']) {
                $user_group_data[] = "(null, '" . $value['uid'] . "', '3')";
            } else {
                if ($user_group_info[0]['user_group_id'] == $admin_group_info[0]['user_group_id']) {
                    $user_group_data[] = "('" . $user_group_info[0]['id'] . "', '" . $user_group_info[0]['uid'] . "', '1')";
                }
            }
        }
        $insert_user = 'INSERT INTO `' . $db_conf['DB_PREFIX'] . 'user` VALUES ' . implode(',', $data);
        $result = $db->execute($insert_user);
        if ($result === false) {
            foreach ($data as $single_value) {
                $result = $single_insert_user = 'INSERT INTO `' . $db_conf['DB_PREFIX'] . 'user` VALUES ' . $single_value;
                $db->execute($single_insert_user);
                if ($result === false) {
                    writeErrorLog($single_insert_user);
                }
            }
        }
        $insert_group_link = 'INSERT INTO `' . $db_conf['DB_PREFIX'] . 'user_group_link` VALUES ' . implode(',', $user_group_data);
        $db->execute($insert_group_link);
        // 跳转操作
        $t = 'user';
        $p = $p + 1;
        echo '<script>window.location.href="' . getJumpUrl($t, $p) . '";</script>';
        exit;
    }
}
开发者ID:yang7hua,项目名称:hunshe,代码行数:31,代码来源:user.php


示例19: create

 public function create()
 {
     /*************权限控制***********************************************/
     if ($this->user['group_type'] > MAX_ADMIN_TYPE) {
         $prms['_action'] = 'create';
         if (!$this->input['item'] || intval($this->input['item']) == -1) {
             $this->input['item'] = 3;
             //不存在默认给的分类是直播归档
         }
         $prms['node'] = $this->input['item'];
         $this->verify_self_prms($prms);
     }
     /*************权限控制***********************************************/
     if (!$this->input['channel_id']) {
         $this->errorOutput(NOID);
     }
     /*************选择时移服务器******************************************/
     $shiftServer = new SelectTimeShiftServer();
     $serverSelected = $shiftServer->select();
     if (!$serverSelected) {
         $this->errorOutput('没有可选择的时移服务器');
     }
     /*************选择时移服务器******************************************/
     /*************检测频道流信息******************************************/
     $condition['id'] = $this->input['channel_id'];
     $condition['fetch_live'] = 1;
     $channel = $this->mLive->getChannelInfo($condition);
     $channel = $channel[0];
     if (!$channel) {
         $this->errorOutput('该频道已经不存在!');
     }
     if (!$channel['status']) {
         $this->errorOutput('该频道流未开启');
     }
     if (!$channel['is_mobile_phone']) {
         $this->errorOutput('该频道未启动手机流,无法获取时移数据!');
     }
     /*************监测频道流信息******************************************/
     /*************时移时间正确性监测***************************************/
     $ret = array();
     $ret['title'] = $this->input['title'] ? $this->input['title'] : '精彩节目';
     $ret['starttime'] = strtotime(trim($this->input['start_time']));
     $ret['endtime'] = strtotime(trim($this->input['end_time']));
     $ret['duration'] = $ret['endtime'] - $ret['starttime'];
     if ($ret['starttime'] >= $ret['endtime']) {
         $this->errorOutput('时间设置不正确!');
     }
     $save_time = TIMENOW - ($channel['time_shift'] * 3600 - $channel['delay']);
     if ($ret['starttime'] < $save_time) {
         $this->errorOutput('此条时移已超过回看时间!');
     }
     if ($ret['endtime'] > TIMENOW) {
         $this->errorOutput('时移节目的结束时间必须小于当前时间!');
     }
     /*************时移时间正确性监测***************************************/
     /*************默认类别***********************************************/
     if (intval($this->input['item']) == -1) {
         $this->input['item'] = 3;
         //如果没有传类别默认给直播归档的类别
     }
     /*************默认类别***********************************************/
     /*********************记录一条时移日志*******************************/
     $shift_log = array('title' => $ret['title'], 'channel_id' => $this->input['channel_id'], 'starttime' => $ret['starttime'], 'endtime' => $ret['endtime'], 'live_split_callback' => (int) $this->input['live_split_callback'], 'status' => 2, 'create_time' => TIMENOW, 'user_id' => $this->user['user_id'], 'user_name' => $this->user['user_name']);
     $shiftLogInfo = $this->mode->create($shift_log);
     $this->addLogs('记录时移日志', '', $shiftLogInfo, $shiftLogInfo['title']);
     /*********************记录一条时移日志*******************************/
     /*********************向时移服务器提交数据****************************/
     $duration = $ret['duration'] . '000';
     $starttime = $ret['starttime'] . '000';
     if ($channel['server_type'] != 'nginx') {
         if (strstr($channel['channel_stream'][0]['m3u8'], '?')) {
             $sp = '&';
         } else {
             $sp = '?';
         }
         $url = $channel['channel_stream'][0]['m3u8'] . $sp . 'dvr&duration=' . $duration . '&starttime=' . $starttime;
     } else {
         $pathinfo = pathinfo($channel['channel_stream'][0]['live_m3u8']);
         $url = $pathinfo['dirname'] . '/' . $channel['main_stream_name'] . '/' . $starttime . ',' . $duration . '.m3u8';
     }
     $callback = $this->input['callback_url'] ? trim($this->input['callback_url']) : $this->settings['App_live_time_shift']['protocol'] . $this->settings['App_live_time_shift']['host'] . '/' . $this->settings['App_live_time_shift']['dir'] . 'admin/live_time_shift_callback.php';
     //构建提交的数据
     $data = array('id' => $shiftLogInfo['id'], 'time_shift' => '1', 'action' => 'TIMESHIFT', 'url' => urlencode($url), 'callback' => $callback, 'uploadFile' => '0', 'appid' => $this->input['appid'], 'appkey' => $this->input['appkey'], 'access_token' => $this->user['token'], 'vod_sort_id' => $this->input['item']);
     //额外传递的参数
     $extend_data = $this->input['dataextend'] ? $this->input['dataextend'] : array('_user_id' => $this->user['user_id'], '_user_name' => $this->user['user_name'], 'audit_auto' => $this->input['audit_auto'], 'column_id' => $this->input['column_id'], 'channel_id' => $this->input['channel_id'], 'force_recodec' => $this->input['force_codec'], 'is_mark' => !$this->input['is_mark'], 'starttime' => $this->input['start_time'], 'delay_time' => $channel['time_shift'], 'title' => $ret['title'], 'program' => $ret['title']);
     $data['extend'] = base64_encode(json_encode($extend_data));
     //开始提交
     $this->curl = new curl($serverSelected['host'] . ':' . $serverSelected['port']);
     foreach ($data as $k => $v) {
         $this->curl->addRequestData($k, $v);
     }
     $shift_xml = $this->curl->request('');
     $xmlobj = @simplexml_load_string($shift_xml);
     if (!$xmlobj || !$xmlobj->attributes()->result) {
         $this->mode->update($shiftLogInfo['id'], array('status' => 0));
         //失败了更新状态
         writeErrorLog("提交时移服务器失败:\n" . var_export($xmlobj, 1));
         $this->errorOutput('提交时移服务器失败');
     }
     /*********************向时移服务器提交数据****************************/
//.........这里部分代码省略.........
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:live_time_shift_update.php


示例20: sprintf

                "[Data: " . sprintf("%.1F" ,((strlen($MonitorData) * 8) / 1000)) . " kBit]" .
                "[Load: " . $currentServerLoad . "]" .
                "</div>\n"; */
        echo $MonitorData;
        // if(file_exists("./monitordata.html") == false){
        // $fh = fopen("./monitordata.html", 'wt');
        // fwrite($fh, "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>\n");
        // fwrite($fh, "<html>\n");
        // fwrite($fh, "<head>\n");
        // fwrite($fh, "<meta http-equiv='content-type' content='text/html; charset=UTF-8'>\n");
        // fwrite($fh, "<title>VM LiveView Lite (Monitor)</title>\n");
        // fwrite($fh, "<link rel='stylesheet' type='text/css' href='http://ftgx.dyndns.org/vmliveview/styles.css'>\n");
        // fwrite($fh, "</head>\n");
        // fwrite($fh, "<body>\n");
        // fwrite($fh, $MonitorData);
        // fwrite($fh, "</body>\n");
        // fwrite($fh, "</html>\n");
        // fclose($fh);
        // }
    } else {
        echo $mySQLiConnError;
    }
    echo "<div class='row'><div class='col-xs-12'>";
    include "inc.copyright.php";
    echo "</div></div>";
} catch (Exception $ex) {
    writeErrorLog($pageName, "General Exception", "Exception Msg: (" . $ex->getMessage() . ")");
}
?>
</div>
开发者ID:knackko,项目名称:vmliveview_bs,代码行数:30,代码来源:monitordata.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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