本文整理汇总了PHP中report函数的典型用法代码示例。如果您正苦于以下问题:PHP report函数的具体用法?PHP report怎么用?PHP report使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了report函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run($functionName = '', $functionRun = '')
{
$datas = Structure::datas();
$parameters = $datas['parameters'];
$isFile = $datas['isFile'];
$function = $datas['function'];
if (file_exists($isFile)) {
if ($functionName === $function) {
if (is_callable($functionRun)) {
if (APP_TYPE === 'local') {
set_error_handler('Exceptions::table');
}
call_user_func_array($functionRun, $parameters);
if (APP_TYPE === 'local') {
restore_error_handler();
}
} else {
// Sayfa bilgisine erişilemezse hata bildir.
if (!Config::get('Route', 'show404')) {
// Hatayı ekrana yazdır.
echo Error::message('Error', 'callUserFuncArrayError', $functionRun);
// Hatayı rapor et.
report('Error', getMessage('Error', 'callUserFuncArrayError'), 'SystemCallUserFuncArrayError');
// Çalışmayı durdur.
return false;
} else {
redirect(Config::get('Route', 'show404'));
}
}
}
}
}
示例2: run
public static function run()
{
// INI AYARLAR YAPILANDIRILIYOR...
$iniSet = Config::get('Ini', 'settings');
if (!empty($iniSet)) {
Config::iniSet($iniSet);
}
// ----------------------------------------------------------------------
// HTACCESS DOSYASI OLUŞTURULUYOR...
if (Config::get('Htaccess', 'createFile') === true) {
createHtaccessFile();
}
// ----------------------------------------------------------------------
// COMPOSER DOSYASI OLUŞTURULUYOR...
$composer = Config::get('Composer', 'autoload');
if ($composer === true) {
$path = 'vendor/autoload.php';
if (file_exists($path)) {
require_once $path;
} else {
report('Error', getMessage('Error', 'fileNotFound', $path), 'AutoloadComposer');
die(getErrorMessage('Error', 'fileNotFound', $path));
}
} elseif (file_exists($composer)) {
require_once $composer;
} elseif (!empty($composer)) {
report('Error', getMessage('Error', 'fileNotFound', $composer), 'AutoloadComposer');
die(getErrorMessage('Error', 'fileNotFound', $composer));
}
// ----------------------------------------------------------------------
}
示例3: table
public function table(string $no = NULL, string $msg = NULL, string $file = NULL, string $line = NULL, array $trace = NULL)
{
$lang = lang('Templates');
$message = $lang['line'] . ':' . $line . ', ' . $lang['file'] . ':' . $file . ', ' . $lang['message'] . ':' . $msg;
report('ExceptionError', $message, 'ExceptionError');
$table = $this->_template($msg, $file, $line, $no, $trace);
// Error Type: TypeHint -> exit
if (in_array($no, ['0', '2'])) {
exit($table);
}
echo $table;
}
示例4: set
public static function set($errorMessage = '')
{
$info = debug_backtrace();
$className = isset($info[1]['class']) ? str_ireplace(STATIC_ACCESS, '', $info[1]['class']) : $info[5]['class'];
$methodName = isset($info[1]['function']) ? $info[1]['function'] : $info[5]['function'];
$line = isset($info[1]['line']) ? $info[1]['line'] : $info[5]['line'];
$file = isset($info[1]['file']) ? $info[1]['file'] : $info[5]['file'];
self::$errors[strtolower($className)][strtolower($methodName)]['message'][] = $errorMessage;
self::$errors[strtolower($className)][strtolower($methodName)]['line'][] = $line;
self::$errors[strtolower($className)][strtolower($methodName)]['file'][] = $file;
report(ucfirst($className . 'Error'), $errorMessage, ucfirst($className) . 'Library');
return false;
}
示例5: login
function login()
{
$this->intentos = 0;
do {
$this->reqLogin();
if ($this->error && $this->intentos > 0) {
$tiempo_espera = $this->tiempoEspera($this->intentos);
report('err', "ERROR. Login fallido. Intentando volver a loguear en " . segundosCadenaTiempo($tiempo_espera) . "...");
sleep($tiempo_espera);
}
} while ($this->error);
report('act', "Login satisfactorio.");
}
示例6: inicializar
public function inicializar()
{
//Escaneo de actividad e inicialización
$colas = $this->coordinator->escanearColas();
if ($colas["construcción"] > 0) {
$this->builder->finCola = time() + $colas["construcción"];
report('wait', 'Ya hay algo construyéndose hasta dentro de ' . segundosCadenaTiempo($colas["construcción"]) . ".");
}
if ($colas["investigación"] > 0) {
$this->researcher->finCola = time() + $colas["investigación"];
report('wait', 'Ya hay algo investigándose hasta dentro de ' . segundosCadenaTiempo($colas["investigación"]) . ".");
}
$this->commander->inicializar($this->coordenadas);
}
示例7: set
public static function set($errorMessage = '', $output = false, $object = '')
{
//------------------------------------------------------------------------------------------------
// 2. Parametre metinsel değer alırsa lang() yönteminden verinin çağrılmasını sağlar.
//------------------------------------------------------------------------------------------------
if (isChar($output)) {
$errorMessage = lang($errorMessage, $output, $object);
}
$info = debug_backtrace();
$className = isset($info[1]['class']) ? str_ireplace(STATIC_ACCESS, '', $info[1]['class']) : (isset($info[5]['class']) ? $info[5]['class'] : false);
$methodName = isset($info[1]['function']) ? $info[1]['function'] : (isset($info[5]['function']) ? $info[5]['function'] : false);
$line = isset($info[1]['line']) ? $info[1]['line'] : (isset($info[5]['line']) ? $info[5]['line'] : false);
$file = isset($info[1]['file']) ? $info[1]['file'] : (isset($info[5]['file']) ? $info[5]['file'] : false);
self::$errors[strtolower($className)][strtolower($methodName)]['message'][] = $errorMessage;
self::$errors[strtolower($className)][strtolower($methodName)]['line'][] = $line;
self::$errors[strtolower($className)][strtolower($methodName)]['file'][] = $file;
report(ucfirst($className . 'Error'), $errorMessage, ucfirst($className) . 'Library');
return $output === true ? $errorMessage : false;
}
示例8: run
public function run(string $functionName, $functionRun = NULL, array $route = NULL)
{
if (!empty($this->route)) {
$route = $this->route;
}
if (!empty($route)) {
Config::set('Services', 'route', ['changeUri' => $route]);
}
$datas = Structure::data();
$parameters = $datas['parameters'];
$isFile = $datas['file'];
$function = $datas['function'];
if (($functionName === 'construct' || $functionName === 'destruct') && is_callable($functionRun)) {
call_user_func_array($functionRun, $parameters);
}
if (file_exists($isFile)) {
if (strtolower($function) === 'index' && strtolower($functionName) === 'main') {
$function = 'main';
}
if ($functionName === $function) {
if (is_callable($functionRun)) {
call_user_func_array($functionRun, $parameters);
} else {
// Sayfa bilgisine erişilemezse hata bildir.
if (!($routeShow404 = Config::get('Services', 'route')['show404'])) {
// Hatayı rapor et.
report('Error', lang('Error', 'callUserFuncArrayError'), 'SystemCallUserFuncArrayError');
// Hatayı ekrana yazdır.
die(Errors::message('Error', 'callUserFuncArrayError', $functionRun));
} else {
redirect($routeShow404);
}
}
}
}
}
示例9: UNIX_TIMESTAMP
</td>
</tr>
<TD align="center" class="header">ID</TD>
<TD align="center" class="header">User</TD>
<TD align="center" class="header">Downloaded</TD>
<TD align="center" class="header">Uploaded</TD>
<TD align="center" class="header">Ratio</TD>
<TD align="center" class="header">Rank</TD>
<TD align="center" class="header">Difference</TD>
<TD align="center" class="header">Register Date</TD>
<TD align="center" class="header">Last Connect</TD>
<TD align="center" class="header">Edit</TD>
<TD align="center" class="header">Delete</TD>
<TD align="center" class="header">C</TD>
</TR>
<?php
if ($kullan == 0) {
$q = $db->query("SELECT users.id AS fid, username, downloaded, uploaded, level, UNIX_TIMESTAMP(joined) AS joined, UNIX_TIMESTAMP(lastconnect) AS lastconnect FROM users LEFT JOIN users_level ON users.id_level = users_level.id WHERE ((downloaded - uploaded) > '" . $mdiff . "') ORDER BY (uploaded / downloaded) ASC");
} else {
$q = $db->query("SELECT users.id AS fid, username, downloaded, uploaded, level, UNIX_TIMESTAMP(joined) AS joined, UNIX_TIMESTAMP(lastconnect) AS lastconnect FROM users LEFT JOIN users_level ON users.id_level = users_level.id WHERE (users.id_level = '" . $kullan . "' AND (downloaded - uploaded) > '" . $mdiff . "') ORDER BY (uploaded / downloaded) ASC");
}
while ($user = $q->fetch_object()) {
if ($user) {
report($user->fid, $user->username, $user->downloaded, $user->uploaded, $user->level, $user->joined, $user->lastconnect);
$count++;
}
}
print "</form></table>";
echo "<br><br> Found <b>" . $count . "</b> users whose difference is higher than <b>" . misc::makesize($mdiff) . "</b>";
}
block_end();
示例10: myErrorHandler
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
$report = "Error Number: {$errno}<br/>\n\tError: {$errstr}<br/>\n\tFile: {$errfile}<br/>\n\tLine: {$errline}";
die($report);
report($report);
}
示例11: show_page
function show_page($cur_page, $dbc)
{
switch ($cur_page) {
case '/limbo_landing.php':
# Store current page as number, to send in GET request for quick link item details, the current page will determine what content to filter and which 'go back' to display
$p = 0;
# Define query for the homepage records - return the 6 most recent items
$query = 'SELECT stuff.id, stuff.create_date, stuff.description, stuff.status, stuff.image_url, locations.name
FROM stuff, locations
WHERE stuff.location_id = locations.id
ORDER BY stuff.update_date DESC LIMIT 6';
# Store the query results in $results
$results = mysqli_query($dbc, $query);
check_results($results);
# Show results
# But...wait until we know the query succeed before
# rendering the table start.
if ($results) {
# Display homepage banner
echo '<section id="banner">
<header>
<h2>Welcome to Limbo</h2>
<p>The Ultimate Lost & Found System</p>
</header>
</section>';
# Diplay intro/info and get started/learn more buttons
# Set up the modal dialog for Get Started, along with javascript to enable actions/button events
echo '<section id="intro" class="container">';
echo '<div class="row">
<div class="4u 12u(mobile)">
<section class="first">
<i class="icon featured fa-cog"></i>
<header>
<h2>Find Your Lost Items</h2>
</header>
<p>Lost something? Let Limbo find your item for you.</p>
</section>
</div>
<div class="4u 12u(mobile)">
<section class="middle">
<i class="icon featured alt fa-flash"></i>
<header>
<h2>Quick & Easy</h2>
</header>
<p>Limbo is a lightweight, user-friendly system, so that you can focus on finding or reporting items as quickly as possible.</p>
</section>
</div>
<div class="4u 12u(mobile)">
<section class="last">
<i class="icon featured alt2 fa-star"></i>
<header>
<h2>Security & Privacy</h2>
</header>
<p>We incorporate several filters to keep your item details secure, so that you can have a peace of mind.</p>
</section>
</div>
</div>
<footer>
<ul class="actions">
<li><input class="button big" type="button" id="getstartedbtn" value="Get Started"></li>
<li><a href="faq.php" class="button alt big">Learn More</a></li>
</ul>
<dialog style="width:25%; height:60%;" id="getstartedDialog">
<form action="' . $_SERVER['PHP_SELF'] . '" method="post">
<section class="box">
<section>
<p><h3>Did you lose an Item?</h3>
<a style="font-size:20px;" href="lost.php">Lost Items</a><br>
<a style="font-size:20px;" href="lost-1.php">Report Lost Item</a><p>
<br>
<p><h3>Did you find an Item?</h3>
<a style="font-size:20px;" href="found.php">Found Items</a><br>
<a style="font-size:20px;" href="found-1.php">Report found Item</a><p>
</section>
<menu>
<button id="cancelDialogGS" type="reset">Cancel</button>
</menu>
</section>
</form>
</dialog>
<script>
(function() {
var Item = document.getElementById(\'getstartedbtn\');
var favDialog = document.getElementById(\'getstartedDialog\');
var cancelButton = document.getElementById(\'cancelDialogGS\');
// Update buttons opens a modal dialog
Item.addEventListener(\'click\', function() {
favDialog.showModal();
});
// Form cancel button closes the dialog box
cancelButton.addEventListener(\'click\', function() {
favDialog.close();
});
})();
</script>
</footer>
</section>
//.........这里部分代码省略.........
示例12: PDO
// each Line
}
return $packages;
}
try {
$db = new PDO("mysql:dbname=" . MYBASE . ";host=" . MYHOST, MYUSER, MYPASS);
$sql = "SELECT DISTINCT CONCAT('%',SUBSTRING(name,1,1)) as init\n FROM rpm\n ORDER BY init";
$res = $db->query($sql);
if ($res) {
while ($s = $res->fetchObject()) {
$starts_with[] = $s;
}
$smarty->assign('starts_with', $starts_with);
}
$sql = "SELECT DISTINCT owner FROM acls ORDER BY owner";
$res = $db->query($sql);
if ($res) {
while ($owner = $res->fetchObject()) {
$owners[] = $owner;
}
$smarty->assign('owners', $owners);
}
$rpmrepo = new TableRpmRepo($db);
$smarty->assign('repositories_update', date("r", $rpmrepo->getMaxStamp()));
$smarty->assign('packages', report($db));
} catch (PDOException $e) {
$smarty->assign('error', sprintf("%s ERREUR : %s\n", date("r"), $e->getMessage()));
}
$page_content = $smarty->fetch('all.tpl');
$smarty->assign('page_content', $page_content);
$smarty->display('main.tpl');
示例13: changepsd
function changepsd($con, $token)
{
$token = mysql_real_escape_string($token);
$nowtime = time();
$statement = "select password from userinfo where token='{$token}' and {$nowtime}-tokentime<={$GLOBALS['validtime']} limit 1";
$result = mysql_query($statement);
$result = mysql_fetch_array($result);
if (!$result) {
report(1, "会话超时,请重新<a href='../login'>登录</a>");
}
$oldpsd = @$_REQUEST['old'];
if (strtoupper($result['password']) != strtoupper($oldpsd)) {
report(2, "旧密码不正确,请重新输入");
}
$newpsd = @$_REQUEST['new'];
$newtoken = md5($oldpsd . $nowtime);
$statement = "update userinfo set password='{$newpsd}',token='{$newtoken}' where token='{$token}' limit 1";
if (mysql_query($statement)) {
report(0, $newtoken);
} else {
report(3, mysql_error());
}
}
示例14: run_query
function run_query($connection, $query, $display, $form_is_empty)
{
$connection = $connection;
$query = $query;
$display = $display;
$form_is_empty = $form_is_empty;
function db_interfacing($connection, $query, $form_is_empty)
{
$connection = $connection;
$query = $query;
$form_is_empty = $form_is_empty;
function send_query($connection, $query, $empty_form_test)
{
$connection = $connection;
$form_is_empty = $empty_form_test;
$query = $query;
if ($form_is_empty == FALSE) {
$result = mysqli_query($connection, $query);
return $result;
}
}
$result = send_query($connection, $query, $form_is_empty);
return $result;
}
function report($result, $display, $form_is_empty)
{
//$result = $result;
//$display = $display;
//$form_is_empty = $form_is_empty;
if ($result) {
echo "Successfully added {$display}.";
redirect_to("submission.php?display=personnel", 0);
} elseif (!empty($_POST) && ($form_is_empty = TRUE)) {
echo "Please enter data and click 'Add'.";
}
}
$result = db_interfacing($connection, $query, $form_is_empty);
report($result, $display, $form_is_empty);
}
示例15: escapeshellarg
$site = escapeshellarg($raw_url);
if ($_SERVER['HTTP_HOST'] == 'localhost') {
$display = ":0";
} else {
$display = ":10";
}
report("I have to start a browser and everything ... come on now.");
exec('DISPLAY=' . $display . ' cutycapt --min-height=768 --min-width=1024 --url=' . $site . ' --out=img/' . $md5 . '.png');
report("Ok now I need to resize the screen shot...");
// only continue if the image was successfully made.
if (file_exists('img/' . $md5 . '.png')) {
exec('convert img/' . $md5 . '.png -resize 300x -crop 300x320+0+0 -resize 300x img/' . $md5 . '_tn.jpg');
// remove the big file
unlink('img/' . $md5 . '.png');
$title = $db->escapeString(get_title($url));
$db->exec('
insert into sites (url, title, up, down, view)
values("' . $url . '", "' . $title . '", 1, 0, 1)');
if ($db->lastErrorCode() !== 0) {
echo $db->lastErrorMsg();
exit(0);
}
} else {
report("Oh shit ... couldn't get screen shot.");
die;
}
}
report("And now you go back to where you came from! farewell");
sleep(1);
echo "<script>document.location='/?what=new-stuff-thats-what&sort=new-shit'</script>";
flush();