Skip to content

Instantly share code, notes, and snippets.

@smallslime
smallslime / stdtpl_main.php
Last active Mar 18, 2017
服务+ZK模式, 支持热更新, 平滑重启
View stdtpl_main.php
<?php
final class stdtpl_main
{
const P_NAME_MAIN = 'main';
const P_NAME_ZK = 'zk';
const P_NAME_SERVER = 'server';
private static $iTimeWaitForServerPreHeat;
private static $iTimeWaitForServerCoolDown;
View FileCache.php
<?php
namespace QMTV\System;
/**
* Class FileCache
*
* @author liuzhen
*/
class FileCache
{
View A-新特性.md

##PHP 5.4新特性##

掌握

  • traits
    trait的引入,可以扩展class的内容,使class在某种形式上实现了多重继承,更加灵活,trait不能被实例化 示例代码:

    <?php
    trait Hello {
    
View gist:6076840
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="keywords" content="管理后台">
<meta name="description" content="管理后台"/>
<title>GA管理后台</title>
<style type="text/css">
html,body {
View gist:5965865
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
# python 2.3.*: email.Utils email.Encoders
from email.utils import COMMASPACE, formatdate
from email import encoders
You can’t perform that action at this time.