CodeIgniterã®éçºç°å¢ãvagrant-centos6-phpã使ãæ§ç¯ãã
ä»æ¥ã¯ãVirtualBoxã¨Vagrantã使ã£ã¦ã軽éé«éãªPHPãã¬ã¼ã ã¯ã¼ã¯CodeIgniterã®ããã®éçºç°å¢ãä½æãã¦ã¿ã¾ãã
CodeIgniterã®é度ã«ã¤ãã¦ã¯ã2014å¹´ã®ææ°PHPãã¬ã¼ã ã¯ã¼ã¯ããã³ããã¼ã¯ãã¦ã¿ããåç §ãã¦ãã ããã
Vagrantã使ãã°ç°¡åã«ä»ã®éçºè ã¨åãä»®æ³ãã·ã³ãæ§ç¯ã§ãã¾ãã
VirtualBoxã¨Vagrantã®ã¤ã³ã¹ãã¼ã«
ããªã¼ãªä»®æ³åã½ããã¦ã§ã¢ã§ããVirtualBoxãã以ä¸ãããã¦ã³ãã¼ããã¤ã³ã¹ãã¼ã«ãã¾ãï¼å·çæã®åä½ç¢ºèªãã¼ã¸ã§ã³ã¯VirtualBox 4.3.18ï¼ã
VirtualBoxã®ä»®æ³ã¤ã¡ã¼ã¸ãæä½ãããã¼ã«ã§ããVagrantãã以ä¸ãããã¦ã³ãã¼ããã¤ã³ã¹ãã¼ã«ãã¾ãï¼å·çæã®åä½ç¢ºèªãã¼ã¸ã§ã³ã¯Vagrant 1.6.5ï¼ã
ããã§æºåã¯å®äºã§ãã
CodeIgniterã®ãã¦ã³ãã¼ã
http://www.codeigniter.com/downloadãããéçºä¸ã®CodeIgniter 3.xï¼CodeIgniter-develop.zip
ï¼ããã¦ã³ãã¼ããã¾ãã
ãªããCodeIgniter 3.xã¯MITã©ã¤ã»ã³ã¹ã«ãªãã¾ãããCodeIgniter 2.x以åã¯CodeIgniterã©ã¤ã»ã³ã¹ã®ã¾ã¾ã§ãã
Zipãã¡ã¤ã«ã解åããã¨CodeIgniter-develop
ãã©ã«ããä½æããã¾ãã
CodeIgniter-develop
âââ application
âââ system
âââ tests
âââ user_guide_src
vagrant-centos6-phpã®ãã¦ã³ãã¼ã
https://github.com/kenjis/vagrant-centos6-phpã®å³ã³ã©ã ã®ä¸çªä¸ã®ãDownload ZIPããã¿ã³ãæ¼ãã¦ãã¦ã³ãã¼ããã¾ãã
ãã¦ã³ãã¼ãããvagrant-centos6-php-master.zip
ã解åããCodeIgniterã®ãã©ã«ãï¼CodeIgniter-develop
ï¼ã®ä¸ã«ç§»åãã¾ãã
CodeIgniter-develop
âââ application
âââ system
âââ tests
âââ user_guide_src
âââ vagrant-centos6-php-master âãã
ä»®æ³ãã·ã³ã®ä½æ
CodeIgniterã使ããããã«vagrant-centos6-php-master
ãã©ã«ãã®ä¸ã®Vagrantfile
ã®è¨å®ãå¤æ´ãã¾ãããcodeigniterãã®è¡ã®å
é ã®ã³ã¡ã³ãè¨å·#
ãåé¤ãã¾ãã
# Framework of your choice
#chef.add_recipe "codeigniter"
â
# Framework of your choice
chef.add_recipe "codeigniter"
ããã§ã¯ãä»®æ³ãã·ã³ãæ§ç¯ãã¾ãã
$ cd CodeIgniter-develop/vagrant-centos6-php-master/
$ vagrant up
ååã¯CentOS6ã®ä»®æ³ã¤ã¡ã¼ã¸ããã¦ã³ãã¼ããªã©ããããããããªãæéããããã¾ãã®ã§æ°é·ã«å¾ ã¡ã¾ãã
ããã§ãä»®æ³ãã·ã³ãä½æãããéçºã«å¿ è¦ãªãµã¼ããªã©ãã¤ã³ã¹ãã¼ã«è¨å®ããã¾ãã
ãã£ã¬ã¯ããªæ§æ
ãã¹ãï¼æ許ã®PCï¼å´
CodeIgniter-develop/ï¼CodeIgniterããã¸ã§ã¯ãã®ãããï¼
âââ public/ï¼Webå
¬éé åï¼
âââ vagrant-centos6-php-master/
ã²ã¹ãï¼ä»®æ³ãã·ã³ï¼å´
/mnt/project/
âââ public/
âââ vagrant-centos6-php-master/
ä»®æ³ãã·ã³ããããã¹ãå´ã®CodeIgniter-develop
ãã©ã«ããå
±æãã¦ããã®ã§ããã¹ãå´ãã好ããªã¨ãã£ã¿ã§ã½ã¼ã¹ãå¤æ´ããã°ãä»®æ³ãã·ã³ã«èªåçã«åæ ããã¾ãã
ãã¼ã ãã£ã¬ã¯ããªã«ã·ã³ããªãã¯ãªã³ã¯ãå¼µã£ã¦ããã®ã§ãä»®æ³ãã·ã³ã®ä¸ã§ã¯/mnt/project
ãã©ã«ãã«ã¯~/codeigniter
ã§ã¢ã¯ã»ã¹ã§ãã¾ãã
CodeIgniter-develop
âââ application
â  âââ cache
â  âââ config
â  âââ controllers
â  âââ core
â  âââ helpers
â  âââ hooks
â  âââ language
â  âââ libraries
â  âââ logs
â  âââ models
â  âââ third_party
â  âââ views
âââ system
â  âââ core
â  âââ database
â  âââ fonts
â  âââ helpers
â  âââ language
â  âââ libraries
âââ tests
â  âââ codeigniter
â  âââ mocks
â  âââ travis
âââ user_guide_src
â  âââ cilexer
â  âââ source
âââ vagrant-centos6-php-master
âââ cookbooks
ãã¹ãOSããhttp://localhost:8000/ã«ã¢ã¯ã»ã¹ããã¨ãCodeIgniterã®ãWelcomeããã¼ã¸ã表示ããã¾ãã
CodeIgniteræ¬ä½ã®ãã¹ãã®å®è¡
CodeIgniteræ¬ä½ã®ãã¹ããå®è¡ãã¦ã¿ã¾ãããã
ã¾ããä»®æ³ãã·ã³ã«SSHã§ãã°ã¤ã³ãã¾ãã
$ cd CodeIgniter-develop/vagrant-centos6-php-master/
$ vagrant ssh
Last login: Tue Dec 2 01:21:42 2014 from 10.0.2.2
Welcome to your Vagrant-built virtual machine.
以ä¸ã¯ä»®æ³ãã·ã³ã®ä¸ã§ãã
ãã¹ãã«å¿ è¦ãªããã±ã¼ã¸ãComposerã§ã¤ã³ã¹ãã¼ã«ãã¾ãã
[vagrant@localhost ~]$ cd codeigniter/
[vagrant@localhost codeigniter]$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing mikey179/vfsstream (v1.1.0)
Downloading: 100%
Writing lock file
Generating autoload files
ãã¹ããå®è¡ãã¾ãã
[vagrant@localhost codeigniter]$ cd tests/
[vagrant@localhost tests]$ phpunit
PHPUnit 3.7.38 by Sebastian Bergmann.
Configuration read from /mnt/project/tests/phpunit.xml
.............................SS................................ 63 / 296 ( 21%)
....................SSSSSSSSSSSSSSS..SS.S...................... 126 / 296 ( 42%)
.S.S........................................................... 189 / 296 ( 63%)
........................................S...................... 252 / 296 ( 85%)
.............S............................
Time: 11.98 seconds, Memory: 17.25Mb
OK, but incomplete or skipped tests!
Tests: 284, Assertions: 991, Skipped: 24.
24åãã¹ãããããã¾ããããä»ã¯éãã¾ããã
ãµã¼ãç°å¢
vagrant-centos6-phpã§ä½æãããä»®æ³ãã·ã³ã®ãµã¼ãç°å¢ã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãã¾ãï¼å·çæç¹ï¼ã
- ã¡ã¢ãª 480MB
- HDD 200GB
- OS CentOS 6.5 (64bit)
- Apache 2.2.15-39.el6.centos.x86_64
- MySQL 5.1.73-3.el6_5.x86_64
- PHP 5.5.19-2.el6.remi.x86_64
- phpMyAdmin 4.0.10.6-1.el6.noarch
- PHPUnit 3.7.38
ãã¹ãå´ã®ãã¼ã8000ãä»®æ³ãã·ã³ã®ãã¼ã80ã«è»¢éãããããã«ãªã£ã¦ãã¾ããä»®æ³ãã·ã³ã«ç´æ¥ã¢ã¯ã»ã¹ããå ´åã¯ãhttp://192.168.33.33/ã«ã¢ã¯ã»ã¹ãã¾ãã
ãã¹ãã®CodeIgniterã®ããã¸ã§ã¯ãã®ãã©ã«ããä»®æ³ãã·ã³ã®/mnt/project
ã«ãã¦ã³ããããããã«ãªã£ã¦ãã¾ãã
MySQLãã¼ã¿ãã¼ã¹ã¯ãphp_dev
ã¨php_test
ãä½æããã¦ãããrootã®ãã¹ã¯ã¼ãã¯root
ã§ãã
ã¾ããhttp://localhost:8000/phpmyadmin/ãããphpMyAdminã«ã¢ã¯ã»ã¹ã§ãã¾ãã
ä»®æ³ãã·ã³ã®èµ·åã¨åæ¢
ä»®æ³ãã·ã³ã®åæ¢ã¯ãvagrant-centos6-php-master
ãã©ã«ãã«ç§»åãã¦ã
$ vagrant halt
ã¨ãã¾ããvagrant suspend
ã³ãã³ããå®è¡ããã°ãä»®æ³ãã·ã³ãã·ã£ãããã¦ã³ããã«ç¶æ
ãä¿åããã¾ã¾åæ¢ã§ãã¾ãã
ä»®æ³ãã·ã³ã®èµ·åã¯ã
$ vagrant up
ä»®æ³ãã·ã³ãç ´æ£ããã«ã¯ã
$ vagrant destroy
ã¨ãã¾ãã
é¢é£
- Vagrant CentOS6 PHP Development Environment
- Phalconã®éçºç°å¢ãvagrant-centos6-phpã使ãæ§ç¯ãã
- 2014å¹´ã®ææ°PHPãã¬ã¼ã ã¯ã¼ã¯ããã³ããã¼ã¯ãã¦ã¿ã
- CodeIgniter 3ã®ã©ã¤ã»ã³ã¹ãMITã©ã¤ã»ã³ã¹ã«å¤æ´ãããããããã©ã¤ã»ã³ã¹åé¡ã¯å®å ¨ã«è§£æ¶
Date: 2014/12/02