本文整理汇总了PHP中log_info函数的典型用法代码示例。如果您正苦于以下问题:PHP log_info函数的具体用法?PHP log_info怎么用?PHP log_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了log_info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: makeArticleEasy
function makeArticleEasy($article)
{
log_info($article);
$conn = getDB();
$words = explode(" ", $article);
$outp = "";
$array = array();
foreach ($words as $word) {
$word = str_replace('"', "", $word);
$word = str_replace("'", "", $word);
$word = str_replace(" ", "", $word);
$word = str_replace(".", "", $word);
$word = str_replace(",", "", $word);
$word = str_replace(":", "", $word);
$word = str_replace("\\", "", $word);
if (empty($word) || strlen($word) < 3) {
continue;
}
$meaning = '';
$gender = '';
$partOfSpeech = '';
//check if the meaning exist in DB
$result = mysqli_query($conn, "SELECT * FROM words WHERE word = '" . $word . "'");
if (mysqli_num_rows($result) == 0) {
// row not found, get from online dicts
$link = "http://de-en.dict.cc/?s=" . utf8_encode($word);
$meaning = getMeaningFromOnlinDict($link);
if (!empty($meaning)) {
insertWord($conn, $word, $meaning, null, null, 0);
} else {
continue;
}
} else {
//take db value
$row = mysqli_fetch_row($result);
//var_dump($row);
$meaning = $row[2];
$partOfSpeech = $row[3];
$gender = $row[4];
}
if (empty($meaning)) {
continue;
}
//now return as json object
// if ($outp != "") {$outp .= ",";}
$a = new Article();
$a->word = $word;
$a->meaning = $meaning;
array_push($array, $a);
// $outp .= '{"word":"' . $word . '",';
//$outp .= '"meaning":"' . $meaning . '",';
// $outp .= '"meaning":"' . $meaning. '"}';
// $outp .= '"partOfSpeech":"' . $partOfSpeech . '",';
// $outp .= '"gender":"' . $gender . '"}';
}
//forloop
//$outp ='{"words":['.$outp.']}';
echo json_encode($array);
$conn->close();
}
示例2: onInitExt
public function onInitExt(InitExtEvent $event)
{
global $config, $database;
if (!is_numeric($config->get_string("db_version"))) {
$config->set_int("db_version", 2);
}
if ($config->get_int("db_version") < 6) {
// cry :S
}
if ($config->get_int("db_version") < 7) {
if ($database->engine->name == "mysql") {
$tables = $database->db->MetaTables();
foreach ($tables as $table) {
log_info("upgrade", "converting {$table} to innodb");
$database->execute("ALTER TABLE {$table} TYPE=INNODB");
}
}
$config->set_int("db_version", 7);
log_info("upgrade", "Database at version 7");
}
if ($config->get_int("db_version") < 8) {
// if this fails, don't try again
$config->set_int("db_version", 8);
$database->execute($database->engine->scoreql_to_sql("ALTER TABLE images ADD COLUMN locked SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N"));
log_info("upgrade", "Database at version 8");
}
}
示例3: searchProduct
/**
* search product modal.
*
* @param Application $app
* @param Request $request
* @param int $page_no
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function searchProduct(Application $app, Request $request, $page_no = null)
{
if (!$request->isXmlHttpRequest()) {
return null;
}
$pageCount = $app['config']['default_page_count'];
$session = $app['session'];
if ('POST' === $request->getMethod()) {
log_info('get search data with parameters ', array('id' => $request->get('id'), 'category_id' => $request->get('category_id')));
$page_no = 1;
$searchData = array('id' => $request->get('id'));
if ($categoryId = $request->get('category_id')) {
$Category = $app['eccube.repository.category']->find($categoryId);
$searchData['category_id'] = $Category;
}
$session->set('eccube.plugin.related_product.product.search', $searchData);
$session->set('eccube.plugin.related_product.product.search.page_no', $page_no);
} else {
$searchData = (array) $session->get('eccube.plugin.related_product.product.search');
if (is_null($page_no)) {
$page_no = intval($session->get('eccube.plugin.related_product.product.search.page_no'));
} else {
$session->set('eccube.plugin.related_product.product.search.page_no', $page_no);
}
}
$qb = $app['eccube.repository.product']->getQueryBuilderBySearchDataForAdmin($searchData);
/** @var \Knp\Component\Pager\Pagination\SlidingPagination $pagination */
$pagination = $app['paginator']()->paginate($qb, $page_no, $pageCount, array('wrap-queries' => true));
$paths = array();
$paths[] = $app['config']['template_admin_realdir'];
$app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths));
return $app->render('RelatedProduct/Resource/template/admin/modal_result.twig', array('pagination' => $pagination));
}
示例4: register_submit
/**
* Runs when registration form is submitted
*/
function register_submit(Pieform $form, $values)
{
global $SESSION;
$result = registration_send_data();
$data = json_decode($result->data);
if ($data->status != 1) {
log_info($result);
$SESSION->add_error_msg(get_string('registrationfailedtrylater', 'admin', $result->info['http_code']));
} else {
set_config('registration_lastsent', time());
set_config('registration_sendweeklyupdates', $values['sendweeklyupdates']);
if (get_config('new_registration_policy')) {
set_config('new_registration_policy', false);
}
$SESSION->add_ok_msg(get_string('registrationsuccessfulthanksforregistering', 'admin'));
$info = '
<h4>' . get_string('datathathavebeensent', 'admin') . '</h4>
<table class="table table-striped table-bordered" id="register-table">
<thead>
<tr>
<th> ' . get_string('Field', 'admin') . '</th>
<th> ' . get_string('Value', 'admin') . '</th>
</tr>
</thead>
<tbody>
';
$datasent = registration_data();
foreach ($datasent as $key => $val) {
$info .= '<tr><th>' . hsc($key) . '</th><td>' . hsc($val) . "</td></tr>\n";
}
$info .= '</tbody></table>';
$SESSION->add_ok_msg($info, false);
}
redirect('/admin/');
}
示例5: index
/**
* 会員情報編集画面.
*
* @param Application $app
* @param Request $request
* @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
*/
public function index(Application $app, Request $request)
{
$Customer = $app->user();
$LoginCustomer = clone $Customer;
$app['orm.em']->detach($LoginCustomer);
$previous_password = $Customer->getPassword();
$Customer->setPassword($app['config']['default_password']);
/* @var $builder \Symfony\Component\Form\FormBuilderInterface */
$builder = $app['form.factory']->createBuilder('entry', $Customer);
$event = new EventArgs(array('builder' => $builder, 'Customer' => $Customer), $request);
$app['eccube.event.dispatcher']->dispatch(EccubeEvents::FRONT_MYPAGE_CHANGE_INDEX_INITIALIZE, $event);
/* @var $form \Symfony\Component\Form\FormInterface */
$form = $builder->getForm();
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
log_info('会員編集開始');
if ($Customer->getPassword() === $app['config']['default_password']) {
$Customer->setPassword($previous_password);
} else {
if ($Customer->getSalt() === null) {
$Customer->setSalt($app['eccube.repository.customer']->createSalt(5));
}
$Customer->setPassword($app['eccube.repository.customer']->encryptPassword($app, $Customer));
}
$app['orm.em']->flush();
log_info('会員編集完了');
$event = new EventArgs(array('form' => $form, 'Customer' => $Customer), $request);
$app['eccube.event.dispatcher']->dispatch(EccubeEvents::FRONT_MYPAGE_CHANGE_INDEX_COMPLETE, $event);
return $app->redirect($app->url('mypage_change_complete'));
}
$app['security']->getToken()->setUser($LoginCustomer);
return $app->render('Mypage/change.twig', array('form' => $form->createView()));
}
示例6: configure
/**
* Initialize instance
*
* @param Charcoal_Config $config configuration data
*/
public function configure($config)
{
parent::configure($config);
$this->task_manager = us($config->getString('task_manager', ''));
$this->forward_target = us($config->getString('forward_target', ''));
$this->modules = uv($config->getArray('modules', array()));
$this->events = uv($config->getArray('events', array()));
$this->debug_mode = ub($config->getBoolean('debug_mode', FALSE));
$this->log_enabled = ub($config->getBoolean('log_enabled'));
$this->log_level = us($config->getString('log_level'));
$this->log_loggers = uv($config->getArray('log_loggers'));
// eventsに記載しているイベントのモジュールも読み込む
if (is_array($this->events)) {
foreach ($this->events as $event) {
$pos = strpos($event, "@");
if ($pos !== FALSE) {
$this->modules[] = substr($event, $pos);
}
}
}
if ($this->getSandbox()->isDebug()) {
log_info("system, debug, config", "task_manager:" . $this->task_manager, self::TAG);
log_info("system, debug, config", "forward_target:" . $this->forward_target, self::TAG);
log_info("system, debug, config", "modules:" . print_r($this->modules, true), self::TAG);
log_info("system, debug, config", "events:" . print_r($this->events, true), self::TAG);
log_info("system, debug, config", "debug_mode" . $this->debug_mode, self::TAG);
log_info("system, debug, config", "log_enabled" . $this->log_enabled, self::TAG);
log_info("system, debug, config", "log_level" . $this->log_level, self::TAG);
log_info("system, debug, config", "log_loggers" . print_r($this->log_loggers, true), self::TAG);
}
}
示例7: generate_main
function generate_main()
{
global $categories, $forums;
global $filter_forum, $filter_topic;
global $db_prefix;
global $forum_name, $forum_description;
//Categories
$res = mysql_query('SELECT cat_id, cat_title FROM ' . $db_prefix . 'categories order by cat_order');
while ($row = mysql_fetch_assoc($res)) {
$cid = $row['cat_id'];
$categories[$row['cat_id']] = array('title' => $row['cat_title'], 'forums' => array());
}
//Forums
$res = mysql_query('SELECT forum_id, cat_id, forum_name, forum_posts, forum_topics FROM ' . $db_prefix . 'forums ORDER BY forum_order');
while ($row = mysql_fetch_assoc($res)) {
$fid = $row['forum_id'];
if (in_array($fid, $filter_forum)) {
continue;
}
$forums[$fid] = array('cid' => $row['cat_id'], 'title' => $row['forum_name'], 'nposts' => $row['forum_posts'], 'ntopics' => $row['forum_topics'], 'topics' => array());
$categories[$row['cat_id']]['forums'][] = $fid;
}
// Content
$var = array('categories' => $categories, 'forums' => $forums, 'forum_name' => $forum_name, 'forum_description' => $forum_description);
$content = template_get($var, 'main.tpl.php');
write_content('index.html', $content);
log_info("Index: index.html\n");
}
示例8: tg
/**
* 推广连接
* www.xxx.com/action/Method/站长ID/游戏ID/cpa、cps、。。。/子ID/?ref=url
* yy.51yx.com/index/tg/12312312/13/2/11/?ref=url
*/
public function tg()
{
$master_id = $_GET[2];
//站长ID
$game_id = $_GET[3];
//游戏ID
$type = $_GET[4];
//推广类型 cpa/cps
$sub_code = $_GET[5];
//子站长ID
$ref = $_GET['ref'];
setcookie(WEBMASTER, $master_id, 0, '/', DOMAIN);
setcookie(AD_GAME_ID, $game_id, 0, '/', DOMAIN);
setcookie(SPREAD_TYPE, $type, 0, '/', DOMAIN);
//CPS 为2 CPA:1 其它:0
setcookie(SUB_CODE, $sub_code, 0, '/', DOMAIN);
$ip = getClientIP();
//记点击日志
//站长ID,游戏ID,子站长ID,访问IP
$content = $master_id . ',' . $game_id . ',\'' . $sub_code . '\' ' . $ip;
@log_info($content, $file = "tg_click_");
if ($ref) {
$this->gotourl($ref);
} else {
$this->gotourl('/member/register');
}
exit;
}
示例9: log
public function log($level, &$message) {
switch ($level) {
case LogHelper::LEVEL_DEBUG:
log_debug($message);
break;
case LogHelper::LEVEL_INFO:
log_info($message);
break;
case LogHelper::LEVEL_NOTICE:
log_notice($message);
break;
case LogHelper::LEVEL_WARNING:
log_warn($message);
break;
case LogHelper::LEVEL_ERROR:
log_error($message);
break;
case LogHelper::LEVEL_CRITICAL:
log_critical($message);
break;
case LogHelper::LEVEL_ALERT:
log_alert($message);
break;
case LogHelper::LEVEL_EMERGENCY:
log_emergency($message);
break;
}
}
示例10: qwp_tmpl_security_check
function qwp_tmpl_security_check()
{
global $MODULE_URI, $PAGE, $OP;
if (qwp_is_passport_module()) {
return true;
}
$acls = C('acls', null);
if (!$acls) {
qwp_tmpl_init_security($acls);
}
if (!isset($acls['modules'][$MODULE_URI])) {
return false;
}
if ($OP) {
$path = $MODULE_URI;
if ($PAGE) {
$path .= '#' . $PAGE;
}
return isset($acls['ops'][$path]) && isset($acls['ops'][$path][$OP]);
}
if ($PAGE) {
return isset($acls['pages'][$MODULE_URI]) && isset($acls['pages'][$MODULE_URI][$PAGE]);
}
log_info('security check is passed: ' . $MODULE_URI);
}
示例11: onPageRequest
public function onPageRequest(PageRequestEvent $event)
{
global $config, $page, $user;
if ($event->page_matches("featured_image")) {
if ($event->get_arg(0) == "set" && $user->check_auth_token()) {
if ($user->can("edit_feature") && isset($_POST['image_id'])) {
$id = int_escape($_POST['image_id']);
if ($id > 0) {
$config->set_int("featured_id", $id);
log_info("featured", "Featured image set to {$id}", "Featured image set");
$page->set_mode("redirect");
$page->set_redirect(make_link("post/view/{$id}"));
}
}
}
if ($event->get_arg(0) == "download") {
$image = Image::by_id($config->get_int("featured_id"));
if (!is_null($image)) {
$page->set_mode("data");
$page->set_type($image->get_mime_type());
$page->set_data(file_get_contents($image->get_image_filename()));
}
}
if ($event->get_arg(0) == "view") {
$image = Image::by_id($config->get_int("featured_id"));
if (!is_null($image)) {
send_event(new DisplayingImageEvent($image, $page));
}
}
}
}
示例12: index
/**
* 退会画面.
*
* @param Application $app
* @param Request $request
* @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
*/
public function index(Application $app, Request $request)
{
$builder = $app->form();
$event = new EventArgs(array('builder' => $builder), $request);
$app['eccube.event.dispatcher']->dispatch(EccubeEvents::FRONT_MYPAGE_WITHDRAW_INDEX_INITIALIZE, $event);
$form = $builder->getForm();
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
switch ($request->get('mode')) {
case 'confirm':
log_info('退会確認画面表示');
return $app->render('Mypage/withdraw_confirm.twig', array('form' => $form->createView()));
case 'complete':
log_info('退会処理開始');
/* @var $Customer \Eccube\Entity\Customer */
$Customer = $app->user();
// 会員削除
$email = $Customer->getEmail();
// メールアドレスにダミーをセット
$Customer->setEmail(Str::random(60) . '@dummy.dummy');
$Customer->setDelFlg(Constant::ENABLED);
$app['orm.em']->flush();
log_info('退会処理完了');
$event = new EventArgs(array('form' => $form, 'Customer' => $Customer), $request);
$app['eccube.event.dispatcher']->dispatch(EccubeEvents::FRONT_MYPAGE_WITHDRAW_INDEX_COMPLETE, $event);
// メール送信
$app['eccube.service.mail']->sendCustomerWithdrawMail($Customer, $email);
// ログアウト
$this->getSecurity($app)->setToken(null);
log_info('ログアウト完了');
return $app->redirect($app->url('mypage_withdraw_complete'));
}
}
return $app->render('Mypage/withdraw.twig', array('form' => $form->createView()));
}
示例13: receive_event
public function receive_event(Event $event)
{
global $config, $database, $page, $user;
if (is_null($this->theme)) {
$this->theme = get_theme_object($this);
}
if ($event instanceof PageRequestEvent && $event->page_matches("admin")) {
if (!$user->is_admin()) {
$this->theme->display_permission_denied($page);
} else {
send_event(new AdminBuildingEvent($page));
}
}
if ($event instanceof PageRequestEvent && $event->page_matches("admin_utils")) {
if ($user->is_admin() && $user->check_auth_token()) {
log_info("admin", "Util: {$_POST['action']}");
set_time_limit(0);
$redirect = false;
switch ($_POST['action']) {
case 'delete by query':
$this->delete_by_query($_POST['query']);
$redirect = true;
break;
case 'lowercase all tags':
$this->lowercase_all_tags();
$redirect = true;
break;
case 'recount tag use':
$this->recount_tag_use();
$redirect = true;
break;
case 'purge unused tags':
$this->purge_unused_tags();
$redirect = true;
break;
case 'convert to innodb':
$this->convert_to_innodb();
$redirect = true;
break;
case 'database dump':
$this->dbdump($page);
break;
}
if ($redirect) {
$page->set_mode("redirect");
$page->set_redirect(make_link("admin"));
}
}
}
if ($event instanceof AdminBuildingEvent) {
$this->theme->display_page($page);
$this->theme->display_form($page);
}
if ($event instanceof UserBlockBuildingEvent) {
if ($user->is_admin()) {
$event->add_link("Board Admin", make_link("admin"));
}
}
}
示例14: onDataUpload
public function onDataUpload(DataUploadEvent $event)
{
global $database;
$row = $database->get_row("SELECT * FROM image_bans WHERE hash = :hash", array("hash" => $event->hash));
if ($row) {
log_info("image_hash_ban", "Blocked image ({$event->hash})");
throw new UploadException("Image " . html_escape($row["hash"]) . " has been banned, reason: " . format_text($row["reason"]));
}
}
示例15: __construct
/**
* Class constructor
*
* @return void
*/
public function __construct()
{
log_info("info", "security opened");
$this->securitytoken_time = time() + 60 * 1;
$this->securitytoken = "token" . randstring(10);
// 1min
$this->urltoken();
$this->verifyUrl();
}