ð°ãããã°ã©ãã³ã°ããšã©ãŒæãã°ã°ã£ãŠãæ€çŽ¢ã«ãããããªã â ã¢ããªåºæã®ãšã©ãŒã¡ãã»ãŒãžã®ããšããããïŒ
ç®æ¬¡
ãšã©ãŒã¡ãã»ãŒãžãæ€çŽ¢ããŠãåºãŠããªã
ã¢ããªéçºãããã°ã©ãã³ã°ã®åŠç¿ã®éã«ãšã©ãŒãçºçããŠããã°ã©ã ãåäœããªããšãã
ãã©ãŠã¶ãã³ã³ãœãŒã«ã«åºåããããšã©ãŒã¡ãã»ãŒãžããã®ãŸãŸã³ããããŠGoogleã§æ€çŽ¢ãè¡ãããšã¯äžè¬çãªæ¹æ³ã§ããããšãããŸæ€çŽ¢ã«å
šããããããªããšã©ãŒã¡ãã»ãŒãžããããŸãã
ãã®å Žåãããã°ã©ãã³ã°èšèªãéçºç°å¢ã®ãšã©ãŒã§ã¯ãªããéçºäžã®ã¢ããªã±ãŒã·ã§ã³ã®å éšã§å¥ãªéçºè ïŒåŠç¿ã³ã³ãã³ãã®å Žåããã®äœæè ãªã©ïŒãä»»æã§çšæãããšã©ãŒã¡ãã»ãŒãžã®å¯èœæ§ããããŸãã
ã¢ããªã±ãŒã·ã§ã³åºæã®ã¡ãã»ãŒãžã¯åºãæ®åããŠãããã®ã§ãªããã°ãã€ã³ã¿ãŒãããäžã®æ€çŽ¢ã§èŠã€ããããšãã§ããªãããšããããŸãã
ãšãã«ãšã©ãŒã¡ãã»ãŒãžãè±èªã§æžãããŠããå ŽåãååŠè ãçµéšã®æµ ãæ¹ã«ãšã£ãŠãä»ã®Googleæ€çŽ¢ã§ããããããšã©ãŒã¡ãã»ãŒãžãšåºå¥ãã€ããããã¿ããã«æ€çŽ¢ããããŠããŸãããšã©ãŒã®è§£æ±ºçãèŠã€ããããšãå°é£ã«ãªã£ãŠããŸãããšãããããšæããŸãã
ããã§ããã®èšäºã§ã¯ããããé¡ã®ãšã©ãŒã解決ããããã®ããã»ã¹ã玹ä»ããŠã¿ãããšæããŸãã
ã¢ããªã±ãŒã·ã§ã³ã®å éšã§å šææ€çŽ¢ããã
ãšã©ãŒã¡ãã»ãŒãžãã¢ããªã±ãŒã·ã§ã³åºæã®ãã®ãšæãããå Žåã¯ãã¢ããªã±ãŒã·ã§ã³å éšã§å šææ€çŽ¢ããããããšã§ããšã©ãŒãçºçããŠããç®æããŸãã¯ç¹å®ããããšãã§ããŸãã
VSCodeãªã©é«æ©èœãªããã¹ããšãã£ã¿ã䜿çšããŠããå Žåã¯ããšãã£ã¿å
ã®æ€çŽ¢æ©èœã䜿çšããããšãã§ããŸããã
ããæ±çšçãã€ç¢ºå®ãªæ段ãšããŠä»¥äžã®Unixã³ãã³ãã䜿çšããæ¹æ³ã玹ä»ããŸãã
å šææ€çŽ¢çšã·ã§ã«ã³ãã³ã
Dockerã³ã³ãããMac OSãªã©ãéçºç°å¢ã§Unixã³ãã³ãã䜿çšã§ããå Žåã¯ã以äžã®ã³ãã³ããå®è¡ããããšã§ããã°ã©ã å éšã§å šææ€çŽ¢ããããããšãå¯èœã§ãã
find . -type f -exec grep "æ€çŽ¢ãããšã©ãŒã¡ãã»ãŒãž" {} +;
findã³ãã³ãã§æ€çŽ¢å¯Ÿè±¡ã®ãã¹ãæå®ãgrepã³ãã³ãã§æ€çŽ¢ããããããšã©ãŒã¡ãã»ãŒãžããã®ãŸãŸæå®ããŸãã
ãã®ä»ã®ãªãã·ã§ã³çã¯å®åçãªæ±ºãŸãã®ãããªãã®ã§ãããèå³ã®ããæ¹ã¯èª¿ã¹ãŠã¿ãŠãã ããã
äžèšã®å Žåã§ããšã«ã¬ã³ããã£ã¬ã¯ããªããã¹ã«æå®ããŠããŸãã
ïŒå®äŸïŒ Webãã¬ãŒã ã¯ãŒã¯å éšã§ãšã©ãŒã¡ãã»ãŒãžãæ€çŽ¢
äžèšã§çŽ¹ä»ããå
šææ€çŽ¢ã³ãã³ãã䜿çšããŠããšã©ãŒãšãã®åå ãç¹å®ããããã»ã¹ãã
PHPã®ã¢ããªã±ãŒã·ã§ã³ãã¬ãŒã ã¯ãŒã¯ãZend FrameworkïŒ1.7.6ïŒã®éçºç°å¢æ§ç¯ã®éã«çºçãããšã©ãŒãäŸã«åãäžããŠè§£èª¬ããŸãã
ãã ãããã¡ãã¯ã¡ãžã£ãŒãªæè¡åéã§ãã®ã§ãGoogleæ€çŽ¢ã§ãå€ãã®æç®ãèŠã€ããããšæããŸãããä»åã¯ããã°ã©ã ã®å éšãšã©ãŒã調æ»ãããšããããã»ã¹ã®éšåã«ãã©ãŒã«ã¹ããŠåèã«ããŠããã ããã°ãšæããŸãã
ç»é¢ã«è¡šç€ºããããšã©ãŒ
Zend Frameworkãã€ã³ã¹ããŒã«ãããã¢ç»é¢ã®è¡šç€ºãè©Šã¿ããšããç»é¢ã«ä»¥äžã®ãšã©ãŒãçºçã
ãšã©ãŒã¡ãã»ãŒãž
ãImage CAPTCHA requires FT fonts supportã
ãã¡ãã®ãšã©ãŒã¡ãã»ãŒãžãZend Frameworkæ¬äœã®ããã°ã©ã ã«å¯ŸããŠå šææ€çŽ¢ãè¡ããŸãã
éçºç°å¢äžã®Zend Frameworkæ¬äœãã€ã³ã¹ããŒã«ãããã¹ã«ç§»åããŠã以äžãå®è¡
find . -type f -exec grep "Image CAPTCHA requires FT fonts support" {} +;
ïŒæ€çŽ¢çµæïŒ
./Captcha/Image.php: throw new Zend_Captcha_Exception("Image CAPTCHA requires FT fonts support");
äžèšæ€çŽ¢çµæããã./Captcha/Image.phpãšãããã¡ã€ã«å ã§äŸå€ãã¹ããŒããŠããç®æãããããã®éã«è©²åœã®ãšã©ãŒã¡ãã»ãŒãžãæå®ããŠããããšãããããŸãã
次ã«ããã®äŸå€ãã©ã®ãããªå Žåã«ã¹ããŒãããŠããããç¹å®ããããšã§ããšã©ãŒãçºçããæ ¹æ¬çãªåå ããããããã§ãã®ã§ã
./Captcha/Image.phpããšãã£ã¿ã§éããŠè©³çŽ°ã確èªããŸãã
ïŒäŸå€çºçç®æããšãã£ã¿ã§å±éïŒ
if (!function_exists("imageftbbox")) {
require_once 'Zend/Captcha/Exception.php';
throw new Zend_Captcha_Exception("Image CAPTCHA requires FT fonts support");
}
PHPã®ãœãŒã¹ã³ãŒããããimageftbboxãšããé¢æ°ãååšããªãå Žåã«ä»åã®äŸå€ãã¹ããŒãããããšãããããŸããã
imageftbboxãšããé¢æ°ã¯ããããPHPæ¬äœã®æ©èœãšããŠããã©ã«ããšããŠçšæãããŠããé¢æ°ãšæãããŸãã®ã§ã次ã«èª¿ã¹ãã¹ãã¯imageftbboxé¢æ°ãååšããŠããªãããããã¯é¢æ°ãåŒã³åºãããšãã§ããªãåå ã¯äœã§ããããšããããšã«ãªããŸãã
ããããå ã¯Googleæ€çŽ¢ã䜿ã£ãŠãPHPã®å ¬åŒããã¥ã¡ã³ãã«ãããããšãPHPã®ç°å¢æ§ç¯æ¹æ³ã«ã€ããŠã®æç®ãæ¢ãããšã§è§£æ±ºçãåŸãããŠããæãããŸãã
é·ããªããŸããããæ¬èšäºã§çŽ¹ä»ãããšã©ãŒè§£æ±ºã®ããã»ã¹ãååŠè ã®æ¹ãªã©ã®åŠç¿ãã¢ããªéçºã®ãã³ããšãªãã°å¹žãã§ãã