ã·ã¹ãã ã¯ç¡æé åžã¢ãã«ãšãªãŒãã³ãœãŒã¹ã³ãŒãïŒMITïŒãä¿æããŠããŸãããããœãŒã¹ã³ãŒãã¯MVCã¢ãŒããã¯ãã£ãšPSR-0ã¹ã¿ãŒãã¢ããçšã«å®å šã«æžãçŽãããŸããã å€ãã®ããã€ã¯ããã·ã¹ãã ããåé€ãããsymfony http財å£ãlaravel eloquentãªã©å€ãã®äººæ°ã®ããã³ã³ããŒãã³ãããã®å Žæãå ããŸããã
ãªãµã€ã¯ã«ã·ã¹ãã ã¢ãŒããã¯ãã£
ã·ã¹ãã ã®2çªç®ã®ããŒãžã§ã³ã«ã€ããŠè°è«ããå€ãã®habrahabrãŠãŒã¶ãŒã¯ãçŸåšã®åŸåãèæ ®ããŠã·ã¹ãã ãå€§å¹ ã«åèšèšããããšãæšå¥šããŸããïŒäŸåé¢ä¿ãšã³ã³ããŒã¶ãŒã®ããŒãžã§ã³ãããŒãžã£ãŒãè¿œå ãã確ç«ãããMVCã¢ãŒããã¯ãã£ãå°å ¥ããã³ãŒããåäžã®PSR-1 / 2ã¹ã¿ã€ã«ã«ããŸãã 2çªç®ã®ããŒãžã§ã³ã®ã³ãŒãã¯å®éã«ã¯ããªãäœå質ã§ãããããã«ã€ããŠèãç Žãããšãã§ããŸããïŒ
åã«ææ°ã®ããŒã«ãšã¢ããªã±ãŒã·ã§ã³éçºã®ååãå®è£ ããå¿ èŠããããŸããããæ¢åã®ã³ãŒããæžãæããããšã¯ã»ãšãã©äžå¯èœã§ããããããã£ãŠãã·ã¹ãã ã¢ãŒããã¯ãã£ããŒãããåèšèšããããšã«ããŸããã
ã·ã¹ãã ã¯ãåºæ¬æ§é ãã«ãŒãã«ãã³ã³ãœãŒã«ãšããããã€ãã®æ©èœéšåã«åå²ãããŸããã ããŒãããšã«ãªããžããªãäœæãããã³ã³ããŒã¶ãŒãæ§æããããããžã§ã¯ããpackagistã§å ¬éãããŸããã ãã¹ãŠã®ããŒãã¯ãããŒã¹ã³ã³ããŒãã³ãã®composer.jsonã®äŸåé¢ä¿ã䜿çšããŠãªã³ã¯ãããŸãã
èªè»¢è»ã®æŸæ£
éå»æ°å¹Žéã®ã¢ããªã±ãŒã·ã§ã³éçºã§ãsymfonyãlaravelãyiiãcodeigniterãªã©ã®äžè¬çãªãã¬ãŒã ã¯ãŒã¯ã®ã»ãšãã©ã«åºäŒããŸããã
ãã®ããããèªè»¢è»ãã®æ¬¡ã®éšåã¯ãå®è©ã®ãã人æ°ã®ããã³ã³ããŒãã³ãã«çœ®ãæããããŸããã
- ãããã¯ãŒãã³ã°ïŒsymfony http Foundation
- ããŒã¿ããŒã¹ã®æäœïŒDBãããŒãžã£ãŒïŒïŒlaravel eloquent
- HTMLã³ãŒãã»ãã¥ãªãã£ïŒHTMLãã¥ãŒãªãã¡ã€ã€ãŒ
- ã³ã³ãœãŒã«ã®æäœïŒsymfonyã³ã³ãœãŒã«
- ãã£ãã·ã¥ã³ã¢ïŒPHPé«éãã£ãã·ã¥
- ãããã°ïŒdebugBar
- ã¡ãŒã«ã®æäœïŒã¡ãŒã©ãŒïŒïŒswiftmailer
- oAuth 2.0èªèšŒïŒhybridauth
䜿çšãããã³ã³ããŒãã³ãã®äžéšã«ã€ããŠã¯ããåå«ããèšè¿°ãããã·ã¹ãã ã®ããŒãºã«åãããŠã³ã³ããŒãã³ãã®æ©èœãæ¡åŒµãŸãã¯ç°¡çŽ åããŸããã ãããã®ã³ã³ããŒãã³ãã䜿çšããããšã§ãã·ã¹ãã ã®åºæ¬çãªã³ã¢ãç°¡çŽ åããä»ã®éçºè ã®ãããå€ãäžããããšãã§ããŸããã
ããã©ãŒãã³ã¹ãšäºææ§
ããããphp-5.2ãµããŒããå°å ¥ããpolyfillã䜿çšããå¿ èŠããããŸããïŒ ããããããããäžåºŠã çŸåšãPHP 7.1ãšéæšå¥šã®5.5ãžã®ç§»è¡ã«ãããå€ãããŒãžã§ã³ã®PHPããµããŒãããæå³ã¯ãŸã£ãããããŸããã ãã¡ãããããªãã£ã«ã䜿çšããèªæã¯çŽ æŽãããã§ããããã§ã«å°é£ãªã·ã¹ãã ãè€éã«ããªãããã«ããããæåŠããããšãã§ããŸãã
FFCMS 3ã¯ãããŒãžã§ã³5.5以éã®nginxãã³ãã«-php-fpmãapache2-phpãŸãã¯ãã®ä»ã®ãã³ãã«ïŒuriã®æžãæãã«ãŒã«ãæžãæããããŠããå ŽåïŒã§åäœããphpã€ã³ã¿ãŒããªã¿ãŒã§åäœããŸãã
ã·ã¹ãã ã®ããã©ãŒãã³ã¹ã¯ããã»ã©äœäžããŸããã§ãããããªãœãŒã¹ã®æ¶è²»éã¯2çªç®ã®ããŒãžã§ã³ãããå€å°å€§ãããªããŸããïŒé©ãããšã§ã¯ãããŸããïŒ
ãã³ãã¬ãŒãåïŒ ãŸãã¯è£žã®phpïŒ ïŒ
ãã®çŽäºã§ã¯ãæŠéæ©ã¯å€ãã®å£ãç Žå£ããŸãããããã®åé¡ã«é¢ããã³ã³ã»ã³ãµã¹ã¯ãããŸããã å€ãã®äººã¯ãPHPæ§æèªäœã§ãã³ãã¬ãŒããäœæããã®ã«ååã§ãããšèããŠããŸãã ã·ã¹ãã ã®2çªç®ã®ããŒãžã§ã³ã§ã¯ãtwigã䜿çšãããŸãããããã¥ãŒã§htmlã³ãŒããçæããããã®å€å žçãªphpæ§æã«å¶éããããšã«ããŸããã
æŽç·Žãããã³ãŒã
// : public function actionIndex() { // blablabla return $this->view->render('dir/file', [ 'param' => 'my value' ]); } // <h1>Demo view</h1> <p>param value is: <?= $param ?>
UIã®ãã¹ãŠã¯åããŸãŸã§ããjqueryãšbootstrapã¯å®çžŸã®ããæã§ãã
DBãã¯ãšãªãããã³ActiveRecord
PHPå ã®ããŒã¿ããŒã¹ãšããåãããã«ã¯ãããŸããŸãªæ¹æ³ããããŸãã 誰ãã裞ã®PDOã§ã誰ããDoctrineãšQueryBuildersã§åäœããŸãã FFCMSã¯laravel eloquentã©ã€ãã©ãªã䜿çšããŸããããã«ãããã¯ãšãªãã«ããŒããŒã«ãšActiveRecordsã¢ãããŒãã䜿çšããŠããŒã¿ããŒã¹ãšå¯Ÿè©±ã§ããŸãã
ActiveRecordã¯ããŒã¿ããŒã¹ãæäœããã®ã«éåžžã«äŸ¿å©ã§ãã¯ãšãªã®æ§æãå€§å¹ ã«ç°¡çŽ åããã³åæžããŸãã ãã¡ãããããã¯æ¬æ ŒçãªDoctrine ORMã§ã¯ãããŸããããCMSã®ç®çã«ã¯ååã§ãã
移è¡
移è¡ãšãããã®ãããªããå±éãããªããã°ã©ãã«ããããŸããã ãããããã¡ããmysqldump / pg_dumpã䜿çšããŠãã人ãããŸããããã®éããã©ããŸããã ffcms 3ã«ã¯ã移è¡ã®æšæºå®è£ ããããŸã-upïŒïŒãseedïŒïŒãdownïŒïŒã®3ã€ã®ã¡ãœãããæã€ã¯ã©ã¹ã移è¡ãäœæãé©çšãããŒã«ããã¯ããæ©èœã æšæºã®ç§»è¡ã¯/ Private / Migrationsã«ä¿åãããŸãããMigrationsManagerã䜿çšããŠä»»æã®ãã£ã¬ã¯ããªããã®ç§»è¡ãå®è£ ã§ããŸãã
ãããã°
è¿ éãªãããã°ãšèŠæ±ã®ãããã¡ã€ãªã³ã°ã®å©äŸ¿æ§ã®ããã«ãfpdebugbaræ©èœãffcmsã«çµã¿èŸŒãŸããŠããŸãã ãã®ã¡ã«ããºã ã«ãããxdebug / zenddebugã«æ¥ç¶ããå¯èœæ§ãæéããªããšãã«è¿ éã«ãããã°ã§ããŸãã ãããã¬ã¯ããã«ã®ããã«èŠãã管çããã«ã®èšå®ã«å«ããããšãã§ããŸãã
ãããã°ããŒããã®åç
ãã¹ãäž
æåã®è£œåæ£åžžæ§ãã¹ãã¯ãçŸä»£ã®éçºã®åŸåã§ã¯ãããŸããã ã·ã¹ãã ã³ãŒããšUIã®èªåãã¹ããç®çãšããŠãèªåãã¹ãã·ã¹ãã ãå°å ¥ãããŸãããããã¯ãæšæºçãªãŠããããã¹ããšã€ã³ã¿ãŒãã§ã€ã¹ã®åãå ¥ããã¹ããçµã¿åãããcodeceptionã§ãã
ã¯ãã ãŸãã¯å¥ã®ãã©ãŠã¶ãŒã®ãã©ã€ããŒã§ã»ã¬ã³ãå®è¡ããåŸãcodecept runã³ãã³ãã䜿çšããŠãã«ãŒããããã¹ããå®è¡ã§ããŸãã ã¬ã€ã€ãŒã®ãã¹ãç°å¢èšå®ïŒ/tests/acceptance.suite.ymlïŒãç·šéããããšãå¿ èŠã§ãã ãã¹ããæ§æããããã«ã䜿çšèª¬ææžãèšèŒãããå°ããªããã¥ã¡ã³ãããããŸã ïŒããã¥ã¡ã³ãã¯å ã ããã¹ãŠã®ç®ãã察象ãšããŠããŸããã§ããããã¿ãŸããïŒã
ãã¹ãã§gifãããæ°ã«ãããïŒ5Mb !!!ïŒ
æ¡åŒµæ©èœ
PSR-0ã¹ã¿ãŒãã¢ãããå©çšå¯èœã«ãªã£ããããæ¡åŒµã·ã¹ãã ãæ¹èšãããŸããã çŸåšããã¹ãŠã®æ¡åŒµæ©èœã¯ãã¢ããªã±ãŒã·ã§ã³ãšãŠã£ãžã§ãããæåã®2ã€ã®ã¿ã€ãã«åãããŠããŸããã³ã³ãããŒã©ãŒã«å¿ããŠç¹å®ã®ã«ãŒãURIãå æããã¢ã¯ã·ã§ã³ã®å©ããåããŠç¹å®ã®ãªã¯ãšã¹ããåŠçããŸãã 2ã€ç®ã¯ããŠã£ãžã§ããã¯ã©ã¹ã«çŽæ¥ã¢ã¯ã»ã¹ããããšã«ãããä»»æã®å Žæã§è¡šçŸã衚瀺ããããšãç®çãšããŠããŸãã
ããã«ããå®è£ ãã®ã»ããå šäœã1ã€ã®ããã±ãŒãžã«ã©ããããgitããã³composerã䜿çšããŠãautoloadæšæºã«åŸã£ãŠãèªçµŠèªè¶³ã®å®è£ ãšããŠé åžã§ããŸãã é¡èãªäŸã¯ã ãã©ãŒã©ã ãŸãã¯ãã¢ããã±ãŒãžã® å®è£ ã§ã ã
ããŠãç§ã®è©±ã¯ååã«åŒãããåºãããŸãããããããããã¹ãŠã1ã€ã®èšäºã«åããããšã¯äžå¯èœã§ãã ç§ã¯ããªãã®è³ªåã«çããŠãããªãã®é¡ãã«è³ãåŸããŸãã
âå ¬åŒãŠã§ããµã€ãïŒ ffcms.org ïŒãã©ãŒïŒ ffcms.ru ïŒ
âgithubã§ã®ãããžã§ã¯ãïŒ phpffcms
â管çè ããã³éçºè ã®ããã¥ã¡ã³ãïŒ doc.ffcms.ru ïŒéçºäžïŒã