安装有些PHP扩展后,直接把它添加到 php.ini 可能会报错。
这时候新建一个 ini 文件在 /etc/php.d/ 下面,重启 php-fpm 就好了。
document.onkeydown = function(e) { | |
var theEvent = e || window.event; | |
var code = theEvent.keyCode || theEvent.which || theEvent.charCode; | |
if (code == 13){ | |
// do something | |
} | |
} |
" ----------------- Author: Anye | |
" Ctrl + H --光标移当前行行首 | |
" Ctrl + J --光标移下一行行首 | |
" Ctrl + K --光标移上一行行尾 | |
" Ctrl + L --光标移当前行行尾 | |
" Ctrl + C --编译 [支持C/C++、Java、Haskll] | |
" Ctrl + R --运行 [支持C/C++、Java、Haskell、Lua、Perl、Python、Ruby] | |
" Ctrl + ] --转到函数定义 |
<?php | |
/** | |
* 简单PHP模板引擎 | |
* | |
* @author Anye | |
* | |
*/ | |
class PHPView | |
{ | |
protected $data = array(); |
function __json_encode( $obj ) | |
{ | |
if( defined( 'JSON_UNESCAPED_UNICODE' ) ){ // >= php 5.4 | |
return json_encode( $obj, JSON_UNESCAPED_UNICODE ); | |
} else { | |
return preg_replace( "/\\\\u([a-f0-9]{4})/e", "iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))", json_encode( $obj ) ); | |
} | |
} |
function JSON($data) | |
{ | |
arrayRecursive($data, 'urlencode', true); | |
$json = json_encode($data); | |
return urldecode($json); | |
} |
<?php | |
/** | |
* Flexihash - A simple consistent hashing implementation for PHP. | |
* | |
* The MIT License | |
* | |
* Copyright (c) 2008 Paul Annesley | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal |
<?php | |
xhprof_enable(XHPROF_FLAGS_CPU+XHPROF_FLAGS_MEMORY); | |
register_shutdown_function(function() { | |
$xhprof_data = xhprof_disable(); | |
include_once __DIR__ . '/xhprof/xhprof_lib/utils/xhprof_lib.php'; | |
include_once __DIR__ . '/xhprof/xhprof_lib/utils/xhprof_runs.php'; | |
$xhprof_runs = new XHProfRuns_Default(); | |
$run_id = $xhprof_runs->save_run($xhprof_data, "ce"); | |
}); |
安装有些PHP扩展后,直接把它添加到 php.ini 可能会报错。
这时候新建一个 ini 文件在 /etc/php.d/ 下面,重启 php-fpm 就好了。
#!/bin/bash | |
# | |
# Startup script for Nginx - this script starts and stops the nginx daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Tengine is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /usr/local/tengine/conf/nginx.conf | |
# pidfile: /usr/local/tengine/logs/nginx.pid | |
#! /bin/sh | |
# | |
# chkconfig: - 84 16 | |
# description: PHP FastCGI Process Manager | |
# processname: php-fpm | |
# config: /etc/php-fpm.conf | |
# config: /etc/sysconfig/php-fpm | |
# pidfile: /var/run/php-fpm/php-fpm.pid | |
# | |
### BEGIN INIT INFO |