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

PHP p2die函数代码示例

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

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



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

示例1: deleMsg

/**
 * チェックした書き込み記事を削除する
 *
 * @access  public
 * @return  boolean
 */
function deleMsg($checked_hists)
{
    global $_conf;
    if (!($reslines = file($_conf['p2_res_hist_dat']))) {
        p2die(sprintf('%s を開けませんでした', $_conf['p2_res_hist_dat']));
        return false;
    }
    $reslines = array_map('rtrim', $reslines);
    // ファイルの下に記録されているものが新しいので逆順にする
    $reslines = array_reverse($reslines);
    $neolines = array();
    // チェックして整えて
    if ($reslines) {
        $rmnums = _getRmNums($checked_hists, $reslines);
        $neolines = _rmLine($rmnums, $reslines);
        P2Util::pushInfoHtml("<p>p2 info: " . count($rmnums) . "件のレス記事を削除しました</p>");
    }
    if (is_array($neolines)) {
        // 行順を戻す
        $neolines = array_reverse($neolines);
        $cont = "";
        if ($neolines) {
            $cont = implode("\n", $neolines) . "\n";
        }
        // 書き込み処理
        if (false === FileCtl::filePutRename($_conf['p2_res_hist_dat'], $cont)) {
            $errmsg = sprintf('p2 error: %s(), FileCtl::filePutRename() failed.', __FUNCTION__);
            trigger_error($errmsg, E_USER_WARNING);
            return false;
        }
    }
    return true;
}
开发者ID:poppen,项目名称:p2,代码行数:39,代码来源:read_res_hist.funcs.php


示例2: saveNgAborns

 /**
  * あぼーん&NGワード設定を保存する
  *
  * @param void
  * @return void
  */
 public static function saveNgAborns()
 {
     global $ngaborns, $ngaborns_hits;
     global $_conf;
     $lasttime = date('Y/m/d G:i');
     if ($_conf['ngaborn_daylimit']) {
         $daylimit = time() - 60 * 60 * 24 * $_conf['ngaborn_daylimit'];
     } else {
         $daylimit = 0;
     }
     $errors = '';
     foreach ($ngaborns_hits as $code => $hits) {
         // ヒットしなかった場合でも1/100の確率で古いデータを削除するために処理を続ける
         if (!$hits && mt_rand(1, 100) < 100) {
             continue;
         }
         if (isset($ngaborns[$code]) && !empty($ngaborns[$code]['data'])) {
             // 更新時間でソートする
             usort($ngaborns[$code]['data'], array('NgAbornCtl', 'cmpLastTime'));
             $cont = '';
             foreach ($ngaborns[$code]['data'] as $a_ngaborn) {
                 if (empty($a_ngaborn['lasttime']) || $a_ngaborn['lasttime'] == '--') {
                     // 古いデータを削除する都合上、仮に現在の日時を付与
                     $a_ngaborn['lasttime'] = $lasttime;
                 } else {
                     // 必要ならここで古いデータはスキップ(削除)する
                     if ($daylimit > 0 && strtotime($a_ngaborn['lasttime']) < $daylimit) {
                         continue;
                     }
                 }
                 $cont .= sprintf("%s\t%s\t%d\n", $a_ngaborn['cond'], $a_ngaborn['lasttime'], $a_ngaborn['hits']);
             }
             // foreach
             /*
             echo "<pre>";
             echo $cont;
             echo "</pre>";
             */
             // 書き込む
             $fp = @fopen($ngaborns[$code]['file'], 'wb');
             if (!$fp) {
                 $errors .= "cannot write. ({$ngaborns[$code]['file']})\n";
             } else {
                 flock($fp, LOCK_EX);
                 fputs($fp, $cont);
                 flock($fp, LOCK_UN);
                 fclose($fp);
             }
         }
         // if
     }
     // foreach
     if ($errors !== '') {
         p2die('NGあぼーんファイルが更新できませんでした。', $errors);
     }
 }
开发者ID:unpush,项目名称:p2-php,代码行数:62,代码来源:NgAbornCtl.php


示例3: settaborn_off

/**
 * ■スレッドあぼーんを複数一括解除する
 */
function settaborn_off($host, $bbs, $taborn_off_keys)
{
    if (!$taborn_off_keys) {
        return;
    }
    // p2_threads_aborn.idx のパス取得
    $taborn_idx = P2Util::idxDirOfHostBbs($host, $bbs) . 'p2_threads_aborn.idx';
    // p2_threads_aborn.idx がなければ
    if (!file_exists($taborn_idx)) {
        p2die('あぼーんリストが見つかりませんでした。');
    }
    // p2_threads_aborn.idx 読み込み
    $taborn_lines = FileCtl::file_read_lines($taborn_idx, FILE_IGNORE_NEW_LINES);
    // 指定keyを削除
    foreach ($taborn_off_keys as $val) {
        $neolines = array();
        if ($taborn_lines) {
            foreach ($taborn_lines as $line) {
                $lar = explode('<>', $line);
                if ($lar[1] == $val) {
                    // key発見
                    // echo "key:{$val} のスレッドをあぼーん解除しました。<br>";
                    $kaijo_attayo = true;
                    continue;
                }
                if (!$lar[1]) {
                    continue;
                }
                // keyのないものは不正データ
                $neolines[] = $line;
            }
        }
        $taborn_lines = $neolines;
    }
    // 書き込む
    if (file_exists($taborn_idx)) {
        copy($taborn_idx, $taborn_idx . '.bak');
        // 念のためバックアップ
    }
    $cont = '';
    if (is_array($taborn_lines)) {
        foreach ($taborn_lines as $l) {
            $cont .= $l . "\n";
        }
    }
    if (FileCtl::file_write_contents($taborn_idx, $cont) === false) {
        p2die('cannot write file.');
    }
    /*
    if (!$kaijo_attayo) {
        // echo "指定されたスレッドは既にあぼーんリストに載っていないようです。";
    } else {
        // echo "あぼーん解除、完了しました。";
    }
    */
}
开发者ID:xingskycn,项目名称:p2-php,代码行数:59,代码来源:settaborn_off.inc.php


示例4: editFile

/**
 * ファイル内容を読み込んで編集する関数
 */
function editFile($path, $encode, $title)
{
    global $_conf, $modori_url, $rows, $cols, $csrfid;
    if ($path == '') {
        p2die('path が指定されていません');
    }
    $filename = basename($path);
    $ptitle = 'Edit: ' . p2h($title) . ' (' . $filename . ')';
    //ファイル内容読み込み
    FileCtl::make_datafile($path) or p2die("cannot make file. ({$path})");
    $cont = file_get_contents($path);
    if ($encode == "EUC-JP") {
        $cont = mb_convert_encoding($cont, 'CP932', 'CP51932');
    }
    $cont_area = p2h($cont);
    if ($modori_url) {
        $modori_url_ht = "<p><a href=\"{$modori_url}\">Back</a></p>\n";
    } else {
        $modori_url_ht = '';
    }
    $rows_at = $rows > 0 ? sprintf(' rows="%d"', $rows) : '';
    $cols_at = $cols > 0 ? sprintf(' cols="%d"', $cols) : '';
    // プリント
    echo $_conf['doctype'];
    echo <<<EOHEADER
<html lang="ja">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
    {$_conf['extra_headers_ht']}
    <title>{$ptitle}</title>
</head>
<body onload="top.document.title=self.document.title;">
EOHEADER;
    $info_msg_ht = P2Util::getInfoHtml();
    echo $modori_url_ht;
    echo $ptitle;
    echo <<<EOFORM
<form action="{$_SERVER['SCRIPT_NAME']}" method="post" accept-charset="{$_conf['accept_charset']}">
    <input type="hidden" name="file" value="{$filename}">
    <input type="hidden" name="modori_url" value="{$modori_url}">
    <input type="hidden" name="encode" value="{$encode}">
    <input type="hidden" name="rows" value="{$rows}">
    <input type="hidden" name="cols" value="{$cols}">
    <input type="hidden" name="csrfid" value="{$csrfid}">
    <input type="submit" name="submit" value="Save">
    {$info_msg_ht}<br>
    <textarea style="font-size:9pt;" id="filecont" name="filecont" wrap="off"{$rows_at}{$cols_at}>{$cont_area}</textarea>
    {$_conf['detect_hint_input_ht']}{$_conf['k_input_ht']}
</form>
EOFORM;
    echo '</body></html>';
    return true;
}
开发者ID:xingskycn,项目名称:p2-php,代码行数:59,代码来源:editfile.php


示例5: fetchSubjectTxt

 /**
  * subject.txtの並列ダウンロードを実行する
  *
  * @param string $mode
  * @param array $_conf
  * @return bool
  */
 public static function fetchSubjectTxt($mode, array $_conf)
 {
     // コマンド生成
     $args = array(escapeshellarg($_conf['expack.php_cli_path']));
     if ($_conf['expack.dl_pecl_http']) {
         $args[] = '-d';
         $args[] = 'extension=' . escapeshellarg('http.' . PHP_SHLIB_SUFFIX);
     }
     $args[] = escapeshellarg(P2_CLI_DIR . DIRECTORY_SEPARATOR . 'fetch-subject-txt.php');
     switch ($mode) {
         case 'fav':
         case 'recent':
         case 'res_hist':
         case 'merge_favita':
             $args[] = sprintf('--mode=%s', $mode);
             break;
         default:
             return false;
     }
     if ($_conf['expack.misc.multi_favs']) {
         switch ($mode) {
             case 'fav':
                 $args[] = sprintf('--set=%d', $_conf['m_favlist_set']);
                 break;
             case 'merge_favita':
                 $args[] = sprintf('--set=%d', $_conf['m_favita_set']);
                 break;
         }
     }
     // 標準エラー出力を標準出力にリダイレクト
     $args[] = '2>&1';
     $command = implode(' ', $args);
     //P2Util::pushInfoHtml('<p>' . htmlspecialchars($command, ENT_QUOTES) . '</p>');
     // 実行
     $pipe = popen($command, 'r');
     if (!is_resource($pipe)) {
         p2die('コマンドを実行できませんでした。', $command);
     }
     $output = '';
     while (!feof($pipe)) {
         $output .= fgets($pipe);
     }
     $status = pclose($pipe);
     if ($status != 0) {
         P2Util::pushInfoHtml(sprintf('<p>%s(): ERROR(%d)</p>', __METHOD__, $status));
     }
     if ($output !== '') {
         if ($status == 2) {
             P2Util::pushInfoHtml($output);
         } else {
             P2Util::pushInfoHtml('<p>' . nl2br(htmlspecialchars($output, ENT_QUOTES)) . '</p>');
         }
     }
     return $status == 0;
 }
开发者ID:unpush,项目名称:p2-php,代码行数:62,代码来源:P2CommandRunner.php


示例6: __construct

 /**
  * コンストラクタ
  *
  * @param  string $name     ロック名(≒排他処理したいファイル名)
  * @param  bool   $remove   ロックファイルを自動で削除するかどうか
  * @param  string $suffix   ロックファイル名の接尾辞
  */
 public function __construct($name, $remove = true, $suffix = '.lck')
 {
     $this->_filename = p2_realpath($name . $suffix);
     $this->_remove = $remove;
     FileCtl::mkdirFor($this->_filename);
     $this->_fh = fopen($this->_filename, 'wb');
     if (!$this->_fh) {
         p2die("cannot create lockfile ({$this->_filename}).");
     }
     if (!flock($this->_fh, LOCK_EX)) {
         p2die("cannot get lock ({$this->_filename}).");
     }
 }
开发者ID:xingskycn,项目名称:p2-php,代码行数:20,代码来源:P2Lock.php


示例7: _autoBegin

 /**
  * よりセキュアなセッション管理を開始する
  * @return bool
  */
 private function _autoBegin()
 {
     // まだ強化セッションが始まっていなかったら
     if (!isset($_SESSION[$this->sess_array]['actime'])) {
         // セッション変数($this->sess_array)を初期セット
         $this->_initSess();
         // セッション変数の登録に失敗したら、エラー
         if (!isset($_SESSION[$this->sess_array]['actime'])) {
             trigger_error('Session::_autoBegin() セッション変数を登録できませんでした。', E_USER_WARNING);
             p2die('Session');
             return false;
         }
     }
     return true;
 }
开发者ID:xingskycn,项目名称:p2-php,代码行数:19,代码来源:Session.php


示例8: _getKVS

 /**
  * データを保存するP2KeyValueStoreオブジェクトを取得する
  *
  * @param string $databasePath
  * @param string $codec
  * @param string $tableName
  * @return P2KeyValueStore
  */
 protected static function _getKVS($databasePath, $codec = P2KeyValueStore::CODEC_SERIALIZING, $tableName = null)
 {
     global $_conf;
     $id = $codec . ':' . $databasePath;
     if (array_key_exists($id, self::$_kvs)) {
         return self::$_kvs[$id];
     }
     if (!file_exists($databasePath) && !is_dir(dirname($databasePath))) {
         FileCtl::mkdirFor($databasePath);
     }
     try {
         $kvs = P2KeyValueStore::getStore($databasePath, $codec, $tableName);
         self::$_kvs[$id] = $kvs;
     } catch (Exception $e) {
         p2die(get_class($e) . ': ' . $e->getMessage());
     }
     return $kvs;
 }
开发者ID:unpush,项目名称:p2-php,代码行数:26,代码来源:AbstractDataStore.php


示例9: __construct

 /**
  * コンストラクタ
  */
 public function __construct()
 {
     static $set_to_utf8 = false;
     // 設定の読み込み
     $ini = ic2_loadconfig();
     $this->_ini = $ini;
     if (!$ini['General']['dsn']) {
         p2die('DSNが設定されていません。');
     }
     // データベースへ接続
     $this->_database_dsn = $ini['General']['dsn'];
     $this->_db = $this->getDatabaseConnection();
     if (DB::isError($this->_db)) {
         p2die($this->_db->getMessage());
     }
     // クライアントの文字セットに UTF-8 を指定
     if (!$set_to_utf8) {
         if (preg_match('/^(\\w+)(?:\\((\\w+)\\))?:/', $this->_database_dsn, $m)) {
             $driver = strtolower($m[1]);
         } else {
             $driver = 'unknown';
         }
         switch ($driver) {
             case 'mysql':
             case 'mysqli':
                 if ($driver == 'mysql' && function_exists('mysql_set_charset')) {
                     mysql_set_charset('utf8', $this->_db->connection);
                 } elseif ($driver == 'mysqli' && function_exists('mysqli_set_charset')) {
                     mysqli_set_charset($this->_db->connection, 'utf8');
                 } else {
                     $this->_db->query("SET NAMES utf8");
                 }
                 break;
             case 'pgsql':
                 if (function_exists('pg_set_client_encoding')) {
                     pg_set_client_encoding($this->_db->connection, 'UNICODE');
                 } else {
                     $this->_db->query("SET CLIENT_ENCODING TO 'UNICODE'");
                 }
                 break;
         }
         $set_to_utf8 = true;
     }
 }
开发者ID:xingskycn,项目名称:p2-php,代码行数:47,代码来源:Common.php


示例10: viewTxtFile

/**
 * ファイル内容を読み込んで表示する関数
 */
function viewTxtFile($file, $encode)
{
    if (!$file) {
        p2die('file が指定されていません');
    }
    $filename = basename($file);
    $ptitle = $filename;
    //ファイル内容読み込み
    $cont = FileCtl::file_read_contents(P2_BASE_DIR . DIRECTORY_SEPARATOR . $file);
    if ($cont === false) {
        $cont_area = '';
    } else {
        if (strcasecmp($encode, 'EUC-JP') === 0) {
            $cont = mb_convert_encoding($cont, 'CP932', 'CP51932');
        } elseif (strcasecmp($encode, 'UTF-8') === 0) {
            $cont = mb_convert_encoding($cont, 'CP932', 'UTF-8');
        }
        $cont_area = p2h($cont);
    }
    // プリント
    echo <<<EOHEADER
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
    {$_conf['extra_headers_ht']}
    <title>{$ptitle}</title>
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
</head>
<body onload="top.document.title=self.document.title;">

EOHEADER;
    P2Util::printInfoHtml();
    echo "<pre>";
    echo $cont_area;
    echo "</pre>";
    echo '</body></html>';
    return true;
}
开发者ID:xingskycn,项目名称:p2-php,代码行数:43,代码来源:viewtxt.php


示例11: deleMsg

/**
 * チェックした書き込み記事を削除する
 */
function deleMsg($checked_hists)
{
    global $_conf;
    $lock = new P2Lock($_conf['res_hist_dat'], false);
    // 読み込んで
    $reslines = FileCtl::file_read_lines($_conf['res_hist_dat'], FILE_IGNORE_NEW_LINES);
    if ($reslines === false) {
        p2die("{$_conf['res_hist_dat']} を開けませんでした");
    }
    // ファイルの下に記録されているものが新しいので逆順にする
    $reslines = array_reverse($reslines);
    $neolines = array();
    // チェックして整えて
    if ($reslines) {
        $n = 1;
        foreach ($reslines as $ares) {
            $rar = explode("<>", $ares);
            // 番号と日付が一致するかをチェックする
            if (checkMsgID($checked_hists, $n, $rar[2])) {
                $rmnums[] = $n;
                // 削除する番号を登録
            }
            $n++;
        }
        $neolines = rmLine($rmnums, $reslines);
        P2Util::pushInfoHtml('<p>p2 info: ' . count($rmnums) . '件のレス記事を削除しました</p>');
    }
    if (is_array($neolines)) {
        // 行順を戻す
        $neolines = array_reverse($neolines);
        $cont = "";
        if ($neolines) {
            $cont = implode("\n", $neolines) . "\n";
        }
        // 書き込む
        if (FileCtl::file_write_contents($_conf['res_hist_dat'], $cont) === false) {
            p2die('cannot write file.');
        }
    }
}
开发者ID:xingskycn,项目名称:p2-php,代码行数:43,代码来源:read_res_hist.inc.php


示例12: viewTxtFile

/**
 * ファイル内容を読み込んで表示する関数
 */
function viewTxtFile($file, $encode)
{
    if ($file == '') {
        p2die('file が指定されていません');
    }
    $filename = basename($file);
    $ptitle = $filename;
    //ファイル内容読み込み
    $cont = FileCtl::file_read_contents($file);
    if ($cont === false) {
        $cont_area = '';
    } else {
        if ($encode == 'EUC-JP') {
            $cont = mb_convert_encoding($cont, 'CP932', 'CP51932');
        } elseif ($encode == 'UTF-8') {
            $cont = mb_convert_encoding($cont, 'CP932', 'UTF-8');
        }
        $cont_area = htmlspecialchars($cont, ENT_QUOTES);
    }
    // プリント
    echo <<<EOHEADER
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
    {$_conf['extra_headers_ht']}
    <title>{$ptitle}</title>
    <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
</head>
<body onload="top.document.title=self.document.title;">

EOHEADER;
    P2Util::printInfoHtml();
    echo "<pre>";
    echo $cont_area;
    echo "</pre>";
    echo '</body></html>';
    return TRUE;
}
开发者ID:unpush,项目名称:p2-php,代码行数:43,代码来源:viewtxt.php


示例13: isset

 * rep2 - あぼーんワード編集インタフェース
 */
require_once './conf/conf.inc.php';
$_login->authorize();
// ユーザ認証
$filename = isset($_REQUEST['file']) ? $_REQUEST['file'] : '';
$csrfid = P2Util::getCsrfId(__FILE__ . $filename);
if (!empty($_POST['submit_save']) || !empty($_POST['submit_default'])) {
    if (!isset($_POST['csrfid']) or $_POST['csrfid'] != $csrfid) {
        p2die('不正なポストです');
    }
}
$writable_files = array('p2_aborn_thread.txt' => 'あぼーんスレッドタイトル', 'p2_aborn_name.txt' => 'あぼーんネーム', 'p2_aborn_mail.txt' => 'あぼーんメール', 'p2_aborn_msg.txt' => 'あぼーんメッセージ', 'p2_aborn_id.txt' => 'あぼーんID', 'p2_ng_name.txt' => 'NGネーム', 'p2_ng_mail.txt' => 'NGメール', 'p2_ng_msg.txt' => 'NGメッセージ', 'p2_ng_id.txt' => 'NGID');
if (!array_key_exists($filename, $writable_files)) {
    $files_st = implode(', ', array_keys($writable_files));
    p2die(basename($_SERVER['SCRIPT_NAME']) . " 先生の書き込めるファイルは、{$files_st} だけ!");
}
$path = $_conf['pref_dir'] . DIRECTORY_SEPARATOR . $filename;
//=====================================================================
// 前処理
//=====================================================================
// {{{ ■保存ボタンが押されていたら、設定を保存
if (!empty($_POST['submit_save'])) {
    $newdata = '';
    foreach ($_POST['nga'] as $na_info) {
        $a_word = strtr(trim($na_info['word'], "\t\r\n"), "\t\r\n", "   ");
        $a_bbs = strtr(trim($na_info['bbs'], "\t\r\n"), "\t\r\n", "   ");
        $a_tt = strtr(trim($na_info['tt'], "\t\r\n"), "\t\r\n", "   ");
        $a_time = strtr(trim($na_info['ht']), "\t\r\n", "   ");
        if ($a_time === '') {
            $a_time = '--';
开发者ID:nyarla,项目名称:fluxflex-rep2ex,代码行数:31,代码来源:edit_aborn_word.php


示例14: p2die

<?php

/**
 *  rep2 - ユーザ設定編集UI
 */
require_once __DIR__ . '/../init.php';
$_login->authorize();
// ユーザ認証
$csrfid = P2Util::getCsrfId(__FILE__);
if (!empty($_POST['submit_save']) || !empty($_POST['submit_default'])) {
    if (!isset($_POST['csrfid']) || $_POST['csrfid'] != $csrfid) {
        p2die('不正なポストです');
    }
}
define('P2_EDIT_CONF_USER_DEFAULT', 0);
define('P2_EDIT_CONF_USER_LONGTEXT', 1);
define('P2_EDIT_CONF_USER_HIDDEN', 2);
define('P2_EDIT_CONF_USER_DISABLED', 4);
define('P2_EDIT_CONF_USER_SKIPPED', 8);
define('P2_EDIT_CONF_USER_PASSWORD', 16);
define('P2_EDIT_CONF_FILE_ADMIN', 1024);
define('P2_EDIT_CONF_FILE_ADMIN_EX', 2048);
include P2_CONFIG_DIR . '/conf_user_def.inc.php';
//=====================================================================
// 前処理
//=====================================================================
// {{{ 保存ボタンが押されていたら、設定を保存
if (!empty($_POST['submit_save'])) {
    // 値の適正チェック、矯正
    // トリム
    $_POST['conf_edit'] = array_map('trim', $_POST['conf_edit']);
开发者ID:xingskycn,项目名称:p2-php,代码行数:31,代码来源:edit_conf_user.php


示例15: elseif

    } elseif ($new_login_pass != $_POST['form_new_login_pass2']) {
        P2Util::pushInfoHtml("<p>rep2 error: {$p_str['password']} と {$p_str['password']} (確認) が一致しませんでした。</p>");
        // パスワード変更登録処理を行う
    } else {
        $crypted_login_pass = sha1($new_login_pass);
        $auth_user_cont = <<<EOP
<?php
\$rec_login_user_u = '{$_login->user_u}';
\$rec_login_pass_x = '{$crypted_login_pass}';
?>
EOP;
        FileCtl::make_datafile($_conf['auth_user_file'], $_conf['pass_perm']);
        // ファイルがなければ生成
        $fp = @fopen($_conf['auth_user_file'], 'wb');
        if (!$fp) {
            p2die("{$_conf['auth_user_file']} を保存できませんでした。認証ユーザ登録失敗。");
        }
        flock($fp, LOCK_EX);
        fputs($fp, $auth_user_cont);
        flock($fp, LOCK_UN);
        fclose($fp);
        P2Util::pushInfoHtml('<p>○認証パスワードを変更登録しました</p>');
    }
}
//====================================================
// 補助認証
//====================================================
$mobile = Net_UserAgent_Mobile::singleton();
$p_htm['auth_ctl'] = '';
// docomo認証
if ($mobile->isDoCoMo()) {
开发者ID:unpush,项目名称:p2-php,代码行数:31,代码来源:login.php


示例16: mkdirRecursive

 /**
  * ディレクトリがなければ作る
  *
  * @param string $apath
  * @param int $perm
  * @return bool
  */
 public static function mkdirRecursive($apath, $perm = null)
 {
     if (is_dir($apath)) {
         return true;
     } elseif (file_exists($apath)) {
         p2die("cannot mkdir, file already exists. ({$apath})");
     }
     // デフォルトのパーミッション
     $perm = intval($perm);
     if (($perm & 0777) === 0 || ($perm & ~0777) !== 0) {
         $default_perm = 0777 & umask();
         $perm = $default_perm ? $default_perm : 0777;
     }
     if (strlen($apath) === 0) {
         p2die("cannot mkdir. ({$apath})", 'ディレクトリ名が空白です。');
     }
     if (strpos($apath, P2_NULLBYTE) !== false) {
         $epath = str_replace(P2_NULLBYTE, '\\0', $apath);
         p2die("cannot mkdir. ({$epath})", 'ディレクトリ名にNULLバイトが含まれています。');
     }
     if (!@mkdir($apath, $perm, true)) {
         p2die("cannot mkdir. ({$apath})");
     }
     return true;
 }
开发者ID:xingskycn,项目名称:p2-php,代码行数:32,代码来源:FileCtl.php


示例17: getP2Client

 /**
  * P2Clientクラスのインスタンスを生成する
  *
  * @param void
  * @return P2Client
  */
 public static function getP2Client()
 {
     global $_conf;
     if (!is_dir($_conf['db_dir'])) {
         FileCtl::mkdirRecursive($_conf['db_dir']);
     }
     try {
         return new P2Client("http://{$_conf['p2_2ch_host']}/p2/", $_conf['p2_2ch_mail'], $_conf['p2_2ch_pass'], $_conf['db_dir'], (bool) $_conf['p2_2ch_ignore_cip']);
     } catch (P2Exception $e) {
         p2die($e->getMessage());
     }
 }
开发者ID:nyarla,项目名称:fluxflex-rep2ex,代码行数:18,代码来源:P2Util.php


示例18: filesize

if (!file_exists($_conf['p2_res_hist_dat'])) {
    P2Util::printSimpleHtml($karappoMsgHtml);
    exit;
}
$res_hist_dat_size = filesize($_conf['p2_res_hist_dat']);
$logSizeSt = P2Util::getTranslatedUnitFileSize($res_hist_dat_size);
$maxLogSize = 0;
//1024*1024*10;
$maxLogSizeSt = P2Util::getTranslatedUnitFileSize($maxLogSize);
if ($maxLogSize and $res_hist_dat_size > $maxLogSize) {
    P2Util::printSimpleHtml(sprintf('書き込みログ容量(%s/%s)が大き過ぎるため、表\示できません。<br>
            %sのページより、書き込みログの一括削除を行って下さい。', hs($logSizeSt), hs($maxLogSizeSt), P2View::tagA($_conf['editpref_php'], hs('設定管理'), array('target' => 'subject'))));
    exit;
}
if (false === ($datlines = file($_conf['p2_res_hist_dat']))) {
    p2die('書き込み履歴ログファイルを読み込めませんでした');
} elseif (!$datlines) {
    P2Util::printSimpleHtml($karappoMsgHtml);
    exit;
}
// ファイルの下に記録されているものが新しいので反転させる
$datlines = array_reverse($datlines);
$datlines_num = count($datlines);
$ResHist = new ResHist();
// HTMLプリント用変数
$toolbar_ht = <<<EOP
\tチェックした項目を<input type="submit" name="submit" value="{$deletemsg_st}">
\t全てのチェックボックスを 
\t<input type="button" onclick="hist_checkAll(true)" value="選択"> 
\t<input type="button" onclick="hist_checkAll(false)" value="解除">
EOP;
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:read_res_hist.php


示例19: date

}
//==================================================================
// 変数
//==================================================================
$GLOBALS['rnum_all_range'] = $_conf['k_rnum_range'];
$GLOBALS['word'] = null;
$sb_view = "shinchaku";
$newtime = date("gis");
$host = geti($_GET['host'], geti($_POST['host']));
$bbs = geti($_GET['bbs'], geti($_POST['bbs']));
$spmode = geti($_GET['spmode'], geti($_POST['spmode']));
if ((!$host || !isset($bbs)) && !isset($spmode)) {
    p2die('必要な引数が指定されていません');
}
if ($host && P2Validate::host($host) || $bbs && P2Validate::bbs($bbs) || $spmode && P2Validate::spmode($spmode)) {
    p2die('不正な引数です');
}
$hr = P2View::getHrHtmlK();
//====================================================================
// メイン
//====================================================================
register_shutdown_function('saveMatomeCache');
$GLOBALS['_read_new_html'] = '';
ob_start();
$aThreadList = new ThreadList();
// 板とモードのセット
if ($spmode) {
    if ($spmode == "taborn" or $spmode == "soko") {
        $aThreadList->setIta($host, $bbs, P2Util::getItaName($host, $bbs));
    }
    $aThreadList->setSpMode($spmode);
开发者ID:poppen,项目名称:p2,代码行数:31,代码来源:read_new_i.php


示例20: p2die

<?php

/**
 * rep2 - レス書き込みフォーム
 */
require_once './conf/conf.inc.php';
$_login->authorize();
// ユーザ認証
//==================================================
// 変数
//==================================================
if (empty($_GET['host'])) {
    // 引数エラー
    p2die('host が指定されていません');
} else {
    $host = $_GET['host'];
}
$bbs = isset($_GET['bbs']) ? $_GET['bbs'] : '';
$key = isset($_GET['key']) ? $_GET['key'] : '';
$rescount = isset($_GET['rescount']) ? intval($_GET['rescount']) : 1;
$popup = isset($_GET['popup']) ? intval($_GET['popup']) : 0;
$itaj = P2Util::getItaName($host, $bbs);
if (!$itaj) {
    $itaj = $bbs;
}
$itaj_hd = htmlspecialchars($itaj, ENT_QUOTES, 'Shift_JIS', false);
$ttitle_en = isset($_GET['ttitle_en']) ? $_GET['ttitle_en'] : '';
$ttitle = strlen($ttitle_en) > 0 ? UrlSafeBase64::decode($ttitle_en) : '';
$ttitle_hd = htmlspecialchars($ttitle, ENT_QUOTES);
$key_idx = P2Util::idxDirOfHostBbs($host, $bbs) . $key . '.idx';
// フォームのオプション読み込み
开发者ID:nyarla,项目名称:fluxflex-rep2ex,代码行数:31,代码来源:post_form.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP p2h函数代码示例发布时间:2022-05-15
下一篇:
PHP p函数代码示例发布时间: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