Register as a new user and use Qiita more conveniently You get articles that match your needsYou can efficiently read back useful informationYou can use dark themeWhat you can do with signing up
ãã®ã¨ã³ããªã¯ãPHP Advent Calendar 2021 ã®20æ¥ç®ã®ã¨ã³ããªã§ãã19æ¥ç®ã¯ @takoba ããã«ãã PHPããã¸ã§ã¯ãã®Composerããã±ã¼ã¸ãRenovateã§å®æã¢ãããã¼ããã ã§ããã SQLã¤ã³ã¸ã§ã¯ã·ã§ã³ãã¯ãã¹ãµã¤ãã¹ã¯ãªããã£ã³ã°(XSS)ã®å¯¾çãè¡ãéã«ã¯ãã¨ã¹ã±ã¼ãå¦çãããã¾ãããã¨è¨ããã¾ããããã®å²ã«PHP以å¤ã®è¨èªã§ã¯ãã¾ãã¨ã¹ã±ã¼ãå¦çã®é¢æ°ãç¨æããã¦ããªãã£ãããã¾ããããã«æ¯ã¹ã¦PHPã¯ã¨ã¹ã±ã¼ãå¦çã®é¢æ°ãé常ã«è±å¯ã§ããããã ãè¦ã¦ããPHPã¯ãªãã¦ã»ãã¥ã¢ãªãã ! ã¨æ©ã¨ã¡ããã人ãããããããã¾ããããããããä»è¨èªã§ã¨ã¹ã±ã¼ãå¦çé¢æ°ããã¾ããªãã®ã¯ã¡ããã¨çç±ãããã¨æãã®ã§ãã æ¬ç¨¿ã§ã¯ãPHPã®ã¨ã¹ã±ã¼ãå¦çç¨ã®é¢æ°ãç´¹ä»ããªããããã®å©ç¨ç®çã¨ããã®é¢æ°ã使ããªãã§æ¸ã¾ããæ¹æ³ã説æãã¾ãã SQLç¨
Truffleã§PHPãå®è£ ãããçéã ã£ã話ã§ã
ç§ãããã°ã©ãã³ã°ãããã¨ãã®ç¬¬ä¸è¨èªã¯ Perl ã§ããå¨å²ã«ã¯ãç§ã¯ Perl 以å¤ã®ããã°ã©ãã³ã°è¨èªã¯ãããããã¾ãããã¨å¿µãæ¼ããããã«ã¯ Perl ã°ããæ¸ãã¦ãã¾ãã ãããã2018å¹´ã®ä»æ¥ Perl ã¯ä¸å®ã®å½¹å²ãçµããå¤ãè¨èªã¨ã¿ãªãããã¡ã¤ã³ã¹ããªã¼ã ããã¯éããã¨å¤ãã®äººãèãã¦ãã¾ãã10å¹´åã®2008å¹´ãæãè¿ãã¦ããè¤æ°ã®å¯¾æè¨èªã®ç»å ´ã§ Perl ã«é°ãããã£ãäºã¯äºå®ã§ãããä»æ¥ã®ã¡ã¤ã³ã¹ããªã¼ã ã« Perl ãå± ãªããã¨ãæ¹ãã¦è¨ãå¿ è¦ãç¡ãã§ãããã ããã§ããªãç§ã¯ Perl ãæ¸ãç¶ããã®ããå°ãèãã¦ã¿ã¾ããã ç§ã¨ Perl ç§ã¨ Perl ã¨ã®æ¬æ ¼çãªåºä¼ãã®å ´ã¯ã大å¦é¢ãåæ¥ãã2003å¹´ã«å ¥ç¤¾ããITä¼æ¥ã§ãããã®ä¼ç¤¾ãã¡ã¤ã³ã§ä½¿ç¨ãã¦ããããã°ã©ãã³ã°è¨èªã Perl ã ã£ãã®ã§èªç¶ã¨ Perl ãæ¸ãããã«ãªãã¾ããã 2003å¹´3æ
æ¦è¦ 1582å¹´10æ5æ¥ã1582å¹´10æ14æ¥ã¾ã§ã®10æ¥éã¯ãä½ããã®èªç¶ç¾è±¡ï¼ã´ã´ã´ã´ã´ï¼ã«ãã£ã¦æéãæ¶ãå»ãã¦ãæéã¨ãã¦ç¥ããã¦ãã¾ããããã°ã©ãã³ã°è¨èªã使ã£ã¦ãã®æ¥ãåãæ±ããã¨ããã¨ãããããªçµæãåºåããã¾ãã ä»æ¥ã¯ãããªç´ æµãªæ¥ä»ã§ãã1582å¹´10æ5æ¥ã¨æ¯ãã¦ãè²´éãª1æ¥ãç¡é§ã«ãã¦ã¿ããã¨æãã¾ãã Java ã¨ããããJavaããããã¼ã¸ã§ã³ã¯7ã // 1582/10/05ããã¼ã¹ Date dt1 = new SimpleDateFormat("yyyy/MM/dd").parse("1582/10/05"); System.out.println(dt1); // 1582/10/04ããã¼ã¹ Date dt2 = new SimpleDateFormat("yyyy/MM/dd").parse("1582/10/04"); System.out.p
ãã㯠1 å¹´ 7 ã¶æ 6 æ¥ åã«æ稿ããããã®ã§ããææ°ã®ãã®ã§ã¯ããã¾ããã®ã§ãééã£ã¦ããããç¥ãã¾ããã ãããªãã¨ç¡ãããã§ã ãã¦ãPHPã®é«éåã¨ããã°ã ã³ã¼ãæé©å Acceleratorå ¥ãã PHP Extensionãä½ã ãããã ã¨æãã¾ãããä»åã¯ãPHP Extensionãã使ãããã¨æãã¾ãã ãªãããã®è¨äºã§ç»å ´ããPHPã®ãã¼ã¸ã§ã³ã¯ã5.3.3ã§ãã SWIGã使ã ç´ ã§PHP Extensionã®ä½æã¨ãªãã¨ãè¦ãããã¨ãå¤ãã¦çµæ§å¤§å¤ãªã®ã§ããSWIGãã¨ãããã®ãå©ç¨ãã¾ãã ããã¯ãC/C++ã®ããã°ã©ã ãPHPãå«ããã¤ã³ã¿ããªã¿è¨èªãJavaãC#ãªã©ã§åèªåçã«ä½¿ããããã«ãã¦ãããã¨ãããã®ã§ãã便å©ã§ããã ã.iãã¨ããSWIGã«åããå¦çå 容ã示ãããã¤ã³ã¿ã¼ãã§ã¼ã¹ãã¡ã¤ã«ãã¨ãããã®ãä½æããå¿ è¦ãããã¾ãããä¸åº¦ä½ã
ããã°ã©ãã¨ã㦠Symfony æ´ã¯ 2 å¹´ããã(ãã«ã¿ã¤ã ã§ã¯ãªã) Symfony1 æ代ã¯ã»ã¼ç¥ããªã Java, Ruby, JavaScript, elisp, PHP github ä¸ã§ã¯ JavaScript ããã°ã©ã? 代表ä½ã¯ power-assert Why Symfony? ãªã Symfony ãé¸ãã ã ãã³ã¼ãããã£ãããã¦ããã ã¡ã³ãæ¹éããã£ãããã¦ãã(é·æãµãã¼ã, å¾æ¹äºææ§) DIãã¼ã¹ã®ççµåè¨è¨ã§èªåã§ã¢ã¼ããã¯ãã£ãé²åããããã ä¸é·æçãªçç£æ§ãé«ã¾ããã¨ãæå¾ ã§ãã
TL;DR User Agent å¤å®å¨ Woothee ã® PHP å®è£ ãä½ã£ã Packagist ã«ã¯ç»é²ã§ãã¦ãªãã£ããããã®ã§å°ã ãå¾ ã¡ãã ãã (2014-12-18 è¿½è¨ Packagist ã« woothee/woothee ã¨ãã¦ç»é²ãã¾ãã) Woothee ã¯ä¾¿å©ããã¸ã§ã¯ããªã®ã§çãä¸ãã£ã¦ã»ãã Woothee ã¨ã¯ Woothee ã¨ããã®ã¯ @tagomoris ãããä½ã£ã User Agent å¤å®å¨ããã¸ã§ã¯ãã§ãã Perl, Java, JavaScript, Python ã¨ãè¤æ°ã®è¨èªã«å®è£ ãç¨æããã¦ãã¦ãå ã«ãªããã¼ã¿ã»ãããããã¹ãç¨ã®ãã¼ã¿ã»ãã㯠YAML å½¢å¼ã§å ¬éããã¦ãã¾ãã 詳ããã¯ä»¥ä¸ã®ããã°è¨äºãèªãã®ãè¯ãã§ãããã UserAgentå¤å®å¨ Project Woothee ã¯ããã¾ãã æè¿ã®å¤è¨èªå¯¾å¿User-Agen
éçºãããããã°ã©ã ECãµã¤ãå ã®2ã¤ã®ç°ãªãååï¼å¤æ®µã¯åãã§ãæ§ããªãï¼ãè³¼å ¥ãããã®åè¨ä¾¡æ ¼ãæå®ã®ä¾¡æ ¼ä»¥å ã§æ大ã«ãªãçµã¿åããæ¢ãã¦ãã ããã âåé¡è©³ç´° æ°äººå¥³åããã°ã©ãã®éç°ãããéä¸ã¾ã§æ¸ããããã°ã©ã Item_a_b = 4500 // a+bã®ä¾¡æ ¼ Item_a_c = 500 // a+cã®ä¾¡æ ¼ Item_a_d = 2300 // a+dã®ä¾¡æ ¼ Item_b_a = 1240 // b+aã®ä¾¡æ ¼ Item_b_c = 5020 // b+cã®ä¾¡æ ¼ (ä¸ç¥) if Item_a_b == campaign_price print âAã¨Bã®çµã¿åãããæ大ï¼â if Item_a_b == campaign_price -10 print âAã¨Bã®çµã¿åããã¯-10åå·®ã§ãããï¼â if Item_a_c == campaign_price (以ä¸ç¥)
ã©ã¤ããã¢ããã°ã® PSGI åã®è©± ã¯è¯ãã¯ãªãã ã¨æããä¸æ¹ã§ãç§ã¯ããã¾ã Perl ã好ããããªãã®ã§ã10å¹´ã«ããã£ã¦çãç¶ãã Perl ã¢ããªã±ã¼ã·ã§ã³ãã次ã®10å¹´ã«ããã¦ã¢ãããã¯ããã¦ããã®ã¯ãã¡ãã£ã¨ãããã©ã¼ã§ãããã Twitter 㨠Ruby 㨠JVM ã©ã¤ããã¢ããã°ããå°æ¥ã«åã㦠mod_perl ãã PSGI + Starlet ã«ãããããã«ãå°æ¥ã«åãã¦ããã°ã©ãã³ã°è¨èªãããã人éãåå¨ãããæè¿ã®äºä¾ã§æåãªã®ã¯ãTwitter ã® Ruby ãã JVM è¨èªç¾¤ã¸ã®ç§»è¡ã ããã OSCON Java 2011 ã® Twitter: From Ruby on Rails to the JVM ã§ã¯ãJVM ã¸ã®ç§»è¡ã«è³ã£ãçç±ã¨ã㦠Ability to handle server workloads A real concurrency
å¸æ°ãRubyããããããã帰ããªãã ãScalaã®ããã§Javaã ãã©å°ãScalaãªJSON APIã Javaãã Rubyã¸ï¼ ã»ã»ã»ãããªææãã俺ã«ãããã¾ããã Rubyã®è¨è¿°å㯠Javaã¨æ¯ã¹ã¦æ¬å½ã«é åçã§ãè¨å®ããè¦ç´ã ï¼ããã¯ã¿ã¤ãã³ã°ã ï¼ãªãã¦ãããªããä¸ææã¿ããªã㦠Railsã«ç¾¤ãã£ã¦ããã ãã©ãäºææ§ãããã»ã©éè¦ãããªãããè¨èªããã¬ã¼ã ã¯ã¼ã¯ã®ãã¼ã¸ã§ã³ã¢ããã«ç½®ãã¦è¡ãããã¨ã²ã©ãç®ã«ããããã¿ã¤ããã¹ã²ã¨ã¤ãããã¹ãåãã¦ãããªãã¨æ¾ããªããããªã«ããå®è¡é度ãã²ã©ãé ãããããããã¦ãããã¡ã« Javaã®æ¹ã¯ã¢ãã¼ã·ã§ã³ãç©æ¥µçã«ä½¿ãããå§ãããã¨ã§è¨å®ãã¡ã¤ã«ã¯å°ãããªã£ãããåçãªåã®ã»ããæè»ã§ããã¨ããã®ã¯èª°ãè¨ãå§ããã®ãç¥ããªããå®ã¯æ°ã®ãããããªããã¨çãæ°ä»ãå§ããã®ãç¡çã¯ãªãã ãããJavaã¸ã帰ãã¿ããªã ããã㦠J
ãJSONæååã¸ã®ã¤ã³ã¸ã§ã¯ã·ã§ã³ãã¨ããã©ã¡ã¼ã¿ã®è¿½å ãï¼NoSQLã使ããªãç¥ã£ã¦ããããã»ãã¥ãªãã£ã®è©±ï¼2ï¼ï¼1/2 ãã¼ã¸ï¼ MongoDBãç¨ããWebã¢ããªã±ã¼ã·ã§ã³ã§çããå¯è½æ§ããã4種é¡ã®èå¼±æ§ã®ãã¡ãä»åã¯ãJSONæååã¸ã®ã¤ã³ã¸ã§ã¯ã·ã§ã³ãã¨ããã©ã¡ã¼ã¿ã®è¿½å ãã®ã¡ã«ããºã ã¨å¯¾çã«ã¤ãã¦èª¬æãã¾ãã ååã®ããæ¼ç®åã®ã¤ã³ã¸ã§ã¯ã·ã§ã³ãã¨ãSSJIããã§ã¯ãMongoDBãç¨ããWebã¢ããªã±ã¼ã·ã§ã³ã§çãããèå¼±æ§ã®ãã¡ãæ¼ç®åã®ã¤ã³ã¸ã§ã¯ã·ã§ã³ãã¨ãSSJIãã«ã¤ãã¦ãæ»æã®å®ä¾ã¨å¯¾çã«ã¤ãã¦è§£èª¬ãã¾ãããä»åã¯ããã«ããJSONæååã¸ã®ã¤ã³ã¸ã§ã¯ã·ã§ã³ãã¨ããã©ã¡ã¼ã¿ã®è¿½å ãã«ã¤ãã¦èª¬æãã¾ãã JSONæååã¸ã®ã¤ã³ã¸ã§ã¯ã·ã§ã³ ããã¾ã§è¦ã¦ããããã«ãPHPè¨èªã«ããã¦ã¯é£æ³é åãæå®ãã¦ãã¼ã¿ã®ç»é²å¦çãæ¤ç´¢å¦çãå®è¡ã§ãã¾ãããããåã®æ±ããå³æ ¼
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}