CodeIgniter 3.0ã®ã¢ãã³ãªã¤ã³ã¹ãã¼ã«æ¹æ³
CodeIgniter Advent Calendar 2015 ã®6æ¥ç®ã§ããã¾ã ã空ããããã¾ãã®ã§ãèå³ã®ããæ¹ã¯æ°è»½ã«åå ãã¦ãã ããã
ä»æ¥ã¯ãCodeIgniter 3.0ã®ã¢ãã³ãªã¤ã³ã¹ãã¼ã«æ¹æ³ã§ãã
ã¨ããã§ãã¢ãã³ã£ã¦ä½ã§ããããï¼ãã®ç¨èªããã¡ãã¨å®ç¾©ããã¦ãã¾ããããããã§ã¯ãä½ã¨ãªãä»ã£ã½ãããããã®æå³ã§ä½¿ã£ã¦ã¾ãã
ãã ãPHPã®ãã¼ã¸ã§ã³ã¨ãã¦ã¯5.4以ä¸ã¨ãã¾ããPHP 5.3ã§ãCodeIgniteræ¬ä½ã¯ã¤ã³ã¹ãã¼ã«ã§ãåä½ãã¾ããããã®è¨äºã«åºã¦ããã³ã³ãã¼ãã³ãã®ä¸ã«ã¯åä½ããªããã®ãå«ã¾ãã¾ãã
ãªããPHP 5.4ãä¿å®ã¯ãã§ã«çµäºãã¦ãã¾ãã®ã§ã5.5ã5.6ã¾ãã¯7.0ã¸ç§»è¡ããæ¹ãããã§ãããã
Composerã®ã¤ã³ã¹ãã¼ã«
ã¢ãã³PHPã¨è¨ãã°ãComposerã§ãã
Composerã¨ã¯ãPHPã§ã®æ°ããããã±ã¼ã¸ï¼ã©ã¤ãã©ãªï¼ç®¡çã·ã¹ãã ã§ããç°¡åã«è¨ãã¨PEARã®å¾ç¶ã¿ãããªãã®ã§ãã
Composerã¯ããã±ã¼ã¸ç®¡çã³ãã³ãã¨ãã¦ã®composer
ã³ãã³ããããã±ã¼ã¸ã®ãªãã¸ããªã¨ãã¦ã®Packagistãããã¦ã¯ã©ã¹ãã¡ã¤ã«ããªã¼ããã¼ããããªã¼ããã¼ããæä¾ãã¾ãã
PAERã主ã«ãµã¼ãã«ã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«ããåããã¸ã§ã¯ãã¯ãã®ãµã¼ãã®å ±æã©ã¤ãã©ãªã使ã£ãã®ã«å¯¾ããComposerã§ã¯ä¸»ã«ããã±ã¼ã¸ãåããã¸ã§ã¯ãé ä¸ã«ã¤ã³ã¹ãã¼ã«ãã¦ä½¿ãã¾ãã
Linux/Mac OS Xã§ã®Composerã®ã¤ã³ã¹ãã¼ã«
以ä¸ã®ã³ãã³ãã§ã¤ã³ã¹ãã¼ã«ã§ãã¾ãã
$ curl -sS https://getcomposer.org/installer | php
$ sudo mkdir -p /usr/local/bin
$ sudo mv composer.phar /usr/local/bin/composer
Windowsã§ã®Composerã®ã¤ã³ã¹ãã¼ã«
https://getcomposer.org/Composer-Setup.exe ã«ã¤ã³ã¹ãã¼ã©ãããã®ã§ããã¦ã³ãã¼ããã¦å®è¡ãã¦ãã ããã
ãªããWindowsã§ã®ã³ãã³ãã®å®è¡ã«ã¯ãGit for Windows ã«å«ã¾ããGit Bashã使ããã¨ããè¦ããã¾ãã
CodeIgniterã®ã¤ã³ã¹ãã¼ã«
ãã¦ãComposerãã¤ã³ã¹ãã¼ã«ã§ãã¾ããã®ã§ããããããæ¬é¡ã®CodeIgniterã®ã¤ã³ã¹ãã¼ã«ã§ãã
CodeIgniter 3.0ãã¤ã³ã¹ãã¼ã«ããã«ã¯ãã¿ã¼ããã«ã¾ãã¯Git Bashãã以ä¸ã®ã³ãã³ããå®è¡ãã¾ããæå¾ã®codeigniter
ã¯ãã©ã«ãåãªã®ã§å¿
è¦ãªãå¤æ´ãã¦ãã ããã
$ composer create-project kenjis/codeigniter-composer-installer codeigniter
ä¸è¨ã®ã³ãã³ãã¯ã以ä¸ãå®è¡ãã¾ãã
- ããã¸ã§ã¯ãã®ãã©ã«ããä½æããCodeIgniterãComposerã§
vendor
ãã©ã«ã以ä¸ã«ã¤ã³ã¹ãã¼ã«ãã application
ãã©ã«ããããã¸ã§ã¯ãã®ãããã«ã³ãã¼ããindex.php
ãpublic/index.php
ã«ã³ãã¼ãã- ãã©ã«ãæ§æã®å¤æ´ã«ä¼´ããã¹ã®èª¿æ´ã¨CodeIgniterããComposerã®ãªã¼ããã¼ãã使ããããã«è¨å®ãã
ããã§ãã¤ã³ã¹ãã¼ã«ãããCodeIgniterã¯æ¬å®¶ã®3.0.*
ã§ãã
ãã©ã«ãæ§æã¯ä»¥ä¸ã®ããã«ãªãã¾ãã
codeigniter/
âââ application/
âââ composer.json ... Composerã®è¨å®ãã¡ã¤ã«
âââ composer.lock ... Composerã®ããã¯ãã¡ã¤ã«
âââ public/
â âââ index.php
âââ vendor/
âââ codeigniter/
âââ framework/
âââ system/
Composerã®ããã¯ãã¡ã¤ã«ã¯èªåçã«çæããããã®ã§ã¤ã³ã¹ãã¼ã«ãããããã±ã¼ã¸ã®ãã¼ã¸ã§ã³ãªã©ã®æ
å ±ãè¨é²ããã¾ããããã£ã¦ã¯ããã¾ãããã¾ããvendor
ãã©ã«ã以ä¸ã«ããã±ã¼ã¸ã®ã½ã¼ã¹ãã¤ã³ã¹ãã¼ã«ããã¾ããvendor
ãã©ã«ãã®ä¸ãComposerããã¹ã¦ç®¡çãã¾ãã®ã§ãä¸ã®ãã¡ã¤ã«ãç·¨éãªã©ãã¦ã¯ããã¾ããã
å®éã«ã³ãã³ããå®è¡ããã¨ã以ä¸ã®ããã«ã¤ã³ã¹ãã¼ã«ããã¾ãã
$ composer create-project kenjis/codeigniter-composer-installer codeigniter
Installing kenjis/codeigniter-composer-installer (v0.4.0)
- Installing kenjis/codeigniter-composer-installer (v0.4.0)
Downloading: 100%
Created project in codeigniter
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing codeigniter/framework (3.0.3)
Loading from cache
Writing lock file
Generating autoload files
> Kenjis\CodeIgniter\Installer::postInstall
> composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing mikey179/vfsstream (v1.1.0)
Loading from cache
Writing lock file
Generating autoload files
> Kenjis\CodeIgniter\Installer::showMessage
==================================================
`public/.htaccess` was installed. If you don't need it, please remove it.
If you want to install translations for system messages or some third party libraries,
$ cd <codeigniter_project_folder>
$ php bin/install.php
Above command will show help message.
See <https://github.com/kenjis/codeigniter-composer-installer> for details
==================================================
ã¯ããå®äºãã¾ããã
- Installing codeigniter/framework (3.0.3)
CodeIgniter 3.0.3ãã¤ã³ã¹ãã¼ã«ããããã¨ããããã¾ãã
追å ã³ã³ãã¼ãã³ãã®ã¤ã³ã¹ãã¼ã«
CodeIgniteræ¬ä½ã®ã¤ã³ã¹ãã¼ã«ã¯ã§ãã¾ããããæ¬ä½ã ãã§ããã¨ããã±ã¼ã¹ã¯ã»ã¨ãã©ãªãã¨æãã¾ãã
ãã¨ãã¨CodeIgniterã¯æå°éã®ãã¼ãããæä¾ããªãã®ã§ãèªåã§ãã¼ãã足ãã¦ä½ãè¾¼ãã§ããæãã®ãã¬ã¼ã ã¯ã¼ã¯ã§ããã¾ããæ¥æ¬èªãµã¤ãã«ã¯æ¥æ¬èªã®ã·ã¹ãã ã¡ãã»ã¼ã¸ãå¿ è¦ã§ãã
ã¨ãããã¨ã§ãã®ä»å¿ è¦ãªãã®ã追å ã§ã¤ã³ã¹ãã¼ã«ãã¾ãã
ãã®ããã®ãµã³ãã«ã®ã·ã§ã«ã¹ã¯ãªãããbin/my-codeigniter.sh
ã«ã¤ã³ã¹ãã¼ã«ããã¦ãã¾ãã以ä¸ã®ã³ãã³ãã§å®è¡ã§ãã¾ãã
$ cd codeigniter/
$ bin/my-codeigniter.sh
ãã®ã³ãã³ãã¯ä»¥ä¸ãã¤ã³ã¹ãã¼ã«ãã¾ãããããã¯ãå人çã«ã©ããªããã¸ã§ã¯ãã«ãå¿ è¦ãããªãã®ã§ãã
- CodeIgniterã®ã·ã¹ãã ã¡ãã»ã¼ã¸ã®ç¿»è¨³ï¼æ¥æ¬èªå«ãï¼
- Roave Security Advisories ... æ¢ç¥ã®èå¼±æ§ãå«ãComposerããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ãããªããã®ãã§ãã¯ãã¼ã«
- CodeIgniter Simple and Secure Twig ... CodeIgniterã§Twigã使ãããã®ã·ã³ãã«ãªã©ã¤ãã©ãª
- Codeigniter Matches CLI ... ã³ã³ããã¼ã©ãã¢ãã«ããã¥ã¼ãä½æããããã®ã·ã³ãã«ãªã³ãã³ãã©ã¤ã³ã¹ã¯ãªãã
- Cli for CodeIgniter ... ã³ãã³ãã©ã¤ã³ãããã¤ã°ã¬ã¼ã·ã§ã³ãæä½ãããã¼ã«
- ci-phpunit-test ... CodeIgniterã¨PHPUnitã®ããªãã¸ãã¼ã«
- CodeIgniter Deployer ... ãããã¤ãã¼ã«
ããããããã¯ãµã³ãã«ãªã®ã§ãä¸è¦ãªãã®ã¯ã¤ã³ã¹ãã¼ã«ããå¿ è¦ã¯ãªãã§ãããå¿ è¦ãªã³ã³ãã¼ãã³ããªã©ãããã°ãããã«è¿½å ãããã¨ã«ãªãã¾ãã
Roave Security Advisories
Roave Security Advisoriesã¯ãFriendsOfPHP/security-advisories ã®ãã¼ã¿ã使ãèå¼±æ§ã®ããããã±ã¼ã¸ããã§ãã¯ãããã®ã§ãã
ãã ãããã¼ã¿ã¯æ¥æ¬¡æ´æ°ã®ããã§ã¿ã¤ã ã©ã°ãããããªã¢ã«ã¿ã¤ã ã§ã¯ããã¾ããã
ã¾ããããã±ã¼ã¸ã®è¿½å ããã³æ´æ°æã«ã®ã¿ãã§ãã¯ãããã®ã§ãcomposer.lock
ãã¡ã¤ã«ã«ããcomposer installããå ´åã«ã¯ãã§ãã¯ã¯ããã¾ãããã¤ã³ã¹ãã¼ã«å¾ã¾ãã¯æ´æ°å¾ã«èå¼±æ§ãå ±åãããããã±ã¼ã¸ã¯ãã®ã¾ã¾ãããã¤ããããã¨ã«ãªãã¾ãã
ã¤ã¾ããæ¢ç¥ã®èå¼±æ§ãå«ãããã±ã¼ã¸ã確å®ã«ãããã¤ããããªãå ´åã¯ããããã¤æã«security-checker.phar
ã§ãã§ãã¯ããå¿
è¦ãããã¾ãã
ã¡ãªã¿ã«ãVulnerability Database - SensioLabs Security Advisories Checker ã«CodeIgnirer 3.0.2以åãç»é²ãã¾ããã®ã§ã3.0.2以åãæ°è¦ã§ã¤ã³ã¹ãã¼ã«ãããã¨ããã¨ã以ä¸ã®ããã«å¤±æãã¾ãã
Your requirements could not be resolved to an installable set of packages.
Problem 1
- codeigniter/framework 3.0.2 conflicts with roave/security-advisories[dev-master].
- codeigniter/framework 3.0.2 conflicts with roave/security-advisories[dev-master].
- codeigniter/framework 3.0.2 conflicts with roave/security-advisories[dev-master].
- Installation request for codeigniter/framework 3.0.2 -> satisfiable by codeigniter/framework[3.0.2].
- Installation request for roave/security-advisories dev-master -> satisfiable by roave/security-advisories[dev-master].
Webãµã¼ãã®èµ·å
ã¢ãã³PHPã«ã¯ããã«ãã¤ã³Webãµã¼ããããã¾ãï¼PHP 5.4以éï¼ã以ä¸ã®ã³ãã³ãã§Webãµã¼ããèµ·åãã¾ãã
$ bin/server.sh
ããã§ãhttp://127.0.0.1:8000/ ã«ãã©ã¦ã¶ã§ã¢ã¯ã»ã¹ããã°ãã馴æã¿ã®CodeIgniterã®Welcomeãã¼ã¸ã表示ããã¾ãã
CodeIgniterã®ãã¼ã¸ã§ã³ã¢ãã
CodeIgniterã®ãã¼ã¸ã§ã³ãä¸ãã£ã¦ããCodeIgniterããã¸ã§ã¯ãã®ããããã£ã¬ã¯ããªã«ç§»åãã以ä¸ã®ã³ãã³ããå®è¡ããã°æ´æ°ã§ãã¾ãã
$ composer update
ä¾ãã°ããããªé¢¨ã«æ´æ°ããã¾ãã
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing codeigniter/framework (3.0.2)
- Installing codeigniter/framework (3.0.3)
Loading from cache
Writing lock file
Generating autoload files
ãã ãããããapplication
ãã©ã«ãå
ã®ãã¡ã¤ã«ãindex.php
ãå¤æ´ããã¦ããå ´åã¯ãããããæåã§æ´æ°ããå¿
è¦ãããã¾ãããã®å ´åã¯ãã¦ã¼ã¶ã¬ã¤ãã«å¾ã£ã¦ä½æ¥ãã¦ãã ããã
- Upgrading From a Previous Version â CodeIgniter 3.0.3 documentation
- 以åã®ãã¼ã¸ã§ã³ããã®ã¢ããã°ã¬ã¼ã â CodeIgniter 3.1.0-dev ããã¥ã¡ã³ã
system
ãã©ã«ã以ä¸ã¯å®å
¨ã«æ´æ°ããã¾ãã®ã§ãsystem
ãã©ã«ã以ä¸ã®ãã¡ã¤ã«ãç´æ¥å¤æ´ãã¦ã¯ããã¾ããããã¼ã¸ã§ã³ã¢ããæã«å¤æ´ãæ¶ãã¦ãªããªãã¾ããã¨ããããvendor
ãã©ã«ã以ä¸ã¯Composerã管çããã®ã§ããã¡ã¤ã«ã®å¤æ´ã追å ããã¦ã¯ããã¾ããã
ã¾ã¨ã
- Composerã¯ãPHPã®æ°ããããã±ã¼ã¸ï¼ã©ã¤ãã©ãªï¼ç®¡çã·ã¹ãã ã§ãã
- CodeIgniter 3.0ã¯Composerã§ã¢ãã³ã«ã¤ã³ã¹ãã¼ã«ãããã¨ãã§ãã¾ãã
é¢é£
Date: 2015/12/06