2010年1月22日 星期五
Yii : How to upload a file using a model
How to upload a file using a model
http://www.yiiframework.com/doc/cookbook/2/
Multi File upload - CFileValidator and CUploadedFile
http://www.yiiframework.com/doc/cookbook/2/
Multi File upload - CFileValidator and CUploadedFile
http://www.yiiframework.com/forum/index.php?/topic/3035-multi-file-upload-cfilevalidator-and-cuploadedfile/
Usefull Yii Extension
Datafilter
This extension can be used to add search and filtration capabilities to data grids.
http://www.yiiframework.com/extension/datafilter/
grbac
This module is for User-Management
http://www.yiiframework.com/extension/grbac/
extendedclientscript
With this extension you can transparently reduce page load times by combining and compressing the used Javascript and CSS files.
http://www.yiiframework.com/extension/extendedclientscript/
euploadify
This extension adds a flash based file-upload with progress-bar and multi-file upload capability.
http://www.yiiframework.com/extension/euploadify/
cfile
This extension offers commonly used functions for filesystem objects (files and directories) manipulation.
http://www.yiiframework.com/extension/cfile/
esanitizer
This extension sanitizes all user input ($_POST, $_GET, $_COOKIE,$_FILES) with html purifier to protect against XSS
http://www.yiiframework.com/extension/esanitizer/
cvsout
http://www.yiiframework.com/extension/csvout/reviews/
printout
http://www.yiiframework.com/extension/printout/
2010年1月10日 星期日
2010年1月7日 星期四
PHP 5.2.6 (Win32) 有個奇怪的問題
<?php
echo 169926.25841615902027 * 31.19;
?>
在版本
5.2.1
5.2.9-2
5.2.11-2 結果都是 5300000
在 5.2.6 結果是 5.3E+6
通常科學符號表示不是我們要的,所以我認定這是個 BUG
echo 169926.25841615902027 * 31.19;
?>
在版本
5.2.1
5.2.9-2
5.2.11-2 結果都是 5300000
在 5.2.6 結果是 5.3E+6
通常科學符號表示不是我們要的,所以我認定這是個 BUG
2010年1月6日 星期三
2010年1月5日 星期二
設定 Apache2 自訂的 php.ini 位置
有時不指定 libmySQL.dll 會出現 (error.log)
win32 下面測試有效,Linux 還未試過
> httpd.conf
win32 下面測試有效,Linux 還未試過
PHP Warning: PHP Startup: Unable to load dynamic library 'D:/appserv/php5/ext/php_mysql.dll' - \xa7\xe4\xa4\xa3\xa8\xec\xab\xfc\xa9w\xaa\xba\xbc\xd2\xb2\xd5\xa1C\r\n in Unknown on line 0
> httpd.conf
LoadModule php5_module "C:/AppServ/php5/php5apache2.dll"
LoadFile "C:\AppServ2.0\php5\php5ts.dll"
# 避免 php_mysql.dll 無法被載入
LoadFile "C:\AppServ2.0\php5\libmySQL.dll"
# 避免php_mcrypt.dll 無法被載入
LoadFile "D:\AppServ\php5\libmcrypt.dll"
# 指定 php.ini 的目錄
PHPINIDir "C:\AppServ2.0\php5"
2009年12月29日 星期二
使用 a2enmod 指令啟用 Apache 模組
a2enmod ssl
a2enmod userdir
a2enmod rewrite
a2enmod suexec
a2enmod include
http://philipatswarchy.wordpress.com/category/technical/ssl/
a2enmod userdir
a2enmod rewrite
a2enmod suexec
a2enmod include
http://philipatswarchy.wordpress.com/category/technical/ssl/
隱藏 Apache, PHP 的版本
php.ini
expose_php = off
httpd.conf
ServerSignature Off
ServerTokens Prod
http://www.backup.idv.tw/viewtopic.php?t=821
expose_php = off
httpd.conf
ServerSignature Off
ServerTokens Prod
http://www.backup.idv.tw/viewtopic.php?t=821
2009年12月28日 星期一
XHProf: A Hierarchical Profiler for PHP
應該類似於 xdebug,不支援 windows
http://pecl.php.net/package/xhprof/
http://pecl.php.net/package/xhprof/
2009年12月21日 星期一
2009年12月11日 星期五
設定 Tomcat Hot Deploy
編輯 %CATALINA_HOME%\conf\context.xml
加入下面兩項 attributes,不然無法 hot deploy
<Context>
<Context antijarlocking="true" antiresourcelocking="true"></context>
直接用 Ant 部署,只要更新 webapps 下面的 *.war 之前,先刪除 war 即可。
測試環境是 Tomcat 5.5, win32
加入下面兩項 attributes,不然無法 hot deploy
<Context>
<Context antijarlocking="true" antiresourcelocking="true"></context>
直接用 Ant 部署,只要更新 webapps 下面的 *.war 之前,先刪除 war 即可。
<property name="warfile" value="foo"/>
<property name="deploydir" value="c:\tomcat\webapps"/>
<delete file="${deploydir}\${warfile}.war"/>
<delete file="${deploydir}\${warfile}.war"/>
<copy todir="${deploydir}" overwrite="true">
<fileset dir=".">
<include name="*.war"/>
</fileset>
</copy>
測試環境是 Tomcat 5.5, win32
2009年12月7日 星期一
2009年12月2日 星期三
Barcode in Java/PHP
PHP
php-barcode (Win32, Unix-Like 都可用)
http://www.ashberg.de/php-barcode/
設定 genbarcode 的位置,若與 php code 放同目錄的話
$genbarcode_loc="genbarcode.exe";
Java
barbecue
http://barbecue.sourceforge.net/
整包 war 放到 ap server 即可使用其 servlet
經測試,在 jboss-402 下面運作正常
以上都是從 web 生成 image,若是在 Linux Desktop 使用,據說有 kbarcode
http://www.kbarcode.net/
php-barcode (Win32, Unix-Like 都可用)
http://www.ashberg.de/php-barcode/
設定 genbarcode 的位置,若與 php code 放同目錄的話
$genbarcode_loc="genbarcode.exe";
Java
barbecue
http://barbecue.sourceforge.net/
整包 war 放到 ap server 即可使用其 servlet
經測試,在 jboss-402 下面運作正常
以上都是從 web 生成 image,若是在 Linux Desktop 使用,據說有 kbarcode
http://www.kbarcode.net/
2009年12月1日 星期二
Virtual Private Server (VPS) 的性能比較
VPS 性能比較
http://blog.gslin.org/archives/2009/11/30/2173/
http://journal.uggedal.com/vps-performance-comparison
http://www.linode.com/
記憶體較少,但速度較快
其他不在比較之內,但看似不錯的方案
可用 Ubuntu 9.04, 使用 RAID-10
http://www.slicehost.com/
http://blog.gslin.org/archives/2009/11/30/2173/
http://journal.uggedal.com/vps-performance-comparison
http://www.linode.com/
記憶體較少,但速度較快
其他不在比較之內,但看似不錯的方案
可用 Ubuntu 9.04, 使用 RAID-10
http://www.slicehost.com/
2009年11月25日 星期三
Firefox 附加元件 - JSONView
https://addons.mozilla.org/zh-TW/firefox/addon/10869
Normally when encountering a JSON document (content type "application/json"), Firefox simply prompts you to download the file. With the JSONView extension, JSON documents are shown in the browser similar to how XML documents are shown. The document is formatted, highlighted, and arrays and objects can be collapsed. Even if the JSON document contains errors, JSONView will still show the raw text.
Once you've got JSONView installed, check out http://brh.numbera.com/software/jsonview/example.json to see the extension in action!
Normally when encountering a JSON document (content type "application/json"), Firefox simply prompts you to download the file. With the JSONView extension, JSON documents are shown in the browser similar to how XML documents are shown. The document is formatted, highlighted, and arrays and objects can be collapsed. Even if the JSON document contains errors, JSONView will still show the raw text.
Once you've got JSONView installed, check out http://brh.numbera.com/software/jsonview/example.json to see the extension in action!
Firefox 附加元件 - Live HTTP Headers
平常要 debug ajax, web 多半用 fiddler,也算是相安無事
不過,如果要追 HTTPS 下的 request/respone header 就沒辦法再用 fiddler
若還有跳頁 (redirect page)的話,將連 FireBug 也不能用,HTTP Request Log 會被清掉
這時要改用 Live HTTP Headers 這個 Firefox 的 add-on
https://addons.mozilla.org/zh-TW/firefox/addon/3829
但同事特別提醒,水能載促舟亦能覆舟
不過,如果要追 HTTPS 下的 request/respone header 就沒辦法再用 fiddler
若還有跳頁 (redirect page)的話,將連 FireBug 也不能用,HTTP Request Log 會被清掉
這時要改用 Live HTTP Headers 這個 Firefox 的 add-on
https://addons.mozilla.org/zh-TW/firefox/addon/3829
但同事特別提醒,水能載促舟亦能覆舟
網頁相容性測試 for Internet Explorer Versions from 5.5 to 8
Requirement
Windows 7, Windows Vista or Windows XP with IE7 minimum (Windows XP/IE6 config has some problems and IE8 instance do not work under XP without IE7)
Known problems and limitations :
- The Previous/Next buttons are not working properly
- Focus is not working properly
- Java applets are not working
- Flash is not working on IE6 instance in user mode : A solution is to launch IETester as admin user and Flash will work.
- CSS Filters are not working correctly in user mode : A solution is to launch IETester as admin user and CSS Filters will work.
http://www.my-debugbar.com/wiki/IETester/HomePage
2009年11月24日 星期二
CSS Media Types
可以對依顯示、列印、行動裝置,設定不同的 CSS,算是相當妙~
http://www.w3schools.com/CSS/css_mediatypes.asp
screen, print 都容易測試,手邊沒有 handheld device 可以試,不知道是否也有效
另外,跳頁可以用 (含列印)
http://www.w3schools.com/CSS/css_mediatypes.asp
screen, print 都容易測試,手邊沒有 handheld device 可以試,不知道是否也有效
另外,跳頁可以用 (含列印)
<p style="page-break-before:always;"> </p>
2009年11月19日 星期四
Google Calendar 式樣的 Web 元件 : ZK Calendar
http://zcal.zkoss.org/
台灣人寫的,實在厲害!
正準備用來開發公司內部的行事曆
作者介紹
http://www.ithome.com.tw/itadm/article.php?c=47400
台灣人寫的,實在厲害!
正準備用來開發公司內部的行事曆
作者介紹
http://www.ithome.com.tw/itadm/article.php?c=47400
訂閱:
文章 (Atom)