Zend Framework + Smarty2 + Smarty3 整合應用
在你開始閱讀前請先前往鐵神:Smarty 2 整合到 Zend Framework 1.10 閱讀完畢並了解.
之前有使用過ZFDebug 感受到整合便利性,於是在整合Sarmty 時想嘗試類似方式做到方便的整合.
筆記 Haproxy 設定
Haproxy 設定筆記
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#chroot /var/chroot/haproxy
user haproxy
group haproxy
daemon
#debug
#quiet
nbproc 2 # Number of processes
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
maxconn 2000
contimeout 5000
clitimeout 30000
srvtimeout 50000
monitor-uri /ok.html
stats uri /stats
stats auth admin:admin
listen load_balanced_http :80
mode http
option httpchk
option httplog
option forwardfor
option httpclose # disable keep-alive
option checkcache # block response if set-cookie & cacheable
option redispatch
option persist
cookie SERVERID insert nocache indirect
balance roundrobin
server shop1 192.168.0.1:80 cookie server01 weight 49 maxconn 400 check inter 40000
server shop2 192.168.0.2:80 cookie server02 weight 51 maxconn 500 check inter 40000
listen load_balanced_https :443
mode tcp
balance roundrobin
option ssl-hello-chk
option forwardfor
server shop1 192.168.0.1:443 check inter 30000 rise 1 fall 2
server shop2 192.168.0.2:443 check backup
Zend Famework 1.10.3 + ZFDebug
對基本架構不了解可先前往 鐵神: http://www.jaceju.net/blog/?p=1077
此架構為快速架構起始專案的設定
application.ini 內容
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
;resources.frontController.noViewRenderer = 1
autoloadernamespaces[] = "ZFDebug"
;Stand Databse setting
resources.db.adapter = "pdo_mysql"
resources.db.params.host = "localhost"
resources.db.params.username = "wacow"
resources.db.params.password = "123456"
resources.db.params.dbname = "wacow"
resources.db.params.charset = "UTF8"
resources.db.params.profiler = true
;resources.db.isDefaultTableAdapter = true
; Multidb Databse setting
resources.multidb.db1.adapter = "pdo_mysql"
resources.multidb.db1.host = "localhost"
resources.multidb.db1.username = "wacow"
resources.multidb.db1.password = "123456"
resources.multidb.db1.dbname = "wacow"
resources.multidb.db1.charset = "UTF8"
resources.multidb.db1.params.profiler.enabled = true
resources.multidb.db1.params.profiler.class = "Zend_Db_Profiler_Firebug"
resources.multidb.db2.adapter = "pdo_mysql"
resources.multidb.db2.host = "localhost"
resources.multidb.db2.username = "wacow"
resources.multidb.db2.password = "123456"
resources.multidb.db2.dbname = "wacow"
resources.multidb.db2.charset = "UTF8"
resources.multidb.db2.params.profiler.enabled = true
resources.multidb.db2.params.profiler.class = "Zend_Db_Profiler_Firebug"
;resources.multidb.db2.default = true
[staging : production]
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
不同以往 要起始ZFDebug只要加入
FreeBSD NGINX + PHP5
先去官網找到freebsd專用的port
http://php-fpm.org/downloads/freebsd-port/
# fetch http://php-fpm.org/downloads/php-5.2.10-fpm-0.5.13.diff.gz
# mv php-5.2.10-fpm-0.5.13.diff.gz /usr/ports/distfiles/
# fetch http://files.directadmin.com/services/custombuild/php-5.2.9-mail-header.patch
# mv php-5.2.9-mail-header.patch /usr/ports/distfiles/
# fetch http://php-fpm.org/downloads/freebsd-port/php-5.2.10-fpm-0.5.13.tar.gz
php-5.2.10-fpm-0.5.13.tar.gz 100% of 9503 B 45 kBps
# tar zxvf php-5.2.10-fpm-0.5.13.tar.gz -C /usr/ports/lang
x php5-fpm/
x php5-fpm/files/
x php5-fpm/Makefile
x php5-fpm/distinfo
x php5-fpm/pkg-descr
x php5-fpm/pkg-plist
x php5-fpm/files/php-fpm.sh.in
x php5-fpm/files/patch-scripts::phpize.in
x php5-fpm/files/patch-TSRM_threads.m4
x php5-fpm/files/patch-Zend::zend.h
x php5-fpm/files/patch-Zend_zend_list.c
x php5-fpm/files/patch-Zend_zend_list.h
x php5-fpm/files/patch-ext_standard_array.c
x php5-fpm/files/patch-ext_standard_basic_functions.c
x php5-fpm/files/patch-ext_standard_dns.h
x php5-fpm/files/patch-ext_standard_image.c
x php5-fpm/files/patch-php.ini-dist
x php5-fpm/files/patch-php.ini-recommended
x php5-fpm/files/patch-main::php_config.h.in
x php5-fpm/files/patch-main_SAPI.c
x php5-fpm/files/patch-acinclude.m4
x php5-fpm/files/patch-configure.in
# cd /usr/ports/lang/php5-fpm/
# make install clean
# fetch http://www.grid.net.ru/nginx/download/nginx_upload_module-2.0.12.tar.gz
# mv nginx_upload_module-2.0.12.tar.gz /usr/ports/distfiles/
# fetch http://mod-zip.googlecode.com/files/mod_zip-1.1.5.tar.gz
# mv mod_zip-1.1.5.tar.gz /usr/ports/distfiles/
# cd /usr/ports/www/nginx-devel
# make install clean
編輯/usr/local/etc/php-fpm.conf
nobody改成www
Loadfile Class PHP效能增進
前些日子有參加,WEB效能增進的研討會.
思考PHP效能進化,不外乎找套件使用他愛他.
阿勒 怎摸沒有人做東西去改變他??
回歸問題點當每個人都有辦法去安裝套件或軟體去增進效能.
學習 FreeBSD ports
安裝
cd /usr/ports/ports-mgmt/porttools ; make install clean
簡介
FreeBSD Port Tools includes the following commands: - port create: create a new port from a template - port diff: generate a diff against a previous version of the port - port fetch: fetch distfile(s) of a new version of the port - port help: display usage summary for port(1) commands - port submit: submit a PR with new port, or port change/update - port test: automate testing a new port or a port update WWW: http://sourceforge.net/projects/porttools/ 參考: http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/index.html https://blog.dragon2.net/2009/12/17/912.php http://www.joehorn.idv.tw/archives/2010/03/02/759/ http://www.ptt.cc/man/FreeBSD/DEBD/D160/M.1135705310.A.E5B.htmlFreeBSD ports send-pr 初體驗
改造 ZF架構呼叫檔案方式

(點圖看大圖)
加了自己的 loadfiles class
改掉ZF LOADER 內的 static function loadFile 的 include 改為我的loadfiles class.
有看過原圖的人會發現大不同了.
原架構的ZF執行狀況[
jQuery 1.4 研究與報導 之個人見解(二)
New .toArray() method
.get()用來轉換陣列,將被移除.
jQuery1.4 請使用.toArray() 不用帶入參數可以自動解析.
jQuery() returns empty set
在舊版jQuery1.3 jQuery() 會回傳整個結構函數.
jQuery1.4 將改善此現象 回傳一個空函數.
PS:保留jQuery().ready() 和 jQuery(function(){}).
jQuery(“TAG”)
快數透過TAG目標定義選取.
CSS
The performance of the .css() method has seen a 2x performance improvement.
.css()速度大幅增長2倍,請看官方圖表.
The performance of the .addClass()
, .removeClass()
, and .hasClass()
methods has seen a 3x performance improvement.
.addClass().removeClass().hasClass()
速度大幅增長3倍,請看官方圖表.
jQuery 1.4 研究與報導 之個人見解(一)
本文皆為個人見解如有錯誤,煩請賜教.
jQuery 1.4 於2010/01/14 釋出.
官方同時間開啟一個活動專欄頁面報導 14 Days of jQuery.
In celebration of jQuery’s 4th birthday, the jQuery team is pleased to release the latest major release of the jQuery JavaScript library! A lot of coding, testing, and documenting has gone into this release, and we’re really quite proud of it.
I want to personally thank Brandon Aaron, Ben Alman, Louis-Rémi Babe, Ariel Flesler, Paul Irish, Robert Katić, Yehuda Katz, Dave Methvin, Justin Meyer, Karl Swedberg, and Aaron Quint who put a lot of work into fixing bugs and getting the release out the door.
文中開頭就敘述了.1.4的釋出跟jQuery的生日是同一天(蠻有意義的).並且更新了官網說明文件.
Downloading
這次官方使用Google Closure Compiler 來做壓縮.
- jQuery Minified (23kb Gzipped)
- jQuery Regular (154kb)
還有再google提供的cdn
http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js
QEMU on FreeBSD 8.0 再你的的server上,建立自己的虛擬電腦 lab 以供測試開發.
一直以來你是否有跟我有相同的困擾? 手頭上只有一台機器,效能尚可系統負載不高.
但工作需要執行多種環境測試實驗,無法隨身攜帶各種系統. 等等困境….
一般的虛擬機器軟體又需要圖型介面,才可設定使用.(這無疑對系統又是一種負擔,與當機危險)
現在終於有實際解決方案~所需費用 0.