PHP SPL±Ê¼Ç
Õ⼸Ì죬ÎÒÔÚѧϰPHPÓïÑÔÖеÄSPL
¡£
Õâ¸ö¶«Î÷Ó¦¸ÃÊôÓÚPHPÖеĸ߼¶ÄÚÈÝ£¬¿´ÉÏÈ¥ºÜ¸´ÔÓ£¬µ«ÊǷdz£ÓÐÓã¬ËùÒÔÎÒ×öÁ˳¤Æª±Ê¼Ç¡£²»È»¼Ç²»×¡£¬ÒÔºóÒªÓõÄʱºò£¬»¹ÊÇÒª´ÓͷѧÆð¡£
ÓÉÓÚÕâÊǹ©×Ô¼º²Î¿¼µÄ±Ê¼Ç£¬²»Êǽ̳̣¬ËùÒÔдµÃ±È½Ï¼òµ¥£¬Ã»Óжà½âÊÍ¡£µ«ÊÇÎÒÏ룬Èç¹ûÄãÊÇÒ»¸öÊìÁ·µÄPHP5³ÌÐòÔ±£¬Ó¦¸Ã×ãÒÔ¿´¶®ÏÂÃæµÄ²ÄÁÏ£¬¶øÇһᷢÏÖËüºÜÓÐÓá£ÏÖÔÚ³ý´ËÖ®Í⣬ÍøÉϸù±¾Ã»ÓÐÈκÎÉîÈëµÄSPLÖÐÎĽéÉÜ¡£
================
PHP SPL±Ê¼Ç
Ŀ¼
µÚÒ»²¿·Ö ¼ò½é
1. ʲôÊÇSPL£¿
2. ʲôÊÇIterator£¿
µÚ¶þ²¿·Ö SPL Interfaces
3. Iterator½çÃæ
4. ArrayAccess½çÃæ
5. IteratorAggregate½çÃæ
6. RecursiveIterator½çÃæ
7. SeekableIterator½çÃæ
8. Countable½çÃæ
µÚÈý²¿·Ö SPL Classes
9. SPLµÄÄÚÖÃÀà
10. DirectoryIteratorÀà
11. ArrayObjectÀà
12. ArrayIteratorÀà
13. RecursiveArrayIteratorÀàºÍRecursiveIteratorIteratorÀà
14. FilterIteratorÀà
15. SimpleXMLIteratorÀà
16. CachingIteratorÀà
17. LimitIteratorÀà
18. SplFileObjectÀà
µÚÒ»²¿ ¼ò½é
1. ʲôÊÇSPL£¿
SPLÊÇStandard PHP Library£¨PHP±ê×¼¿â£©µÄËõд¡£
¸ù¾Ý¹Ù·½¶¨Ò壬ËüÊÇ“a collection of interfaces and classes that are meant to solve
standard
problems”¡£µ«ÊÇ£¬Ä¿Ç°ÔÚʹÓÃÖУ¬SPL¸ü¶àµØ±»¿´×÷ÊÇÒ»ÖÖʹobject£¨ÎïÌ壩ģ·Âarray£¨Êý×飩ÐÐΪµÄinterfacesºÍclasses¡£
2. ʲôÊÇIterator£¿
SPLµÄºËÐĸÅÄî¾ÍÊÇIterator¡£ÕâÖ¸µÄÊÇÒ»ÖÖDesign Pattern£¬¸ù¾Ý¡¶Design
Patterns¡·Ò»ÊéµÄ¶¨Ò壬IteratorµÄ×÷ÓÃÊÇ“provide an object which traverses some aggregate
structure, abstracting away assumptions about the implementation of that
structure.”
wikipediaÖÐ˵£¬"an iterator is an object which allows a programmer to traverse
through all the elements of a collection, regardless of its specific
implementation".……"the iterator pattern is a design pattern in which iterators
are used to access the elements of an aggregate object sequentially without
exposing its underlying representation".
ͨË×µØ˵£¬IteratorÄܹ»Ê¹Ðí¶à²»Í¬µÄÊý¾Ý½á¹¹£¬¶¼ÄÜÓÐͳһµÄ²Ù×÷½çÃ棬±ÈÈçÒ»¸öÊý¾Ý¿âµÄ½á¹û¼¯¡¢Í¬Ò»¸öĿ¼ÖеÄÎļþ¼¯¡¢»òÕßÒ»¸öÎı¾ÖÐÿһÐй¹³ÉµÄ¼¯ºÏ¡£
Èç
Ïà¹ØÎĵµ£º
Blogϵͳ×÷Ϊ´ó¼Ò×î³£½Ó´¥µÄ»¥ÁªÍø¶«¶«£¬ÔÚÕ¾³¤ÈºÌåÖм¸ºõÈËÊÖÒ»²©£¬´ÓÖªÃûÃÅ»§µÄ²©¿ÍƵµÀ£¬µ½ÍøÂçÓªÏúר¼Ò²©¿Í£¬ÍøÃñ¶Ô²©¿ÍµÄ¹Ø×¢¶ÈÔÚ²»¶ÏÌá¸ß²¢É¡£Ä¿Ç°ÍøÉÏÃâ·ÑµÄblogϵͳ̫ÔÓ£¬ÔÚ´ËÕûÀíPHP°æµÄBlog½éÉÜÈçÏ£º
1¡¢wordpress:http://www.wordpress.org ¹¦ÄÜÒ²ºÜÈ«Ã棬Ӧ¸ÃÊÇÖ§³ÖblogµÄÊ×Ñ¡¡£ËüÓÐ×îÇ¿µÄÄ£°æ¹¦ÄÜ£¬ÒѾ ......
ÒýÓÃhttp://www.linuxtone.org/html/76/t-2776.html
ÓÐʱºònginx£¬apache£¬mysql£¬php±àÒëÍêÁËÏë¿´¿´±àÒë²ÎÊý¿ÉÒÔÓÃÒÔÏ·½·¨
nginx±àÒë²ÎÊý£º
#/usr/local/nginx/sbin/nginx -V
CODE:
nginx version: nginx/0.6.32
built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42)
configure arguments: --user=www --group=www --p ......
ÏÂÃæÊÇһЩ·Ç³£ÓÐÓõÄphpÀà¿â£¬ÏàÐÅÒ»¶¨¿ÉÒÔΪÄãµÄWEB¿ª·¢Ìṩ¸üºÃºÍ¸üΪ¿ìËٵķ½·¨¡£
¡¡¡¡Í¼±í¿â
¡¡¡¡ÏÂÃæµÄÀà¿â¿ÉÒÔÈÃÄãºÜ¼òµÄ´´½¨¸´ÔÓµÄͼ±íºÍͼƬ¡£µ±È»£¬ËüÃÇÐèÒªGD¿âµÄÖ§³Ö¡£
¡¡¡¡PChart - Ò»¸ö¿ÉÒÔ´´½¨Í³¼ÆͼµÄ¿â¡£
¡¡¡¡Libchart - ÕâÒ²ÊÇÒ»¸ö¼òµ¥µÄͳ¼Æͼ¿â¡£
¡¡¡¡JpGraph - Ò»¸öÃæÏò¶ÔÏóµÄͼƬ´´½¨Àà¡£
¡¡¡¡ ......
PHP °æ±¾¸÷Ò죬ÒѾֹͣÉý¼¶¿ª·¢µÄÓÐ 4.0 ϵÁÐµÄ 4.4.x£¬µ«ÏÖÔÚ»¹Óв¿·ÖÉú²ú»·¾³ÔÚÅÜÕâ¸ö°æ±¾£¬ÐèÒª¼ÌÐøά»¤´úÂë¡£PHP 5.0 ϵÁÐÊÇÏÖÔÚ¿ª·¢ºÍÓ¦ÓõÄÖ÷Á÷°æ±¾£¬ÓÐ 5.1.x ºÍ 5.2.x ϵÁС£PHP 6.0 Ä¿Ç°»¹ÊÇÊÔÓð汾£¬Óà PHP ¿ª·¢Èí¼þ²úÆ·µÄÈËÏÖÔÚ¿ÉÒÔÔ¤ÏÈ×÷¼æÈÝÐÔ²âÊÔ¡£
PHP Ö§³ÖµÄÊý¾Ý ......
¡¾Ê²Ã´ÊÇMVC£¿¡¿
MVCÊÇÒ»¸ö¿ÉÒÔÈÃÄã°Ñ“Èý¸ö²¿·Ö£¨¼´MVCµÄÈ«³Æ£¬Model¡¢ View¡¢Controller£©”гµ÷µØ×é³ÉÒ»¸ö¸´ÔÓÓ¦ÓóÌÐòµÄ¸ÅÄî¡£Ò»Á¾Æû³µ¾ÍÊÇÒ»¸öÔÚÏÖʵÉú»îÖзdz£ºÃµÄMVCÀý×Ó¡£ÎÒÃÇ¿´³µ¶¼¿´Á½¸öView£¨ÏÔ Ê¾£©²¿·Ö£ºÄÚ²¿ºÍÍⲿ¡£¶øÕâÁ½¸ö¶¼Àë²»¿ªÒ»¸öController£ ......