第34åPHPåå¼·ä¼ã§è©±ãã¦ãã¾ãã
éææ¥ã®CakePHPåå¼·ä¼ã«å¼ãç¶ãã第34回PHP勉強会ã«åå ããçºè¡¨ããã¦ãã¾ããã
Ustreamã«ã¦é²ç»ããæ åãè¦ãã¾ãã
http://www.ustream.tv/channel/php-study0806
é²ç»ãã¦ãã ãã£ãyandodãããããã¨ããããã¾ãï¼
ã¢ããªãä½ãåºãåã«
çºè¡¨è
ï¼id:maru_cc ç§ã§ãã
ã²ã¨ã¤ã¯ãããã°ã©ã ãå°ãæ¸ããããã«ãªã£ã人ã次ã®ã¹ãããã¨ãã¦ãæèãã¦ãã£ã¦ã»ããã¨ããã¨ã
ããã²ã¨ã¤ã¯ãå®éã«ãã¾å°ã£ã¦ãããã¼ã¸ã§ã³ç®¡çããã®ãããã¤æ¹æ³ã«ã¤ãã¦ã
ååã¯ã¡ãã£ã¨å½ããåãããããªãã
å¾åã¯å®éã«è¡ã£ã¦ããæ¹æ³ã¨ããã§ããã ãå
·ä½çã«åºããã°ã¨æãã¾ãããã©ã®ãããä¼ãã£ãããªã
è³æã¯ãã¡ãã£ã¨æºåä¸è¶³ã§ãããã話ãããã£ããã¨ã¯è©±ããã¨æãã¾ãã
以ä¸ã«ã¹ã©ã¤ãã¢ãããã¾ããã
http://docune.jp/doc/5642
ã¹ã©ã¤ãã«æ¸ãã¦ãªãã¦è©±ãããã¨ããã£ãããã¾ãã®ã§ãå¥éã¨ã³ããªãããã¦ç´°ããæ¸ãããã¨æãã¾ãã
çµãã£ãç´å¾ã®ä¼æ©ä¸ã«ããããã¤æ¹æ³ãéçºç°å¢ãªã©ã«ã¤ãã¦ã話ãã§ããã®ãããã£ãã§ãã
ãã®æã¯æéããªãã¦å¾ã§ã¨ãªã£ã¦ãã¾ã£ãã®ã«ãæ親ä¼ã§ãã£ã¨çªã£è¾¼ãã§è©±ãã§ããªãã£ãã®ãæãã¾ãã¾ãã
ã¾ãã次ã®æ©ä¼ãã»ãã®å ´æã§ãããã£ã¨ã»ãã®äººãèãã¦ãããè¡ã£ã¦ããæ¹æ³ãèãã¦ã¿ããã¨æãã¾ããã
PostgreSQLã§æ¥æ¬èªå ¨ææ¤ç´¢
çºè¡¨è
ï¼id:kaz_29ãã
PostgreSQLã¯ä½¿ã£ã¦ããªãã®ã§ãç´°ããã¨ããããããã¾ããã§ããããå®éã«æ¥æ¬èªå
¨ææ¤ç´¢ã§çµæ§å®ç¨çãªæ°å¤ãåºã¦ãã¾ããã
ãªããããã®ã¾ã¾éå»ãã°æ¤ç´¢ãµã¼ãã¹ã«ãã¡ããã°ããããããªãããªï¼
ãã¾ãå
¨ææ¤ç´¢ãå¿
è¦ãªè¦ä»¶ãç¡ãã®ã§ã追ã£ããã¦ããªãã®ã§ããä½ãã§ãããã§ããã
ã¡ãã£ã¨æ¥µããXML on PHP5
çºè¡¨è
ï¼id:sotarokãã
å®éã®ãµã³ãã«ã交ããªããã®ãXMLãphpã§æ±ãæã®æ¹æ³ãªã©ã
10Mè¶
ã®XMLã¨ãã¯ããããã«æ±ã£ããã¨ãªãã®ã§ãããããããéè¦ãããã®ã ãªãã¨æãã¾ããã
SimpleXMLã®æ¹ãã使ãã©ããã¯æ¥½ã ããæåã«ãã¼ã¹ããåãåãã ãã¾ã§ã«æéããããã¨ããç¹ã¨ãã¡ã¢ãªãé£ãã¨ããã®ã¯åèã«ãªãã¾ããã
XMLReaderã®ã¨ããã®èª¬æã§ãã¡ãã£ã¨ããï¼ãã¨æã£ãã¨ããã
ãã®ã¹ã©ã¤ãã®èª¬æã§ã以ä¸ã®ãããªããã°ã©ã ãå®è¡ãã¦çµæã示ãã¦ãã¾ããã
ããã§ã¯ãid:sotarokãããæ¸ãã¦ãããã¹ãã³ã¼ããããåå¤ã表示ããã®ã« echoããvar_dumpã«æ¸ãæãã¦ãã¾ãã
<?php $xml = new XMLReader; $xml->open("rss2.xml"); $i = 0; while ($i++ <= 4) { $xml->read(); var_dump($xml->nodeType); echo " : "; var_dump($xml->name); echo " : "; var_dump($xml->value); echo "\n"; }
ãµã³ãã«ã¨ãã¦åºãã¦ããXML
<?xml version="1.0" encoding="utf-8" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xml:lang="ja"> <channel> <title>GRANADA Hatena @ sotarok</title> <link>http://d.hatena.ne.jp/sotarok/</link> </channel> </rss>
â»XMLã®æ§é ãå£ããªãç¯å²ã§ãè¦ç´ ãçç¥ãã¦ãã¾ãã
çµæ
$ php test.php int(1) : string(3) "rss" : string(0) "" int(14) : string(5) "#text" : string(5) " " int(1) : string(7) "channel" : string(0) "" int(14) : string(5) "#text" : string(9) " " int(1) : string(5) "title" : string(0) ""
ããã¯ãid:sotarokãããæ¸ãã¦ããã®ã¨åãã§ãããéã®ãSignificant Whitespaceãã¼ãã®èª¬æã®ä»æ¹ãå°ãéãããªï¼ã¨æãã¾ããã
ãã¨ãã°ããã®XMLã®ã¿ã°éã®æ¹è¡ã¨ã¤ã³ãã³ãã®ã¹ãã¼ã¹ãåãé¤ãã¦å®è¡ãã¦ã¿ã¾ãã
<?xml version="1.0" encoding="utf-8" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xml:lang="ja"><channel><title>GRANADA Hatena @ sotarok</title><link>http://d.hatena.ne.jp/sotarok/</link></channel> </rss>
ãããåãã¹ã¯ãªããã«ããã¦ã¿ãã¨ã
$ php test.php int(1) : string(3) "rss" : string(0) "" int(1) : string(7) "channel" : string(0) "" int(1) : string(5) "title" : string(0) "" int(3) : string(5) "#text" : string(24) "GRANADA Hatena @ sotarok" int(15) : string(5) "title" : string(0) ""
éã®æ¹è¡ã¨ã¹ãã¼ã¹ã®ã¿ã®å¤ããªããªãã¾ããã
ã¨ããããã§ããããªæãã®å³ã®æ¹ãã¤ã¡ã¼ã¸ã«è¿ãããªã¼ã¨æãã¾ãã
LT:åããã¦ã³ã¼ãã®æµãã追ã
çºè¡¨è ï¼shin1x1ãã (http://www.1x1.jp/blog/)
ç¥LTã§ããï¼
é¢ç½ãã£ãï¼ï¼
ãããã°ã©ã ã¯æã£ãéãã«åããªããæ¸ããéãã«åã
ã½ã¼ã¹ã®ã©ããã«æ¸ãã¦ããã¯ãï¼ã
åè¨ã§ãã
å¤ãªæåãæå³ããªãåãããã¦ãããã¾ãã¯ãã©ãã¦ããåããããããªããªã©ãå¿
ãã©ããã«åå ãããã¾ãã
å ´åã«ãã£ã¦ã¯ããµã¼ããè¨å®ããã®ä»å¥ã®è¦å ã®å ´åãããã¾ãããåç¾ãç°¡åã«ãããã¯å¥ã¨ãã¦å¿
ãåå ãã©ããã«ããã¯ãã
debug_print_backtrace_source ã¯ç¥ãã¾ããã§ããã
ããªããããã
PHPæ¬ä½ã«ããããå½ã¦ã¦ã®ã³ã¼ããã°ããã°ããããã¾ãã
ãªã㯠XDebugã§åºæ¥ãã¨ãã話ã«ãªã£ã¦ãã¾ããããããã§ãããããã¾ãã
LT:DBã»ãã·ã§ã³ã«ã¤ãã¦gdgdã§ããããã
çºè¡¨è ï¼gusagiãã (http://www.gusagi.com/)
DBã»ãã·ã§ã³ã使ãããã®æ¹æ³ã«ã¤ãã¦ã
å人çã«ã¯ãã§ã«ä½¿ç¨ãã¦ããæè¡ãªã®ã§ãç®æ°ããã¯ããã¾ããã§ããããããã使ã人ã«ã¯åèã«ãªãçºè¡¨ã ã£ãã®ã§ã¯ãªãã§ããããï¼
æããã®ã¯ãåãå°ããã¦ã¡ãã£ã¨Ustreamã ã¨è¾ããã¨ã§ããããã
ãã¨ãã³ã¼ãã®è¡¨ç¤ºãæ©ãã¦ãããã£ã¦ãã人ãããªãã¨ãã¤ãã¦ãããªãã£ãããã«æãã¾ããã
LT:ProjectZeroã§PHP
çºè¡¨è ï¼nemo_kazãã (http://twitter.com/nemo_kaz/)
ã¹ã©ã¤ãã®æåãããããã£ã
ãã¨ããã³ããè¯ãã¦ãããããã£ãã§ãã
å
容ã«ã¤ãã¦ã¯ãã¡ãã£ã¨ãããããããããã£ã¦ããªãã£ãã®ã§ãä»åº¦ä½¿ã£ã¦ã¿ããã¨æãã¾ãã
æ親ä¼
id:Yudoufuãããå¹¹äºããã¦ãã ãã£ãæ親ä¼ã
éå½æçã®ãåºã§ããã
人æ°ãå¤ããå
¨å¡ã¨ã¯è©±ãã¾ããã§ãããã
æ親ä¼ã®åºå¸çå¤ãã§ãããæéãã¯ããã£ããããããã®ããªã
éä¸ãPHPã¦ã¼ã¶ä¼ãã©ããããã¨ãã話ã«ãªã£ããã¨ãããããã話ãã¾ããã
ãã£ã±ããæ親ä¼ã§ãããããªäººã¨è©±ãã®ã楽ããããåºæ¿ã«ãªãã¾ãã
æè¿ã¯ãåå¼·ä¼ãåã¾ãã®ãæ©ãã®ã§ãå¥ã®ä¼å ´ã§Ustraemèãã¦ãæ親ä¼ããåæµã¨ãã©ãã ããã¨ã話ãã¦ã¾ããã
äºæ¬¡ä¼
ãã¼ã£ã¨ãã©ãã«è¡ã£ãã£ãããªï¼
ããããåæ¥ã®CakePHPã®æ親ä¼ã®ãåºã ã£ãã¨æãã¾ãã
è¨æ¶ãCakePHPã®æ親ä¼ã¨ãã£ã¡ãã«ãªã£ã¦ãä½è©±ãã¦ããã®ãããè¦ãã¦ãã¾ãã (^^;
ä¸æ¬¡ä¼
åæ°ã«ç§»åãã¦ãçµå±æã®5æéãã¾ã§ããããããã話ãã¦ãã¾ããã
æå®®ãããã¾ãããæè²ã®è©±ã¯ã¨ã¦ãå®ããããããããããããã£ãã
ããã ãã§ãåå¼·ä¼ãã«ã³ãã¡ã¬ã³ã¹ã®ã³ã³ãã³ãã«ãªãã®ã§ã¯ãªãã ãããï¼
ãªãã ããã ãã£ã¦ã6æåãããã«å®¶ã«å¸°ã£ã¦ãã¾ããã
æè¿å¿ãããã©ãã°ããã¦ããã®ã§ãããå
å®ããé±æ«ãéããã¾ããï¼
æå¾ã«
ä»åãå ´æãæä¾ãã¦ãã ãã£ãã株式会社トライコーンãã¾ã¨ãsuzukiãããããã¨ããããã¾ãï¼
ãã¨ãã¨ãå¸ä¼é²è¡ã® id:cocoitiãã
Ustreamã®é
ä¿¡ããã¦ãã ãã£ã yandodãã
ãããã¨ããããã¾ããï¼