Submitted by gouki on 2009, March 12, 9:42 AM
phpChina虽然我不是很喜欢,因为论坛里的斗争搞得象国外的党派斗争一样,几乎沦为口水娃了。
但是,他上面的专题还是很不错的。
专题网址如下:http://www.phpchina.com/html/thematic.html
打开任意一个专题,右侧都有专题列表,我复制过来了。希望对大家有用吧。。(其实是对自己有用)
Tags: lamp, phpchina, 专题
PHP | 评论:0
| 阅读:18176
Submitted by gouki on 2009, March 11, 11:08 PM
在使用ZendFramework开发的时候,会遇到要对SQL进行优化的处理,但是从ZEND的DB类里并没有找到输出SQL的方法,唯一看到的输出也是在SELECT类里面有一个__toString()的方法,但这个方法也只能输出SELECT的语句,对于Insert,Update,Delete之类的语句并不能处理。
开始的时候,很郁闷,后来问HaoHappy,因为他是国内第一批翻译ZF手册的人,果然我一问,他一下子就说,有一个Profiler类可以解决。
翻开手册,Zend_Db_Profiler,里面果然有操作。。(注:类名是凭记忆的,以下内容也是凭记忆写出来的)
1、在DB的CONFIG里面把profiler打开,如果没有打开,则需要用$profiler = $db->getProfiler();然后 $profiler->setEnable(true); (好象记错了,请看手册,我这里只说解决方法)
2、然后有一个设置 Profiler 的filter条件的,可以设定select,insert,update,delete的操作。
3、然后根据官方的例子,对SQL进行输出(手册上的例子,只是输出了执行时间最长的SQL哦)。如果需要每条都输出,你得在那个 if 判断外把sql 存储下来,即 $query->getQuery();
4、根据手册,还可以输出到fireBug和利用FirePHP来进行类似的debug,但我试了一下没有成功( QEE 支持 firePHP ,不知道是否借鉴了ZEND的这个功能,猜测而己 )
纯粹是一个记录,顺便感谢一下HaoHappy
Tags: zend, framework, sql
PHP Framework | 评论:0
| 阅读:29862
Submitted by gouki on 2009, March 10, 9:49 PM
纯记录:http://gofreeserve.info/archives/free-web-template-resources
Check out these 40 excellent websites that offer W3 standard-compliant website templates and flash template pages for free download without any registration or sign-up!
Simavera Website Templates
Flash and web site templates. Great collection with some attractive and modern designs to choose from.
Open Designs
XHTML and CSS based free web design templates. Over 1100 open source designs available for download and growing by the day!
Tristar Web Design
Just 9 templates here but if your looking for free fast loading quality XHTML & CSS templates, this site is a must!
Solucija
Free XHTML/CSS website templates available to use without any limitations. They can be used on a non commercial site as well as on a commercial one. Keeping a small credit link in the footer is not obligatory. All templates are hand coded and lightweight (under 60KB) which ensures fast loading.
Styleshout
Large collection of quality free website templates for download. All templates are valid xthml(strict) and valid CSS, and distributed under a Creative Commons Attribution 2.5 license
Dream Template
334 free templates but users must at all times have the pre-installed DreamTemplate linking button/text on the front page of their web site. This policy does NOT apply to registered/paid members.
Metamorphozis Design
A large collection of attractive designs released under a Creative Commons Attribution 2.5 license by the metamorphosis designers.
Iron Myers
Simplify your site designs with 168 of the most useful Grid and CSS Layouts. They are perfect for website templates, Blog themes, CMS or as a starting point for your web projects. Layouts offer full Grade-A browser support, That is, the layouts will look and behave the same in all internet browsers.
Six Shooter Media
A list of 11 extremely fast loading quality templates fully xhtml 1.1 and css compliant.
Nice and Free CSS Templates
Just copy and paste any of the 12 layouts, all templates are XHTML 1.0 and CSS2/ tableless.
CSSTemps
About 60 free valid XHTML/CSS templates. All templates are protected by the license inside the template.
Free CSS Templates
All of these templates are released for FREE under the Creative Commons Attribution 2.5 license for any type of personal or commercial use provided you follow the license. Link back required.
Clan Templates
Free templates for on-line gaming clans for games with multiplayer options. Clan Templates provides free gaming layouts and graphics to gamers and designers alike.
Free Website Templates
Claims to be the best free website templates on the internet and you don’t need to link back, but you should state that you used a template originally made by Free Website Templates.
Template World
Absolutely top quality, unique and creative web site XHTML/CSS templates designed by Template World. Templates have been tested and proven compatible with all major browser environments and operating systems. Released under Creative Commons Attribution 2.5 license you are free to modify but you must link back to Template World.
Layout Gala
A collection of 40 CSS layouts based on the same markup and ready for download! If you want, you can download the entire collection, 40 HTML pages in a single zip file.
Open Web Design
Download and upload free web designs, over 3000 demo’s to browse through!
Free CSS
All of the 1000 templates or so that are featured within Free CSS are distributed under some form of GNU/GPL License or under a Creative Commons License.
Open Source Web Design
A collection of 2000+ web designs submitted by the community that anyone can download free of charge!
CSS 4 Free
Free CSS based website templates gallery for you to preview, rate, comment on, and download. Most of the templates are licensed under Creative Commons 2.5 or GPL.
Open Source Web Templates
Free Open Source XHTML/CSS templates designed with true web 2.0 standard and 100% W3C validated.
Premium Website Templates
Tableless web templates built using XHTML and CSS with some also available as Blogger template or Wordpress theme. All released under a Creative Commons Attribution 2.5 license
Template Navigator
Free templates catalogue that links only to high quality and free templates that can be 100% downloaded.
Templates Box
A large inventory of free website and flash templates available. Link back is required, downloads include the .PSD files and fonts.
Open Source Templates
Studio 7 designs all free CSS/XHTML website templates are free to use under the Creative Commons Attribution 2.5 license
Free Layouts
Offers several hundred free W3 standard-compliant website templates and flash template pages for download. The site has some older templates in the collection that may not validate, and as such, you should make sure your code validates before using the template.
Dotcom Webdesign
Premier source with 527 free website templates and layouts created specifically for CMSimple.
Themebot
Portal helping users to find themes/templates/styles/skins for various content management systems, blog and forum software. Free high quality open source website templates using XHTML and CSS.
Interspire
Dozens of website templates, website layouts, newsletter templates and logo templates, that you can download free of charge.
Free CSS Templates
One of the biggest, never before seen collection of free CSS Templates on the web! All these CSS templates are released under the Creative Commons Attribution 2.5 license. At present, there are 219 free CSS templates downloadable in .Zip format.
All Free Templates
Nice collection of free web and flash templates for personal and business use. Some templates include the .PSD files.
Template Workz
Templates are free to download and use for your personal and business projects. Website templates are available in Photoshop (PSD) and HTML formats, all the fonts are also included with the PSD file. Link back only required if you use the downloaded graphics.
Snakeye Dreamweaver Web Templates
20 free Dreamweaver web site templates and web page templates for download. May be used for any web site, provided the tagline at the base of the template remains within the template design.
TemplateYes
About 100 cool web, flash and CSS templates 100% free. Link back required.
Mashable
A collection of 150+ great free templates from around the web including 40+ one column layouts, 80+ two column layouts and 30+ three column layouts.
Free Templates Online
Gallery of 150 professional looking websites free of charge! Link back required.
Web Design Company
Unique and professional Web site templates, Flash templates, HTML templates including the full set of sub-pages free of cost. Submit name and email prior to download and link back required.
Andreas Viklund
All templates are made with valid XHTML (strict) and CSS, and they are supposed to be small, easy to work with and of high code quality. Templates are free to use for any purpose without any limitations, obligations or conditions.
Zymic
Preview live and download any one of the 90+ top quality free web designs and layouts. Link back is required!
Free online web template generator
Easily create unique professional web templates: Pick Template > Customise > Download!
doTemplate offers a catalogue of free web templates. All templates are fully customizable to your taste and needs. You can easily tweak the colors, the fonts, apply a bunch of graphical effects to create a unique professional template in no time.
Tags: 模版, 免费
Ideas | 评论:2
| 阅读:42137
Submitted by gouki on 2009, March 10, 9:20 AM
以下内容来自于linux的101个hack,昨天看到了,顺手翻译了一下,毕竟看中文比看英文舒服。翻译的还是有点问题的,理解一下下啦。。。
Hack 74. Crontab
第74个hack:Crontab
Using cron you can execute a shell-script or Linux commands at a specific time and date. For example a sysadmin can schedule a backup job that can run every day.
使用cron功能你可以在任意的时间执行一条shell指令或者Linux的命令。例如系统管理员可以运行一个计划任务来进行每天的备份工作。
How to add a job to the cron?
那么,怎么样把一个任务加入到cron呢?
# crontab –e
0 5 * * * /root/bin/backup.sh
This will execute /root/bin/backup.sh at 5 a.m every day.
上面这条指令,让你在每天上午5点 运行 /root/bin/目录下的 backup.sh 指令
Description of Cron fields.
Cron命令的各个字段的注释。
Following is the format of the crontab file.
crontab文件的格式均以下格式
{minute} {hour} {day-of-month} {month} {day-of-week} {full-path-to-shell-script}
{分钟} {小时} {每月的第几天} {月份} {每周的第几天} {指令的全路径}
o minute: Allowed range 0 -59
o 分钟的取值范围是 0-59
o hour: Allowed range 0 -23
o 小时的取值范围是 0-23
o day-of-month: Allowed range 0 - 31
o 每月的第几天,取值范围为 0-31
o month: Allowed range 1 -12. 1 = January. 12 = December.
o 月份的取值范围为 1-12 ,1是1月,12是12月
o Day-of-week: Allowed range 0 -7. Sunday is either 0 or 7.
o 每周的第几天,取值范围为0-7,0或者7都代表星期天
Crontab examples
Crontab 的例子
1. Run at 12:01 a.m. 1 minute after midnight everyday. This is a good time to run backup when the system is not under load.
1. 每天午夜12点零1分 ,当系统不再被加载时就是进行备份的好时机(not under load翻译不来)
1 0 * * * /root/bin/backup.sh
2. Run backup every weekday (Mon – Fri) at 11:59 p.m.
每周1-5晚上11点59分执行备份操作
59 11 * * 1,2,3,4,5 /root/bin/backup.sh
Following will also do the same.
下面的例子则是另一种格式,功能完全一致
59 11 * * 1-5 /root/bin/backup.sh
3. Execute the command every 5 minutes.
每五分钟执行一条命令
*/5 * * * * /root/bin/check-status.sh
4. Execute at 1:10 p.m on 1st of every month
每月第一天的下午1点10分执行备份
10 13 1 * * /root/bin/full-backup.sh
5. Execute 11 p.m on weekdays.
每周工作日的下午11点执行备份
0 23 * * 1-5 /root/bin/incremental-backup.sh
Crontab Options
Crontab 的一些参数
Following are the available options with crontab:
以下是crontab所支持一些参数
o crontab –e : Edit the crontab file. This will create a crontab, if it doesn’t exist
o crontab -e : 编辑crontab文件,如果文件不存在,则创建一个crontab
o crontab –l : Display the crontab file.
o crontab -l : 显示crontab文件
o crontab -r : Remove the crontab file.
o crontab -r : 删除crontab文件
o crontab -ir : This will prompt user before deleting a crontab.
o crontag -ir : 删除crontab文件,但在删除前会让用户进行确认
Tags: crontab
Linux | 评论:0
| 阅读:20849
Submitted by gouki on 2009, March 9, 4:40 PM
在使用swfupload上传文件的时候,老是绕不过登录验证。查了一下GOOGLe,没查到,问了百度,他告诉我答案:
swfuplaod在上传时,会新开一个进程,和原来的进程不一致,要解决这个问题,需要指定session_id,然后在登录页面判断,如果有post过来的session_id,那么就用函数session_id( $_POST['PHP_SESSIONID'])指定一下。
上传页的JS里面,可以获取当前的SESSION_ID的。
例如上传页的JS中:
post_params: {"PHPSESSID": "<?php echo session_id(); ?>"},
在验证的判断页中:
if (isset($_POST["PHPSESSID"])) {
session_id($_POST["PHPSESSID"]);
}
(这一段是网上的注释:在带有Session验证的网站后台中SWFUpload无法正常工作,这是因为SWFUpload在上传时相当于重新开辟了一个新的Session 进程,因此无法与原有程序的Session保持一致,这就需要在上传时传递原有程序的SessionID,根据它来“找回”其应有的Session。)
Tags: swfupload
PHP | 评论:4
| 阅读:30161