当前位置: 首页>>代码示例>>PHP>>正文


PHP lg函数代码示例

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


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

示例1: send

function send()
{
    $pid = posix_getpid();
    $client = new swoole_client(SWOOLE_SOCK_TCP, SWOOLE_SOCK_ASYNC);
    //异步非阻塞
    $client->on("connect", function (swoole_client $cli) use($pid) {
        $data = microtime(true);
        lg("[{$pid}] Send: {$data}", __LINE__);
        $cli->send($data);
    });
    $client->on("receive", function (swoole_client $cli, $data) use($pid) {
        lg("[{$pid}] Received: {$data}", __LINE__);
        $cli->close();
    });
    $client->on("error", function (swoole_client $cli) use($pid) {
        $cli->close();
        //lg("[$pid] error then conn close", __LINE__);
        exit(0);
    });
    $client->on("close", function (swoole_client $cli) use($pid) {
        //lg("[$pid] conn close", __LINE__);
    });
    $client->connect('127.0.0.1', 8001, 0.5);
    //lg("[$pid] create conn succ", __LINE__);
    exit(0);
}
开发者ID:jinguanio,项目名称:david,代码行数:26,代码来源:multi_cli.php

示例2: config

function config($name, $value = null)
{
    global $config;
    if ($value) {
        return $config->{$name} = $value;
    } else {
        if (empty($config->{$name})) {
            lg('Parameter ' . $name . ' not defined in config', 'warning');
        }
        return isset($config->{$name}) ? $config->{$name} : '';
    }
}
开发者ID:anatoliychakkaev,项目名称:webdesk,代码行数:12,代码来源:common_functions.php

示例3: start

 static function start($controller)
 {
     $content = trace($controller, 1);
     $content = '';
     if (!method_exists($controller, 'xrespond')) {
         self::show_welcome();
     }
     $template = file_get_contents(__DIR__ . "/html/mini.html") ?: "{{content}}";
     $content = str_replace("{{content}}", $content, $template);
     lg($content);
     print $content;
 }
开发者ID:rozsahegyi,项目名称:mini-fw,代码行数:12,代码来源:Mini.php

示例4: get_queue

function get_queue()
{
    global $redis_key;
    $redis = conn_redis();
    while (1) {
        $ret = $redis->blPop($redis_key, 30);
        if (isset($ret[1])) {
            //lg("[" . posix_getpid() . '] ' . var_export($ret[1], true));
            lg($ret[1]);
        }
        usleep(5000);
    }
}
开发者ID:jinguanio,项目名称:david,代码行数:13,代码来源:multiproc_redis.php

示例5: messages

 public function messages()
 {
     $messages = collect();
     try {
         $fetch = $this->server()->getMessages();
     } catch (ErrorException $e) {
         lg('notice', $e->getMessage(), [$this->email->except('userpass')->toArray()]);
         return $messages;
     }
     foreach ($fetch as $message) {
         $messages->push($this->create($message));
     }
     return $messages;
 }
开发者ID:hughfletcher,项目名称:nuticket,代码行数:14,代码来源:ImapServer.php

示例6: send_data

function send_data()
{
    global $count;
    global $url, $port;
    $pid = posix_getpid();
    $fp = @stream_socket_client("tcp://{$url}:{$port}", $errno, $errstr, 30);
    if (!$fp) {
        exit(1);
    }
    $rand = random();
    $data = time() . "-{$rand}-{$pid}-{$count}";
    fwrite($fp, $data . "\r\n");
    lg("c: {$data}");
    //$ret = fgets($fp, 1024);
    fclose($fp);
    exit(0);
}
开发者ID:jinguanio,项目名称:david,代码行数:17,代码来源:proxy_sync.php

示例7: send_data

function send_data()
{
    global $count;
    global $url, $port;
    global $base;
    $pid = posix_getpid();
    $rand = random();
    $data = time() . "-{$rand}-{$pid}-{$count}";
    $bev = new EventBufferEvent($base, null, EventBufferEvent::OPT_CLOSE_ON_FREE | EventBufferEvent::OPT_DEFER_CALLBACKS);
    $bev->setTimeouts(3, 3);
    $bev->setCallbacks('readcb', null, 'eventcb', $pid);
    $bev->enable(Event::READ | Event::WRITE);
    $bev->connect("{$url}:{$port}");
    $bev->write($data . "\r\n");
    $base->dispatch();
    lg("[{$pid}] {$data}");
    //lg("pid:{$pid},count:{$count}");
    exit(0);
}
开发者ID:jinguanio,项目名称:david,代码行数:19,代码来源:proxy_async.php

示例8: load

 public static function load($view_rep, $view_file)
 {
     if (tg('_tsk') == 'news') {
         $instance = new news();
         $array = $instance->index();
     }
     if (isset($array)) {
         $titre = lg('TITR') . ' | ' . $array['titre'];
         $content = htmlentities($array['titre']);
         $image = "http://{$_SERVER['HTTP_HOST']}" . criimg_link('upload/news/' . $array['img'], 200, 200, 'PNG');
         $actual_link = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
     } else {
         $titre = lg('TITR');
         $content = 'Site Internet Officiel de la présidence de la République du Tchad.';
         $image = './img/header.jpg';
         $actual_link = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
     }
     include_once AFFICH_REP . 'layout/header.php';
     include_once AFFICH_REP . 'layout/limen.php';
     include_once AFFICH_REP . $view_rep . SLASH . $view_file . '_v.php';
 }
开发者ID:ATS001,项目名称:PRSIT,代码行数:21,代码来源:view.class.php

示例9: lg

<div class="span9">
<div class="postcontent"><h2><?php 
echo lg('PLUSACT');
?>
</h2>
<link rel="stylesheet" href="css/zebra_pagination.css" type="text/css">
 <?php 
global $db;
$records_per_page = 6;
$pagination = new pagination();
if (!$db->Query("SELECT titr" . LANG . " as titre ,id,img,app,DATE_FORMAT(dat,'%d-%m-%Y') as dat,cont" . LANG . " as content from news   where titr" . LANG . " IS NOT NULL and flash = 0 order by id DESC")) {
    $db->Kill('Error1s');
}
if ($db->RowCount() > 0) {
    $totalrow = $db->RowCount();
    $requet = "SELECT titr" . LANG . " as titre,aut" . LANG . " as autor ,id,img,app,DATE_FORMAT(dat,'%d-%m-%Y') as dat,cont" . LANG . " as content from news   where titr" . LANG . " IS NOT NULL and flash = 0 order by id DESC limit " . ($pagination->get_page() - 1) * $records_per_page . ', ' . $records_per_page;
    if (!$db->Query($requet)) {
        $db->Kill($requet);
    }
    $pagination->records($totalrow);
    $pagination->records_per_page($records_per_page);
    ?>


            <?php 
    $index = 0;
    ?>

            <?php 
    while (!$db->EndOfSeek()) {
        $row = $db->Row();
开发者ID:ATS001,项目名称:PRSIT,代码行数:31,代码来源:lstnews_v.php

示例10: lg

<?php 
}
?>
 
 <!--End Lien TDB-->
<!--Start Lien Util-->
 
 <?php 
if (!$db->Query("SELECT titr" . LANG . " as titre ,id, lien from lienu   where titr" . LANG . " IS NOT NULL order by id ")) {
    $db->Kill('Error1s');
}
if ($db->RowCount() > 0) {
    ?>
 <div class="panel panel-primary span12 blkcom div3" style="webkit-border-radius:5px;border-radius:5px; border: 1px solid ;border-color:#49bae8;padding: 10px 15px; ">
   <h5> <?php 
    echo lg("LIEN");
    ?>
 </h5>
  <div class="panel-body">  
  <ul class="nav nav-pills ddmenu  "  >
<?php 
    while (!$db->EndOfSeek()) {
        $row = $db->Row();
        //  $class= str_replace(".","",strrchr($row->img,'.'));
        ?>
     <li class="span12 div2" ><a  href="http://<?php 
        echo $row->lien;
        ?>
" target=_blank ><i class="general foundicon-star"></i><?php 
        echo $row->titre;
        ?>
开发者ID:ATS001,项目名称:PRSIT,代码行数:31,代码来源:tdb_v1.php

示例11: workOnUser

 public function workOnUser($provider, $provideruser, $profile)
 {
     // $provideruser has profile details from provider
     $social = Social::model()->find("provider='" . $provider . "' AND provideruser='" . $provideruser . "'");
     if ($social) {
         $user = User::model()->find("id=" . $social->yiiuser);
         // $user['yiiuser'] has app user id
         return $user;
     } else {
         // no user is connected to that provideruser,
         $social = new Social();
         // a new relation will be needed
         $social->provider = $provider;
         // what provider
         $social->provideruser = $provideruser;
         // the unique user
         // if a yii-user is already logged in add the provideruser to that account
         if (!Yii::app()->user->isGuest) {
             $social->yiiuser = Yii::app()->user->id;
             $user = User::model()->findByPk(Yii::app()->user->id);
             lg('Existing user' . $social->yiiuser);
             lg('Existing user email' . $user->email);
             // capture profile info
             $user_profile = Yii::app()->getModule('user')->user($social->yiiuser)->profile;
             $user->model()->syncProfileViaHybridAuth($user_profile, $profile);
         } else {
             lg('Facebook email: ' . $profile->email);
             $user = User::model()->findByAttributes(array('email' => $profile->email));
             if (!is_null($user)) {
                 // to do - create way to associate facebook account
                 Yii::app()->user->setFlash('email_problem', 'Your email already exists. Please log in to your account with your email.');
                 Yii::app()->user->setReturnUrl('/user/profile/edit');
                 $this->redirect('/user/login');
             }
             if ($profile->email == '') {
                 lg('Hybrid: No email, report error & redirect user');
                 Yii::app()->user->setFlash('email_problem', 'We require your email for registration.');
                 $this->redirect('/user/registration');
             }
             // we want to create a new user
             // take new profile info and register user
             lg('New user');
             $user_id = User::model()->registerViaHybridAuth($profile);
             if ($user_id !== false) {
                 $user = User::model()->findByPk($user_id);
                 $social->yiiuser = $user->id;
             }
             // to do - if no new user_id
             // then social id is 0 and future log in will fail
             // return with new user id
         }
         if ($social->save()) {
             return $user;
         }
     }
 }
开发者ID:mafiu,项目名称:listapp,代码行数:56,代码来源:DefaultController.php

示例12: lg

<div class="postcontent"><h2><?php 
echo lg('LIEN');
?>
</h2>

<?php 
global $db;
$records_per_page = 16;
$pagination = new pagination();
if (!$db->Query("SELECT titr" . LANG . " as titre ,id from lienu   where titr" . LANG . " IS NOT NULL order by id ")) {
    $db->Kill('Error1s');
}
if ($db->RowCount() > 0) {
    $totalrow = $db->RowCount();
    if (!$db->Query("SELECT titr" . LANG . " as titre ,id,lien from lienu   where titr" . LANG . " IS NOT NULL order by id  limit  " . ($pagination->get_page() - 1) * $records_per_page . ', ' . $records_per_page)) {
        $db->Kill('Error1s');
    }
    $pagination->records($totalrow);
    $pagination->records_per_page($records_per_page);
    ?>

<div class="pj">
<ul>
<?php 
    while (!$db->EndOfSeek()) {
        $row = $db->Row();
        //	$class=	str_replace(".","",strrchr($row->img,'.'));
        ?>
     <li class="lien"><a href="http://<?php 
        echo $row->lien;
        ?>
开发者ID:ATS001,项目名称:PRSIT,代码行数:31,代码来源:lien_v.php

示例13: lg

			<?php 
require 'buy_button.php';
?>
		</div>
	</div>

	<?php 
//Вкладки
?>
	<div class="product_dop_modes">
		<?php 
if ($product->paramNotEmpty('param_polnoeopisanie')) {
    // полное описание товара
    ?>
			<div class="product_dop_modes_content alter_block product_dop_modes_content_tab" itemprop="description" data-modtitle="<?php 
    echo lg('Описание');
    ?>
">
				<?php 
    echo HTML::del_mso_code($product->get('param_polnoeopisanie'));
    ?>
			</div>
		<?php 
}
?>
		
		
		<?php 
if (ISHOP_GALLERY) {
    //другие товары в этой категории
    ?>
开发者ID:Vladimir25,项目名称:marykay,代码行数:31,代码来源:product.php

示例14: fl

                <div id="act">
<a href="com-<?php 
        echo $row->id . '-' . fl($row->titre);
        ?>
.html" id="link">
<p  class="titactp"><?php 
        echo $row->titre;
        ?>
 </p>
<p id="datact" class="datact"><?php 
        echo $row->dat;
        ?>
</p>
<P class="contact"><?php 
        echo limitmot($row->content, 25) . '.....' . '<span class="suit">' . lg('SUIT') . '</span>';
        ?>
</P>
</a>

</div><!--End act-->
            <?php 
    }
    ?>

 </div>       

        <?php 
    // render the pagination links
    $pagination->render();
} else {
开发者ID:ATS001,项目名称:PRSIT,代码行数:30,代码来源:lstcom_v.php

示例15: lg

          </ul>
        
          <!-- #######################################fin partie 1 d'actualiter######################################################### --> 
        <?php 
    } else {
        ?>

   
     
        <!-- / Right Column --> 
      </div>
   <p class="nospace btmspace-15" ><?php 
        echo lg('MSGVIDE');
        ?>
</p>  <?php 
    }
} else {
    ?>

                       <p class="nospace btmspace-15" ><?php 
    echo lg('MSGVIDE');
    ?>
</p>
                   
         <?php 
}
?>

         
          <!-- ################################################################################################ --> 
        </div>
开发者ID:ATS001,项目名称:PRSIT,代码行数:31,代码来源:compres_v.php


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