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

PHP fatal函数代码示例

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

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



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

示例1: main

 public static function main($argv)
 {
     global $coach;
     list($tid) = $argv;
     if ($tid) {
         if (!get_alt_col('teams', 'team_id', $tid, 'name')) {
             fatal('Invalid team');
         }
         $team = new Team($tid);
         $ALLOW_EDIT = is_object($coach) && ($team->owned_by_coach_id == $coach->coach_id || $coach->mayManageObj(T_OBJ_TEAM, $tid)) && !$team->is_retired;
         # Show team action boxes?
     } else {
         $team = null;
         $ALLOW_EDIT = false;
     }
     if ($ALLOW_EDIT && isset($_POST['action']) && isset($_POST['pid'])) {
         $pid = (int) $_POST['pid'];
         switch ($_POST['action']) {
             case 'delete':
                 status(self::delete((int) $pid));
                 break;
             case 'new':
             case 'edit':
                 status(self::edit((int) $pid, $_POST['title'], $_POST['about']));
                 break;
         }
     }
     self::printList($team, $ALLOW_EDIT);
     return true;
 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:30,代码来源:class_cemetery.php


示例2: __construct

 /**
  * Constructor
  */
 public function __construct($conf = array())
 {
     // ldap extension is needed
     if (!function_exists('ldap_connect')) {
         fatal("To use the LDAP authenticator, you need PHP with LDAP support.");
     }
     // Defaults, override in config
     $default_conf['server'] = '';
     $default_conf['port'] = 389;
     $default_conf['usertree'] = '';
     $default_conf['grouptree'] = '';
     $default_conf['userfilter'] = '(&(uid=%{user})(objectClass=posixAccount))';
     $default_conf['groupfilter'] = '(&(objectClass=posixGroup)(memberUID=%{uid}))';
     $default_conf['version'] = 3;
     $default_conf['starttls'] = 0;
     $default_conf['referrals'] = 0;
     $default_conf['deref'] = LDAP_DEREF_NEVER;
     $default_conf['binddn'] = '';
     $default_conf['bindpw'] = '';
     $default_conf['userscope'] = 'sub';
     $default_conf['groupscope'] = 'sub';
     $default_conf['groupkey'] = 'cn';
     $default_conf['debug'] = 0;
     foreach ($conf as $key => $val) {
         if (array_key_exists($key, $default_conf)) {
             $default_conf[$key] = $val;
         }
     }
     // Set configuration
     $this->conf = $default_conf;
 }
开发者ID:pexner,项目名称:munkireport-php,代码行数:34,代码来源:authLDAP.php


示例3: login_do_http_auth

function login_do_http_auth()
{
    global $LOGIN_PASSWORD, $LOGIN_USERNAME;
    global $_SERVER;
    if ($_SERVER['REMOTE_USER']) {
        is_logged_in(true);
        return;
    }
    if (!$_SERVER['PHP_AUTH_USER']) {
        is_logged_in(false);
        return;
    }
    $status = authenticate($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
    if (!succeeds($status)) {
        is_logged_in(false);
        if (!fatal($status)) {
            if ($_SERVER['PHP_AUTH_USER']) {
                http_401();
            }
        } else {
            print "Error logging in: " . auth_error();
        }
    } else {
        $LOGIN_USERNAME = $_SERVER['PHP_AUTH_USER'];
        $LOGIN_PASSWORD = $_SERVER['PHP_AUTH_PW'];
        is_logged_in(true);
    }
}
开发者ID:nbtscommunity,项目名称:phpfnlib,代码行数:28,代码来源:login.php


示例4: log

 static function log($category, $message)
 {
     require_once THRIFT_ROOT . '/Thrift.php';
     require_once THRIFT_ROOT . '/protocol/TBinaryProtocol.php';
     require_once THRIFT_ROOT . '/transport/TSocket.php';
     require_once THRIFT_ROOT . '/transport/TFramedTransport.php';
     require_once THRIFT_ROOT . '/packages/scribe/scribe.php';
     switch ($category) {
         case 'general':
         case 'accounts':
         case 'actions':
         case 'status':
         case 'security':
         case 'debug':
         case 'history':
         case 'regulation':
         case 'specials':
             break;
         default:
             fatal();
     }
     if (!is_string($message)) {
         if (is_array($message)) {
             if (!isset($message['ts'])) {
                 $message['ts'] = time();
             }
             if (!isset($message['client_ip'])) {
                 $message['client_ip'] = Utils::get_client_ip();
             }
             if (!isset($message['user_id']) && Auth::is_logged()) {
                 $message['user_id'] = Auth::get_user_id();
             }
             if (!isset($message['user_name']) && Auth::is_logged()) {
                 $message['user_name'] = Auth::get_user_name();
             }
             $oauth_client_id = Auth::get_oauth_client_id();
             if (!isset($message['oauth_client_id']) && !empty($oauth_client_id)) {
                 $message['oauth_client_id'] = $oauth_client_id;
             }
         }
         $message = json_encode($message);
     }
     try {
         $log_entry = new \LogEntry(array('category' => $category, 'message' => $message));
         $messages = array($log_entry);
         $socket = new \TSocket(SCRIBE_HOST, SCRIBE_PORT, FALSE);
         $transport = new \TFramedTransport($socket);
         $protocol = new \TBinaryProtocolAccelerated($transport, FALSE, FALSE);
         $client = new \scribeClient($protocol, $protocol);
         $transport->open();
         $client->send_log($messages);
         $transport->close();
     } catch (\TException $e) {
         return FALSE;
     }
     return TRUE;
 }
开发者ID:jedisct1,项目名称:PHP-OAuth2-Provider,代码行数:57,代码来源:class.scribe.inc.php


示例5: main

function main()
{
    $opts = getopt("cath");
    if (isset($opts['h']) || !isset($opts['a']) && !isset($opts['t'])) {
        usage();
    }
    if (isset($opts['a']) && isset($opts['t'])) {
        fatal("can't use -a and -t together");
    }
    $mode = isset($opts['t']) ? 'tx' : 'address';
    if (isset($opts['c'])) {
        switch ($mode) {
            case "tx":
                echo <<<'EOD'

DROP TABLE t_shortlinks;
CREATE TABLE t_shortlinks (
    shortcut bytea NOT NULL PRIMARY KEY,
    hash bytea NOT NULL REFERENCES transactions
);

ALTER TABLE public.t_shortlinks OWNER TO blockupdate;
GRANT SELECT ON TABLE t_shortlinks TO "www-data";

EOD;
                break;
            case "address":
                echo <<<'EOD'

DROP TABLE a_shortlinks;
CREATE TABLE a_shortlinks (
    shortcut bytea NOT NULL PRIMARY KEY,
    hash160 bytea NOT NULL REFERENCES keys
);

ALTER TABLE public.a_shortlinks OWNER TO blockupdate;
GRANT SELECT ON TABLE a_shortlinks TO "www-data";

EOD;
                break;
        }
    }
    $fh = fopen("php://stdin", "r");
    while ($line = trim(fgets($fh))) {
        $arr = explode(" ", $line);
        if ($mode == "tx") {
            $shortcut_hex = decodeBase58($arr[0]);
            $tx_hex = $arr[1];
            echo "INSERT INTO t_shortlinks(shortcut, hash) VALUES (decode('{$shortcut_hex}', 'hex'), decode('{$tx_hex}', 'hex'));\n";
        } elseif ($mode == "address") {
            $shortcut_hex = decodeBase58($arr[0]);
            $hash160_hex = addressToHash160($arr[1]);
            echo "INSERT INTO a_shortlinks(shortcut, hash160) VALUES (decode('{$shortcut_hex}', 'hex'), decode('{$hash160_hex}', 'hex'));\n";
        }
    }
}
开发者ID:blockexplorers,项目名称:blockexplorer,代码行数:56,代码来源:update_shortlinks.php


示例6: queues_set_qnostate

function queues_set_qnostate($exten, $qnostate)
{
    global $astman;
    // Update the settings in ASTDB
    if ($astman) {
        $astman->database_put("AMPUSER", $exten . "/queues/qnostate", $qnostate);
    } else {
        fatal("Cannot connect to Asterisk Manager with " . $amp_conf["AMPMGRUSER"] . "/" . $amp_conf["AMPMGRPASS"]);
    }
}
开发者ID:ringfreejohn,项目名称:pbxframework,代码行数:10,代码来源:hook_core.php


示例7: __call

 public function __call($method, $args)
 {
     if (!method_exists($this->base, $method)) {
         fatal('"%s" method does not exist.', $method);
     }
     if ($this->base instanceof View\Template) {
         return call_user_func_array([$this->base, $method], $args);
     }
     fatal('Class is not an instance of View\\Template');
 }
开发者ID:noikiy,项目名称:unity,代码行数:10,代码来源:View.php


示例8: load_image

function load_image($imagekey)
{
    if (1 !== preg_match('/[0-9a-f]{40}/', $imagekey)) {
        fatal('Invalid image key.');
    }
    $im = imagecreatefrompng("uploads/{$imagekey}.png");
    if (!$im) {
        fatal('Failed to load image.');
    }
    return $im;
}
开发者ID:p4-team,项目名称:ctf,代码行数:11,代码来源:common.php


示例9: get_original_url

 public function get_original_url()
 {
     if (!isset($_GET['url'])) {
         fatal("Proxy URL rewriter error: url GET parameter not found.");
     }
     $this->original_url = base64_decode($_GET['url'], TRUE);
     if (!is_string($this->original_url)) {
         fatal("Proxy URL rewriter error: url GET parameter is invalidly base64 encoded.");
     }
     $this->warnx("URL [{$this->original_url}]");
 }
开发者ID:laiello,项目名称:youtube-cache,代码行数:11,代码来源:youtube.php


示例10: __call

 public function __call($method, $args)
 {
     if (!isset($args[0])) {
         if (!isset($this->cache[$method])) {
             fatal('"%s" is not set.', $method);
         }
         return $this->cache[$method];
     }
     $this->cache[$method] = $args[0];
     return $this;
 }
开发者ID:noikiy,项目名称:unity,代码行数:11,代码来源:Config.php


示例11: replaceTextInFile

function replaceTextInFile($sFilepath, $dPairs)
{
    $s = file_get_contents($sFilepath);
    if (!$s) {
        echo "Could not read file {$sFilepath}";
        fatal(__LINE__);
    }
    foreach ($dPairs as $sFrom => $sTo) {
        $s = str_replace($sFrom, $sTo, $s);
    }
    file_put_contents($sFilepath, $s);
}
开发者ID:bcneb,项目名称:WebYep,代码行数:12,代码来源:make_release.php


示例12: load_conf

function load_conf()
{
    // Load default configuration
    require_once APP_ROOT . "config_default.php";
    if ((include_once APP_ROOT . "config.php") !== 1) {
        fatal(APP_ROOT . "config.php is missing!<br>\n\tUnfortunately, Munkireport does not work without it</p>");
    }
    // Convert auth_config to config item
    if (isset($auth_config)) {
        $conf['auth']['auth_config'] = $auth_config;
    }
    $GLOBALS['conf'] =& $conf;
}
开发者ID:kidistS,项目名称:munkireport-php,代码行数:13,代码来源:index.php


示例13: __construct

 public function __construct()
 {
     global $config;
     if (!file_exists($this->configFile)) {
         fatal("Could not open config file");
     }
     $json = file($this->configFile);
     if (!$json) {
         fatal("Could not open file: " . $this->configFile);
     }
     $config = json_decode($json);
     if (!$config) {
         fatal("Could not decode json string" . json_last_error_msg());
     }
 }
开发者ID:rustyeddy,项目名称:sandbox,代码行数:15,代码来源:Config.php


示例14: init

/**
 * Makes everything go.
 *
 * @return void
 */
function init($url)
{
    // process the request URL
    $manager = new PathManager($url);
    $route = $manager->build_route();
    $instance = $manager->controller_instance($route->controller);
    if ($instance === FALSE) {
        fatal("Fatal Error: Cannot find a controller called '{$route->controller}'.", 404);
    } elseif (method_exists($instance, $route->action) === FALSE) {
        fatal("Fatal Error: Controller '{$route->controller}' does not respond to action '{$route->action}'.", 404);
    }
    $action = $route->action;
    sys()->getData->add($route->params);
    $instance->{$action}($route->params);
    render($route);
}
开发者ID:allynbauer,项目名称:Condor,代码行数:21,代码来源:system_functions.php


示例15: getdbh

function getdbh()
{
    if (!isset($GLOBALS['dbh'])) {
        try {
            $GLOBALS['dbh'] = new PDO(conf('pdo_dsn'), conf('pdo_user'), conf('pdo_pass'), conf('pdo_opts'));
        } catch (PDOException $e) {
            fatal('Connection failed: ' . $e->getMessage());
        }
        // Set error mode
        $GLOBALS['dbh']->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        // Store database name in config array
        if (preg_match('/.*dbname=([^;]+)/', conf('pdo_dsn'), $result)) {
            $GLOBALS['conf']['dbname'] = $result[1];
        }
    }
    return $GLOBALS['dbh'];
}
开发者ID:hymmm,项目名称:munkireport-php,代码行数:17,代码来源:site_helper.php


示例16: logViewPage

 public static function logViewPage()
 {
     global $coach, $lng;
     if (!is_object($coach) || $coach->ring != Coach::T_RING_GLOBAL_ADMIN) {
         fatal("Sorry. Only site administrators and commissioners are allowed to access this section.");
     }
     title($lng->getTrn('name', 'LogSubSys'));
     echo "<table style='width:100%;'>\n";
     echo "<tr><td><i>Date</i></td><td><i>Message</i></td></tr><tr><td colspan='2'><hr></td></tr>\n";
     $query = "SELECT * FROM log WHERE date > SUBDATE(NOW(), INTERVAL " . LOG_HIST_LENGTH . " MONTH) ORDER BY date DESC";
     $result = mysql_query($query);
     $logs = array();
     while ($l = mysql_fetch_object($result)) {
         echo "<tr><td>" . textdate($l->date) . "</td><td>{$l->msg}</td></tr>\n";
     }
     echo "</table>\n";
 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:17,代码来源:class_log.php


示例17: sec_admin

function sec_admin()
{
    global $rules, $settings, $DEA, $coach, $lng, $admin_menu;
    global $leagues, $divisions, $tours;
    if (!is_object($coach)) {
        fatal('Please login.');
    }
    if (!isset($_GET['subsec'])) {
        $_GET['subsec'] = '_NONE_';
    }
    $IS_GLOBAL_ADMIN = $coach->ring == Coach::T_RING_GLOBAL_ADMIN;
    $ONLY_FOR_GLOBAL_ADMIN = "Note: This feature may only be used by <i>global</i> administrators.";
    # Used string in a few common feature/action boxes.
    // Deny un-authorized users.
    if (!in_array($_GET['subsec'], array_keys($admin_menu))) {
        fatal("Sorry. Your access level does not allow you opening the requested page.");
    }
    switch ($_GET['subsec']) {
        case 'usr_man':
            include 'admin/admin_usr_man.php';
            break;
        case 'ct_man':
            include 'admin/admin_ct_man.php';
            break;
        case 'nodes':
            include 'admin/admin_nodes.php';
            break;
        case 'schedule':
            include 'admin/admin_schedule.php';
            break;
        case 'import':
            include 'admin/admin_import.php';
            break;
        case 'log':
            Module::run('LogSubSys', array('logViewPage'));
            break;
        case 'cpanel':
            include 'admin/admin_cpanel.php';
            break;
        default:
            fatal('The requested admin page does not exist.');
    }
    echo "<br><br>";
    HTMLOUT::dnt();
}
开发者ID:nicholasmr,项目名称:obblm,代码行数:45,代码来源:admin.php


示例18: getTrn

 public function getTrn($key, $doc = false)
 {
     if (!$doc) {
         $doc = self::main;
     }
     if (!in_array($doc, array_keys($this->docs))) {
         fatal("Failed to look up key '{$key}' in the translation document '{$doc}'. {$doc} is not loaded/exists. The available documents are: " . implode(', ', array_keys($this->docs)));
     }
     $xpath = new DOMXpath($this->docs[$doc]);
     $query = $xpath->query("//{$this->lang}/{$key}");
     if ($query->length == 0) {
         # Try fallback language
         $query = $xpath->query("//" . self::fallback . "/{$key}");
         if ($query->length == 0) {
             return (string) "TRANSLATION ERR ! {$key}";
         }
     }
     return (string) $query->item(0)->nodeValue;
 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:19,代码来源:class_translations.php


示例19: GetUserRootFolder

/**
 * \brief  Get the top-of-tree folder_pk for the current user.
 *  Fail if there is no user session.
 *
 * \return folder_pk for the current user
 */
function GetUserRootFolder()
{
    global $PG_CONN;
    /* validate inputs */
    $user_pk = Auth::getUserId();
    /* everyone has a user_pk, even if not logged in.  But verify. */
    if (empty($user_pk)) {
        return "__FILE__:__LINE__ GetUserRootFolder(Not logged in)<br>";
    }
    /* Get users root folder */
    $sql = "select root_folder_fk from users where user_pk={$user_pk}";
    $result = pg_query($PG_CONN, $sql);
    DBCheckResult($result, $sql, __FILE__, __LINE__);
    $UsersRow = pg_fetch_assoc($result);
    $root_folder_fk = $UsersRow['root_folder_fk'];
    pg_free_result($result);
    if (empty($root_folder_fk)) {
        $text = _("Missing root_folder_fk for user ");
        fatal("<h2>" . $text . $user_pk . "</h2>", __FILE__, __LINE__);
    }
    return $root_folder_fk;
}
开发者ID:DanielDobre,项目名称:fossology,代码行数:28,代码来源:common-folders.php


示例20: main

public static function main($argv) # argv = argument vector (array).
{
    /* 
        Let $argv[0] be the name of the function we wish main() to call. 
        Let the remaining contents of $argv be the arguments of that function, in the correct order.
        
        Please note only static functions are callable through main(). 
    */
	global $coach;
	$IS_LOCAL_OR_GLOBAL_ADMIN = (isset($coach) && ($coach->ring == Coach::T_RING_GLOBAL_ADMIN || $coach->ring == Coach::T_RING_LOCAL_ADMIN));

    // Deny un-authorized users.
    if (!$IS_LOCAL_OR_GLOBAL_ADMIN)
        fatal("Sorry. Your access level does not allow you opening the requested page.");
		
	?>
	<div class="module_schedule">
	<?
	self::inlineCSS();
	
	$step = 1;
	if (isset($_GET['step'])) { $step = $_GET['step']; }
	if (isset($_POST['step'])) { $step = $_POST['step']; }
	
	switch ($step) {
			case '2':
				self::step2();
				break;		
			default:
				self::step1();
				break;
	}
	
	?>
	</div>
	<?
	return true;
}
开发者ID:nicholasmr,项目名称:obblm,代码行数:38,代码来源:class_scheduler.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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