SlideShare a Scribd company logo
CodeIgniter4
CodeIgniter4
CodeIgniter3
Tetsuro Yoshikawa
@iBotchME
1 / 57
!
CodeIgniter4 CodeIgniter3
CodeIgniter4
2 / 57
3 / 57
[ ] CodeIgniter 3 4
4 / 57
[ ] CodeIgniter 3 4
CodeIgniter3 CodeIgniter4
CI_Controller Config/Services
PHP5.2 (PHP5.4 )
CI3.1.x 5.3 5.5
PHP7
namespace namespace Class
5 / 57
[ ]
6 / 57
[ ]
CodeIgniter3 CodeIgniter4
_
)
getX null
isX boolean
etc...
|| && ! || && !
7 / 57
Directory
8 / 57
CI3
└──	
  application
	
  	
  	
  	
  ├──	
  cache
	
  	
  	
  	
  ├──	
  config
	
  	
  	
  	
  ├──	
  controllers
	
  	
  	
  	
  ├──	
  core
	
  	
  	
  	
  ├──	
  helpers
	
  	
  	
  	
  ├──	
  hooks
	
  	
  	
  	
  ├──	
  index.html
	
  	
  	
  	
  ├──	
  language
	
  	
  	
  	
  ├──	
  libraries
	
  	
  	
  	
  ├──	
  logs
	
  	
  	
  	
  ├──	
  migrations
	
  	
  	
  	
  ├──	
  models
	
  	
  	
  	
  ├──	
  third_party
	
  	
  	
  	
  └──	
  views
[ ] application Directory
9 / 57
CI3
└──	
  application
	
  	
  	
  	
  ├──	
  cache
	
  	
  	
  	
  ├──	
  config
	
  	
  	
  	
  ├──	
  controllers
	
  	
  	
  	
  ├──	
  core
	
  	
  	
  	
  ├──	
  helpers
	
  	
  	
  	
  ├──	
  hooks
	
  	
  	
  	
  ├──	
  index.html
	
  	
  	
  	
  ├──	
  language
	
  	
  	
  	
  ├──	
  libraries
	
  	
  	
  	
  ├──	
  logs
	
  	
  	
  	
  ├──	
  migrations
	
  	
  	
  	
  ├──	
  models
	
  	
  	
  	
  ├──	
  third_party
	
  	
  	
  	
  └──	
  views
CI4
└──	
  application
	
  	
  	
  	
  ├──	
  Config
	
  	
  	
  	
  ├──	
  Controllers
	
  	
  	
  	
  	
  ├──	
  Database
	
  	
  	
  	
  	
  ├──	
  Filters
	
  	
  	
  	
  ├──	
  Helpers
	
  	
  	
  	
  ├──	
  Language
	
  	
  	
  	
  ├──	
  Libraries
	
  	
  	
  	
  ├──	
  Models
	
  	
  	
  	
  └──	
  Views
[ ] application Directory
10 / 57
CI3
└──	
  system
	
  	
  	
  	
  ├──	
  core
	
  	
  	
  	
  ├──	
  database
	
  	
  	
  	
  ├──	
  fonts
	
  	
  	
  	
  ├──	
  helpers
	
  	
  	
  	
  ├──	
  language
	
  	
  	
  	
  └──	
  libraries
[ ] system Directory
11 / 57
CI3
└──	
  system
	
  	
  	
  	
  ├──	
  core
	
  	
  	
  	
  ├──	
  database
	
  	
  	
  	
  ├──	
  fonts
	
  	
  	
  	
  ├──	
  helpers
	
  	
  	
  	
  ├──	
  language
	
  	
  	
  	
  └──	
  libraries
CI4
├──	
  system
	
  	
  	
  	
  	
  ├──	
  Autoloader
	
  	
  	
  	
  	
  ├──	
  CLI
	
  	
  	
  	
  	
  ├──	
  Cache
	
  	
  	
  	
  	
  ├──	
  Commands
	
  	
  	
  	
  	
  ├──	
  Config
	
  	
  	
  	
  	
  ├──	
  Database
	
  	
  	
  	
  	
  ├──	
  Debug
	
  	
  	
  	
  	
  ├──	
  Filters
	
  	
  	
  	
  	
  ├──	
  HTTP
	
  	
  	
  	
  ├──	
  Helpers
	
  	
  	
  	
  ├──	
  Hooks
	
  	
  	
  	
  ├──	
  Language
	
  	
  	
  	
  ├──	
  Log
	
  	
  	
  	
  	
  ├──	
  Pager
	
  	
  	
  	
  	
  ├──	
  Router
	
  	
  	
  	
  	
  ├──	
  Security
	
  	
  	
  	
  ├──	
  Session
	
  	
  	
  	
  	
  ├──	
  Test
	
  	
  	
  	
  	
  ├──	
  ThirdParty
	
  	
  	
  	
  	
  └──	
  View
[ ] system Directory
12 / 57
[ ] CodeIgniter4 Directory
CI4
├──	
  public
│	
  	
  	
  ├──	
  favicon.ico
│	
  	
  	
  ├──	
  index.php
│	
  	
  	
  └──	
  robots.txt
└──	
  writable
	
  	
  	
  	
  ├──	
  cache
	
  	
  	
  	
  ├──	
  logs
	
  	
  	
  	
  	
  └──	
  uploads
13 / 57
Directory
Directory
writable
index.php
system core
14 / 57
[ ] CodeIgniter.php
index.php
15 / 57
[ ] index.php
16 / 57
[ ] index.php
CodeIgniter3 CodeIgniter4
1. APPPATH FCPATH 1. APPPATH FCPATH
2.
3.
4. Exception
2. CodeIgniter.php (require) 5. CodeIgniter class run
17 / 57
[ ] CodeIgniter.php
18 / 57
[ ] CodeIgniter.php
CodeIgniter3 CodeIgniter4
1. PHP
2. core 1. Request Response Cache
3. Router Controller method 2. Request class method
3. TryCatch
Exception 404
4. before Filter
4. Controller Routing 5. Controller Routing
6. after Filter
5. Output 7. Response
19 / 57
[ ] CodeIgniter.php index.php
AutoLoader
CodeIgniter.php
Controller
Exception 404
Filter
20 / 57
[ ] MVC
21 / 57
[ ] Controller
22 / 57
[ ] Controller::CodeIgniter3
<?php
class	
  Home	
  extends	
  CI_Controller
{
	
  	
  	
  	
  public	
  function	
  __construct()
	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  	
  	
  //	
  CI_Controller $this core/* 突 込
	
  	
  	
  	
  	
  	
  	
  	
  	
  parent::__construct();
	
  	
  	
  	
  	
  	
  	
  	
  //	
  神 入 Loader
	
  	
  	
  	
  	
  	
  	
  	
  	
  $this-­‐>load-­‐>model('hogehoge');
	
  	
  	
  	
  }
	
  	
  	
  	
  public	
  function	
  index()
	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  	
  	
  $data	
  =	
  $this-­‐>hogehoge-­‐>get_view_data();
	
  	
  	
  	
  	
  	
  	
  	
  	
  $this-­‐>load-­‐>view('hogehoge',	
  $data);
	
  	
  	
  	
  }
}
23 / 57
[ ] Controller::CodeIgniter4
<?php	
  namespace	
  AppControllers;
class	
  Home	
  extends	
  CodeIgniterController
{
	
  	
  	
  	
  public	
  function	
  index()
	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  new
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  $hogehoge_model	
  =	
  new	
  AppModelsHogehogeModel();
	
  	
  	
  	
  	
  	
  	
  	
  	
  //	
  使 使 別 ORM 実装
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  $data	
  =	
  $hogehoge_model-­‐>findWhere('is_active',	
  1);
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  return	
  view('Hogehoge',	
  $data);
	
  	
  	
  	
  }
}
24 / 57
[ ] Controller::CodeIgniter4
constructor injection
request RequestInterface
response ResponseInterface
logger LogLogger
25 / 57
[ ] Model
26 / 57
[ ] Model::CodeIgniter3
<?php
class	
  Hogehoge	
  extends	
  CI_Model
{
	
  	
  	
  	
  public	
  function	
  __construct()
	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  	
  //	
  magic	
  method $this-­‐>db
	
  	
  	
  	
  	
  	
  	
  //	
  CI 変数内 入 取
	
  	
  	
  	
  	
  	
  	
  	
  $this-­‐>load-­‐>model('hoge');
	
  	
  	
  	
  }
	
  	
  	
  	
  public	
  function	
  get_view_data()
	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  	
  //	
  QueryBuilder DB
	
  	
  	
  	
  	
  	
  	
  $this-­‐>db-­‐>where('is_active',	
  1);
	
  	
  	
  	
  	
  	
  	
  $query	
  =	
  $this-­‐>db-­‐>get('hogehoge',	
  3);
	
  	
  	
  	
  	
  	
  	
  return	
  $query-­‐>result();
	
  	
  	
  	
  }
}
27 / 57
[ ] Model::CodeIgniter4
<?php	
  namespace	
  AppModel;
class	
  HogehogeModel	
  extends	
  CodeIgniterModel
{
	
  	
  	
  	
  //	
  ORM対応
	
  	
  	
  	
  protected	
  $table	
  	
  	
  	
  	
  	
  	
  	
  	
  =	
  'hogehoge';
	
  	
  	
  	
  protected	
  $allowedFields	
  =	
  ['fuga',	
  'is_active'];
}
28 / 57
ORM
29 / 57
Model::CodeIgniter 4 ORM
<?php	
  namespace	
  AppModel;
class	
  HogehogeModel	
  extends	
  CodeIgniterModel
{
	
  	
  	
  	
  public	
  function	
  get_view_data()
	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  //	
  CodeIgniter3 QueryBuilder 書 事
	
  	
  	
  	
  	
  	
  	
  $query	
  =	
  $this-­‐>db-­‐>table('hogehoge')
	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐>where('is_active',	
  1)
	
  	
  	
  	
  	
  	
  	
  	
  	
  -­‐>get(3);
	
  	
  	
  	
  	
  	
  return	
  $query-­‐>getResult();
	
  	
  	
  	
  }
}
30 / 57
View
31 / 57
[ ] View::CodeIgniter3
<!DOCTYPE	
  html>
<html>
	
  	
  	
  	
  <head>
	
  	
  	
  	
  	
  	
  	
  	
  <title>Hogehgoe</title>
	
  	
  	
  	
  </head>
	
  	
  	
  	
  <body>
	
  	
  	
  	
  	
  	
  	
  	
  <!-­‐-­‐	
  CI_Controller 変数 参照渡 	
  -­‐-­‐>
	
  	
  	
  	
  	
  	
  	
  	
  <!-­‐-­‐	
  $this-­‐>db 呼 出 	
  -­‐-­‐>
	
  	
  	
  	
  	
  	
  	
  	
  	
  <?php	
  echo	
  $this-­‐>pagination-­‐>create_links();?>
	
  	
  	
  	
  </body>
</html>
32 / 57
[ ] View::CodeIgniter4
<!DOCTYPE	
  html>
<html>
	
  	
  	
  	
  <head>
	
  	
  	
  	
  	
  	
  	
  	
  <title>Hogehgoe</title>
	
  	
  	
  	
  </head>
	
  	
  	
  	
  <body>
	
  	
  	
  	
  	
  	
  	
  	
  <!-­‐-­‐	
  Controller pager 渡 	
  -­‐-­‐>
	
  	
  	
  	
  	
  	
  	
  	
  	
  <?=	
  $pager-­‐>links();?>
	
  	
  	
  	
  </body>
</html>
33 / 57
[ ]
$this new
ORM
ORM CI3 QueryBuilder
namespace
34 / 57
35 / 57
CodeIgniter4
Todo
36 / 57
[ ] Controller::Todo
<?php	
  namespace	
  AppControllers;
use	
  AppModels	
  as	
  Model;
class	
  Todo	
  extends	
  CodeIgniterController
{
	
  	
  //	
   設定
	
  	
  	
  protected	
  $helpers	
  =	
  ['url'];
	
  	
  public	
  function	
  index()
	
  	
  {
	
  	
  	
  	
  //	
   風 書
	
  	
  	
  	
  	
  //	
  helper('url');
	
  	
  	
  	
  //	
  session引数 空 Session 取
	
  	
  	
  	
  	
  session()-­‐>start();
	
  	
  	
  	
  $todo_use_orm_model	
  =	
  new	
  ModelTodoUseORMModel();
	
  	
  	
  	
  //	
  Model CodeIgniter3 pagination相当 引 付
	
  	
  	
  	
  $data	
  =	
  [
	
  	
  	
  	
  	
  	
  	
  'todo_data'	
  =>	
  $todo_use_orm_model-­‐>paginate(10),
	
  	
  	
  	
  	
  	
  	
  'pager'	
  	
  	
  	
  	
  =>	
  $todo_use_orm_model-­‐>pager
	
  	
  	
  	
  ];
	
  	
  	
  	
  return	
  view('todo',	
  $data);
	
  	
  }
	
  	
  	
  	
  ...
37 / 57
[ ] Controller::Todo On/Off
...
	
  	
  public	
  function	
  dead_or_live(string	
  $id	
  =	
  null)
	
  	
  {
	
  	
  	
  	
  if	
  ($this-­‐>request-­‐>getMethod()	
  !==	
  'post')
	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  //	
  404NotFound用Exception
	
  	
  	
  	
  	
  	
  	
  throw	
  new	
  CodeIgniterPageNotFoundException();
	
  	
  	
  	
  }
	
  	
  	
  	
  $todo_use_orm_model	
  =	
  new	
  ModelTodoUseORMModel();
	
  	
  	
  	
  	
  $active	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  =	
  (bool)$this-­‐>request-­‐>getPost('deleted');
	
  	
  	
  	
  //	
  ORM!!!ORM!!!
	
  	
  	
  	
  	
  $todo_use_orm_model-­‐>update($id,	
  ['deleted'	
  =>	
  $active]);
	
  	
  	
  	
  //	
  RedirectHeader 設定 Exception 発行
	
  	
  	
  	
  	
  $this-­‐>response-­‐>redirect('http://192.168.33.40/todo/index');
	
  	
  }
...
38 / 57
[ ] Controller::Todo /
...
	
  	
  public	
  function	
  save()
	
  	
  {
	
  	
  	
  	
  if	
  ($this-­‐>request-­‐>getMethod()	
  !==	
  'post')
	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  throw	
  new	
  CodeIgniterPageNotFoundException();
	
  	
  	
  	
  }
	
  	
  	
  	
  $todo_use_orm_model	
  =	
  new	
  ModelTodoUseORMModel();
	
  	
  	
  	
  //	
  
	
  	
  	
  	
  	
  $todo_model	
  	
  	
  	
  	
  	
  	
  	
  	
  =	
  new	
  ModelTodoModel($todo_use_orm_model);
	
  	
  	
  	
  $save_data	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  =	
  $this-­‐>request-­‐>getPost(['todo',	
  'id']);
	
  	
  	
  	
  $todo_model-­‐>doSave($save_data);
	
  	
  	
  	
  $this-­‐>response-­‐>redirect('http://192.168.33.40/todo/index');
	
  	
  }
...
39 / 57
[ ] TodoUseORMModel::ORM
<?php	
  namespace	
  AppModels;
//	
  CI_Model	
  =>	
  CodeIgniterModel
class	
  TodoUseORMModel	
  extends	
  CodeIgniterModel
{
	
  	
  //	
  table名
	
  	
  	
  protected	
  $table	
  =	
  'todo';
	
  	
  //	
  編集可能 名
	
  	
  	
  protected	
  $allowedFields	
  =	
  ['deleted',	
  'todo'];
	
  	
  ...
40 / 57
[ ] Model ORM
primaryKey string id PrimaryKey
returnType string array (array|object)
useSoftDeletes boolean false
Delete
true deleted )
useTimestamps boolean false
dateFormat string datetime
createField string created_at
updatedField string updated_at
41 / 57
[ ] TodoUseORMModel::
//	
  UseORM ORM find 使 実装
	
  	
  public	
  function	
  exists($id)
	
  	
  {
	
  	
  	
  	
  //	
  $this-­‐>db-­‐>table builderObject取得
	
  	
  	
  	
  	
  $builder	
  =	
  $this-­‐>db-­‐>table($this-­‐>table);
	
  	
  	
  	
  $builder-­‐>where('id',	
  $id);
	
  	
  	
  	
  $query	
  =	
  $builder-­‐>get(1);
	
  	
  	
  	
  return	
  (	
  isset($query)	
  &&	
  !	
  empty($query-­‐>getRow())	
  );
	
  	
  }
42 / 57
[ ] TodoModel::
<?php	
  namespace	
  AppModels;
use	
  AppLibrariesValidation;
class	
  TodoModel
{
	
  	
  private	
  $validator;
	
  	
  private	
  $session;
	
  	
  private	
  $dao;
	
  	
  //	
  Autoloader CodeIgniterModel 継承
	
  	
  //	
   化
	
  	
  	
  public	
  function	
  __construct(TodoUseORMModel	
  $use_orm)
	
  	
  {
	
  	
  	
  	
  $this-­‐>use_orm	
  	
  	
  =	
  $use_orm;
	
  	
  	
  	
  $this-­‐>session	
  	
  	
  =	
  session();
	
  	
  	
  	
  //	
  資料作成時 実装 Validation 自作
	
  	
  	
  	
  $this-­‐>validator	
  =	
  ValidationFactory::make([],	
  [
	
  	
  	
  	
  	
  	
  ['id'	
  	
  	
  =>	
  ['is_natural',	
  'min[1]',	
  [$use_orm,	
  'exists']]],
	
  	
  	
  	
  	
  	
  ['todo'	
  =>	
  'required|lenmax[100]']
	
  	
  	
  	
  ],	
  ['todo'	
  =>	
  '項目']);
	
  	
  }
...
43 / 57
[ ] TodoModel::
	
  	
  public	
  function	
  doSave($input)
	
  	
  {
	
  	
  	
  	
  $this-­‐>validator-­‐>resetValue($input);
	
  	
  	
  	
  $this-­‐>session-­‐>start();
	
  	
  	
  	
  if	
  (	
  !	
  $this-­‐>validator-­‐>run()	
  )
	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  $error_msg	
  =	
  $this-­‐>validator-­‐>getErrorMessage();
	
  	
  	
  	
  	
  	
  	
  $this-­‐>session-­‐>setFlashdata('error_msg',	
  $error_msg);
	
  	
  	
  	
  	
  	
  return	
  false;
	
  	
  	
  	
  }
	
  	
  	
  	
  if	
  (	
  empty($input['id']))	
  	
  unset($input['id']);
	
  	
  	
  	
  //	
  ORM allowedFields 空 場合 protect 解除
	
  	
  	
  	
  	
  //	
  $this-­‐>use_orm-­‐>protect(false);
	
  	
  	
  	
  if	
  (	
  !	
  $this-­‐>use_orm-­‐>save($input)	
  )
	
  	
  	
  	
  {
	
  	
  	
  	
  	
  	
  $this-­‐>session-­‐>setFlashdata('error_msg',	
  'Todo 更新 失敗 ');
	
  	
  	
  	
  	
  	
  return	
  false;
	
  	
  	
  	
  }
	
  	
  	
  	
  $this-­‐>session-­‐>setFlashdata('success_msg',	
  'Todo 更新 成功 ');
	
  	
  	
  	
  return	
  true;
	
  	
  }
...
44 / 57
[ ] View::Session
<?php	
  //	
  第一引数 string 入 良 session 楽?>
<?php	
  if	
  (session('success_msg')):?>
	
  	
  <div	
  class="success_msg">
	
  	
  	
  	
  <?=	
  session('success_msg');?>
	
  	
  </div>
<?php	
  endif;?>
<?php	
  if	
  (session('error_msg')):?>
	
  	
  <div	
  class="error_msg">
	
  	
  	
  	
  <?=	
  session('error_msg');?>
	
  	
  </div>
<?php	
  endif;?>
45 / 57
[ ] View::ServiceLocater
<form	
  action="http://192.168.33.40/todo/save"	
  method="POST">
	
  	
  <input	
  type="hidden"	
  name="id"	
  value="">
	
  	
  <input	
  type="text"	
  name="todo"	
  value="">
	
  	
  <?php	
  //	
  ServiceLocater security 取得 ?>
	
  	
  <input	
  type="hidden"	
  
	
  	
  	
  	
  	
  name="<?=	
  service('security')-­‐>getCSRFTokenName();?>"	
  
	
  	
  	
  	
  value="<?=	
  service('security')-­‐>getCSRFHash();?>">
	
  	
  <input	
  type="submit"	
  value="Todo!!">
</form>
46 / 57
[ ] Controller Filter
...
	
  	
  //	
  Filter
	
  	
  public	
  $aliases	
  =	
  [
	
  	
  	
  	
  'csrf'	
  	
  	
  	
  =>	
  AppFiltersCSRF::class,
	
  	
  	
  	
  'toolbar'	
  =>	
  AppFiltersDebugToolbar::class,
	
  	
  ];
	
  	
  public	
  $globals	
  =	
  [
	
  	
  	
  	
  //	
  csrf 書 alias csrf 動作
	
  	
  	
  	
  	
  'before'	
  =>	
  ['csrf'],
	
  	
  	
  	
  'after'	
  	
  =>	
  ['toolbar']
	
  	
  ];
...
Controller CSRF Filter
47 / 57
[ ] Controller Filter
	
  	
  //	
   分 事
	
  	
  public	
  $methods	
  =	
  [
	
  	
  	
  	
  	
  'post'	
  =>	
  ['csrf']
	
  	
  ];
	
  	
  //特定 以下 設定 事 可能
	
  	
  public	
  $filters	
  =	
  [
	
  	
  	
  	
  	
  'csrf'	
  =>	
  ['before'	
  =>	
  ['todo/*']]
	
  	
  ];
	
  	
  ...
Filter
48 / 57
[ ] ::Model
<?php	
  namespace	
  AppModels;
class	
  TodoUseORMModelTest	
  extends	
  CIDatabaseTestCase
{
	
  	
  protected	
  $refresh	
  =	
  true;
	
  	
  protected	
  $seed	
  =	
  'TestTodoUseORMSeeder';
	
  	
  public	
  function	
  setUp()
	
  	
  {
	
  	
  	
  	
  parent::setUp();
	
  	
  	
  	
  //	
  CodeIgniterModel 第一引数 DB
	
  	
  	
  	
  //	
  第二引数 BaseConfig 入 構造
	
  	
  	
  	
  //	
  DatabaseTestCase DB 突 込
	
  	
  	
  	
  	
  $this-­‐>todo_use_orm_model	
  =	
  new	
  TodoUseORMModel($this-­‐>db);
	
  	
  }
	
  	
  public	
  function	
  testTodo 入 ()
	
  	
  {
	
  	
  	
  	
  $this-­‐>assertTrue($this-­‐>todo_use_orm_model-­‐>exists('1'));
	
  	
  }
...
49 / 57
[ ] ::Library
<?php	
  namespace	
  AppLibrariesValidation;
class	
  RulesRunnerTest	
  extends	
  CIUnitTestCase{
	
  	
  /**
	
  	
  	
  *	
  @dataProvider	
  runnerProvider
	
  	
  	
  **/
	
  	
  	
  public	
  function	
  test 正 実行 (
	
  	
  	
  	
  	
  $class_method,	
  
	
  	
  	
  	
  	
  $value,	
  
	
  	
  	
  	
  	
  $expected)
	
  	
  	
  {
	
  	
  	
  	
  	
  //	
  AutoLoader 自作Libarary new
	
  	
  	
  	
  	
  	
  $rules_runner	
  =	
  new	
  RulesRunner();
	
  	
  	
  	
  	
  $run_result	
  	
  	
  =	
  $rules_runner-­‐>run($class_method,	
  $value);
	
  	
  	
  	
  	
  $this-­‐>assertEquals($expected,	
  $run_result);
	
  	
  	
  }
...
50 / 57
[ ]
AutoLoader
Test
51 / 57
[ ]
AutoLoader
Test
52 / 57
[ ]
AutoLoader
Test
ValidationLibrary
( )
site_url
CodeIngniter
53 / 57
54 / 57
CodeIgniter4 CodeIgniter3
CodeIgniter4
CI PR
55 / 57
CodeIgniter4 PR
github GPG
$	
  git	
  commit	
  -­‐s
https://bcit-ci.github.io/CodeIgniter4/contributing/signing.html
56 / 57
Comming soon 2017/04
57 / 57

More Related Content

What's hot

Python 3.9からの新定番zoneinfoを使いこなそう
Python 3.9からの新定番zoneinfoを使いこなそうPython 3.9からの新定番zoneinfoを使いこなそう
Python 3.9からの新定番zoneinfoを使いこなそう
Ryuji Tsutsui
 
ネットストーカー御用達OSINTツールBlackBirdを触ってみた.pptx
ネットストーカー御用達OSINTツールBlackBirdを触ってみた.pptxネットストーカー御用達OSINTツールBlackBirdを触ってみた.pptx
ネットストーカー御用達OSINTツールBlackBirdを触ってみた.pptx
Shota Shinogi
 
さくらのクラウドDNS経由でワイルドカード証明書を後からインストールしたcertbotで取得する方法
さくらのクラウドDNS経由でワイルドカード証明書を後からインストールしたcertbotで取得する方法さくらのクラウドDNS経由でワイルドカード証明書を後からインストールしたcertbotで取得する方法
さくらのクラウドDNS経由でワイルドカード証明書を後からインストールしたcertbotで取得する方法
良季 高橋
 
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
onozaty
 
MogileFS をバックエンドとしたPrivate S3の作り方 【後半】API 編
MogileFS をバックエンドとしたPrivate S3の作り方 【後半】API 編MogileFS をバックエンドとしたPrivate S3の作り方 【後半】API 編
MogileFS をバックエンドとしたPrivate S3の作り方 【後半】API 編
hiboma
 
Samba4を「ふつうに」使おう!(2015/08/08 OSC 2015 Kansai@Kyoto)
Samba4を「ふつうに」使おう!(2015/08/08 OSC 2015 Kansai@Kyoto)Samba4を「ふつうに」使おう!(2015/08/08 OSC 2015 Kansai@Kyoto)
Samba4を「ふつうに」使おう!(2015/08/08 OSC 2015 Kansai@Kyoto)
基信 高橋
 
PostgreSQLクエリ実行の基礎知識 ~Explainを読み解こう~
PostgreSQLクエリ実行の基礎知識 ~Explainを読み解こう~PostgreSQLクエリ実行の基礎知識 ~Explainを読み解こう~
PostgreSQLクエリ実行の基礎知識 ~Explainを読み解こう~
Miki Shimogai
 
Docker Compose 徹底解説
Docker Compose 徹底解説Docker Compose 徹底解説
Docker Compose 徹底解説
Masahito Zembutsu
 
技術ブログを書こう
技術ブログを書こう技術ブログを書こう
技術ブログを書こう
akira6592
 
世界一わかりやすいClean Architecture
世界一わかりやすいClean Architecture世界一わかりやすいClean Architecture
世界一わかりやすいClean Architecture
Atsushi Nakamura
 
Marp Tutorial
Marp TutorialMarp Tutorial
Marp Tutorial
Rui Watanabe
 
Javaで学ぶネットワークプログラミングの基礎
Javaで学ぶネットワークプログラミングの基礎Javaで学ぶネットワークプログラミングの基礎
Javaで学ぶネットワークプログラミングの基礎
なべ
 
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応まで
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応までDocker Compose入門~今日から始めるComposeの初歩からswarm mode対応まで
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応まで
Masahito Zembutsu
 
自作かな漢字変換「Genji」をつくったよ
自作かな漢字変換「Genji」をつくったよ自作かな漢字変換「Genji」をつくったよ
自作かな漢字変換「Genji」をつくったよ
Masahiko Hashimoto
 
Clojureの世界と実際のWeb開発
Clojureの世界と実際のWeb開発Clojureの世界と実際のWeb開発
Clojureの世界と実際のWeb開発
Tsutomu Yano
 
オブジェクト指向の皮をかぶった関数型プログラミング言語 Haxe
オブジェクト指向の皮をかぶった関数型プログラミング言語 Haxeオブジェクト指向の皮をかぶった関数型プログラミング言語 Haxe
オブジェクト指向の皮をかぶった関数型プログラミング言語 Haxe
terurou
 
PHPでマルチスレッド
PHPでマルチスレッドPHPでマルチスレッド
PHPでマルチスレッド
karky7
 
Dockerfileを改善するためのBest Practice 2019年版
Dockerfileを改善するためのBest Practice 2019年版Dockerfileを改善するためのBest Practice 2019年版
Dockerfileを改善するためのBest Practice 2019年版
Masahito Zembutsu
 
オブジェクト指向できていますか?
オブジェクト指向できていますか?オブジェクト指向できていますか?
オブジェクト指向できていますか?Moriharu Ohzu
 
90分 Scheme to C(勝手に抄訳版)
90分 Scheme to C(勝手に抄訳版)90分 Scheme to C(勝手に抄訳版)
90分 Scheme to C(勝手に抄訳版)
ryos36
 

What's hot (20)

Python 3.9からの新定番zoneinfoを使いこなそう
Python 3.9からの新定番zoneinfoを使いこなそうPython 3.9からの新定番zoneinfoを使いこなそう
Python 3.9からの新定番zoneinfoを使いこなそう
 
ネットストーカー御用達OSINTツールBlackBirdを触ってみた.pptx
ネットストーカー御用達OSINTツールBlackBirdを触ってみた.pptxネットストーカー御用達OSINTツールBlackBirdを触ってみた.pptx
ネットストーカー御用達OSINTツールBlackBirdを触ってみた.pptx
 
さくらのクラウドDNS経由でワイルドカード証明書を後からインストールしたcertbotで取得する方法
さくらのクラウドDNS経由でワイルドカード証明書を後からインストールしたcertbotで取得する方法さくらのクラウドDNS経由でワイルドカード証明書を後からインストールしたcertbotで取得する方法
さくらのクラウドDNS経由でワイルドカード証明書を後からインストールしたcertbotで取得する方法
 
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
 
MogileFS をバックエンドとしたPrivate S3の作り方 【後半】API 編
MogileFS をバックエンドとしたPrivate S3の作り方 【後半】API 編MogileFS をバックエンドとしたPrivate S3の作り方 【後半】API 編
MogileFS をバックエンドとしたPrivate S3の作り方 【後半】API 編
 
Samba4を「ふつうに」使おう!(2015/08/08 OSC 2015 Kansai@Kyoto)
Samba4を「ふつうに」使おう!(2015/08/08 OSC 2015 Kansai@Kyoto)Samba4を「ふつうに」使おう!(2015/08/08 OSC 2015 Kansai@Kyoto)
Samba4を「ふつうに」使おう!(2015/08/08 OSC 2015 Kansai@Kyoto)
 
PostgreSQLクエリ実行の基礎知識 ~Explainを読み解こう~
PostgreSQLクエリ実行の基礎知識 ~Explainを読み解こう~PostgreSQLクエリ実行の基礎知識 ~Explainを読み解こう~
PostgreSQLクエリ実行の基礎知識 ~Explainを読み解こう~
 
Docker Compose 徹底解説
Docker Compose 徹底解説Docker Compose 徹底解説
Docker Compose 徹底解説
 
技術ブログを書こう
技術ブログを書こう技術ブログを書こう
技術ブログを書こう
 
世界一わかりやすいClean Architecture
世界一わかりやすいClean Architecture世界一わかりやすいClean Architecture
世界一わかりやすいClean Architecture
 
Marp Tutorial
Marp TutorialMarp Tutorial
Marp Tutorial
 
Javaで学ぶネットワークプログラミングの基礎
Javaで学ぶネットワークプログラミングの基礎Javaで学ぶネットワークプログラミングの基礎
Javaで学ぶネットワークプログラミングの基礎
 
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応まで
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応までDocker Compose入門~今日から始めるComposeの初歩からswarm mode対応まで
Docker Compose入門~今日から始めるComposeの初歩からswarm mode対応まで
 
自作かな漢字変換「Genji」をつくったよ
自作かな漢字変換「Genji」をつくったよ自作かな漢字変換「Genji」をつくったよ
自作かな漢字変換「Genji」をつくったよ
 
Clojureの世界と実際のWeb開発
Clojureの世界と実際のWeb開発Clojureの世界と実際のWeb開発
Clojureの世界と実際のWeb開発
 
オブジェクト指向の皮をかぶった関数型プログラミング言語 Haxe
オブジェクト指向の皮をかぶった関数型プログラミング言語 Haxeオブジェクト指向の皮をかぶった関数型プログラミング言語 Haxe
オブジェクト指向の皮をかぶった関数型プログラミング言語 Haxe
 
PHPでマルチスレッド
PHPでマルチスレッドPHPでマルチスレッド
PHPでマルチスレッド
 
Dockerfileを改善するためのBest Practice 2019年版
Dockerfileを改善するためのBest Practice 2019年版Dockerfileを改善するためのBest Practice 2019年版
Dockerfileを改善するためのBest Practice 2019年版
 
オブジェクト指向できていますか?
オブジェクト指向できていますか?オブジェクト指向できていますか?
オブジェクト指向できていますか?
 
90分 Scheme to C(勝手に抄訳版)
90分 Scheme to C(勝手に抄訳版)90分 Scheme to C(勝手に抄訳版)
90分 Scheme to C(勝手に抄訳版)
 

Similar to Codeigniter4の比較と検証

[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
GangSeok Lee
 
Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24Naoya Nakazawa
 
TYPO3 Scheduler
TYPO3 SchedulerTYPO3 Scheduler
TYPO3 Scheduler
Krystian Szymukowicz
 
Introduction to CodeIgniter
Introduction to CodeIgniterIntroduction to CodeIgniter
Introduction to CodeIgniter
Piti Suwannakom
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
YoungHeon (Roy) Kim
 
Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)
남균 김
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207patter
 
The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5
Wim Godden
 
Introduction to Codeigniter
Introduction to Codeigniter Introduction to Codeigniter
Introduction to Codeigniter
Zero Huang
 
An introduction to PHP 5.4
An introduction to PHP 5.4An introduction to PHP 5.4
An introduction to PHP 5.4
Giovanni Derks
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
Bo-Yi Wu
 
監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜
Michitoshi Yoshida
 
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
Ian Barber
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Phpfunkatron
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
Lukas Smith
 
Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & Tools
Ian Barber
 
Hyperledger 구조 분석
Hyperledger 구조 분석Hyperledger 구조 분석
Hyperledger 구조 분석
Jongseok Choi
 
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the bfinalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
ChereCheek752
 
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটিWordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
Faysal Shahi
 
Benefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBenefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBo-Yi Wu
 

Similar to Codeigniter4の比較と検証 (20)

[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
[2009 CodeEngn Conference 03] koheung - 윈도우 커널 악성코드에 대한 분석 및 방법
 
Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24Study2study#4 nginx conf_1_24
Study2study#4 nginx conf_1_24
 
TYPO3 Scheduler
TYPO3 SchedulerTYPO3 Scheduler
TYPO3 Scheduler
 
Introduction to CodeIgniter
Introduction to CodeIgniterIntroduction to CodeIgniter
Introduction to CodeIgniter
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
 
The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5
 
Introduction to Codeigniter
Introduction to Codeigniter Introduction to Codeigniter
Introduction to Codeigniter
 
An introduction to PHP 5.4
An introduction to PHP 5.4An introduction to PHP 5.4
An introduction to PHP 5.4
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜
 
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
Symfony2 - from the trenches
Symfony2 - from the trenchesSymfony2 - from the trenches
Symfony2 - from the trenches
 
Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & Tools
 
Hyperledger 구조 분석
Hyperledger 구조 분석Hyperledger 구조 분석
Hyperledger 구조 분석
 
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the bfinalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
 
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটিWordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
 
Benefit of CodeIgniter php framework
Benefit of CodeIgniter php frameworkBenefit of CodeIgniter php framework
Benefit of CodeIgniter php framework
 

Recently uploaded

CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
FluxPrime1
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 

Recently uploaded (20)

CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
DESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docxDESIGN A COTTON SEED SEPARATION MACHINE.docx
DESIGN A COTTON SEED SEPARATION MACHINE.docx
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 

Codeigniter4の比較と検証

  • 4. [ ] CodeIgniter 3 4 4 / 57
  • 5. [ ] CodeIgniter 3 4 CodeIgniter3 CodeIgniter4 CI_Controller Config/Services PHP5.2 (PHP5.4 ) CI3.1.x 5.3 5.5 PHP7 namespace namespace Class 5 / 57
  • 6. [ ] 6 / 57
  • 7. [ ] CodeIgniter3 CodeIgniter4 _ ) getX null isX boolean etc... || && ! || && ! 7 / 57
  • 9. CI3 └──  application        ├──  cache        ├──  config        ├──  controllers        ├──  core        ├──  helpers        ├──  hooks        ├──  index.html        ├──  language        ├──  libraries        ├──  logs        ├──  migrations        ├──  models        ├──  third_party        └──  views [ ] application Directory 9 / 57
  • 10. CI3 └──  application        ├──  cache        ├──  config        ├──  controllers        ├──  core        ├──  helpers        ├──  hooks        ├──  index.html        ├──  language        ├──  libraries        ├──  logs        ├──  migrations        ├──  models        ├──  third_party        └──  views CI4 └──  application        ├──  Config        ├──  Controllers          ├──  Database          ├──  Filters        ├──  Helpers        ├──  Language        ├──  Libraries        ├──  Models        └──  Views [ ] application Directory 10 / 57
  • 11. CI3 └──  system        ├──  core        ├──  database        ├──  fonts        ├──  helpers        ├──  language        └──  libraries [ ] system Directory 11 / 57
  • 12. CI3 └──  system        ├──  core        ├──  database        ├──  fonts        ├──  helpers        ├──  language        └──  libraries CI4 ├──  system          ├──  Autoloader          ├──  CLI          ├──  Cache          ├──  Commands          ├──  Config          ├──  Database          ├──  Debug          ├──  Filters          ├──  HTTP        ├──  Helpers        ├──  Hooks        ├──  Language        ├──  Log          ├──  Pager          ├──  Router          ├──  Security        ├──  Session          ├──  Test          ├──  ThirdParty          └──  View [ ] system Directory 12 / 57
  • 13. [ ] CodeIgniter4 Directory CI4 ├──  public │      ├──  favicon.ico │      ├──  index.php │      └──  robots.txt └──  writable        ├──  cache        ├──  logs          └──  uploads 13 / 57
  • 17. [ ] index.php CodeIgniter3 CodeIgniter4 1. APPPATH FCPATH 1. APPPATH FCPATH 2. 3. 4. Exception 2. CodeIgniter.php (require) 5. CodeIgniter class run 17 / 57
  • 19. [ ] CodeIgniter.php CodeIgniter3 CodeIgniter4 1. PHP 2. core 1. Request Response Cache 3. Router Controller method 2. Request class method 3. TryCatch Exception 404 4. before Filter 4. Controller Routing 5. Controller Routing 6. after Filter 5. Output 7. Response 19 / 57
  • 20. [ ] CodeIgniter.php index.php AutoLoader CodeIgniter.php Controller Exception 404 Filter 20 / 57
  • 21. [ ] MVC 21 / 57
  • 23. [ ] Controller::CodeIgniter3 <?php class  Home  extends  CI_Controller {        public  function  __construct()        {                //  CI_Controller $this core/* 突 込                  parent::__construct();                //  神 入 Loader                  $this-­‐>load-­‐>model('hogehoge');        }        public  function  index()        {                $data  =  $this-­‐>hogehoge-­‐>get_view_data();                  $this-­‐>load-­‐>view('hogehoge',  $data);        } } 23 / 57
  • 24. [ ] Controller::CodeIgniter4 <?php  namespace  AppControllers; class  Home  extends  CodeIgniterController {        public  function  index()        {                  //  new                    $hogehoge_model  =  new  AppModelsHogehogeModel();                  //  使 使 別 ORM 実装                    $data  =  $hogehoge_model-­‐>findWhere('is_active',  1);                    return  view('Hogehoge',  $data);        } } 24 / 57
  • 25. [ ] Controller::CodeIgniter4 constructor injection request RequestInterface response ResponseInterface logger LogLogger 25 / 57
  • 26. [ ] Model 26 / 57
  • 27. [ ] Model::CodeIgniter3 <?php class  Hogehoge  extends  CI_Model {        public  function  __construct()        {              //  magic  method $this-­‐>db              //  CI 変数内 入 取                $this-­‐>load-­‐>model('hoge');        }        public  function  get_view_data()        {              //  QueryBuilder DB              $this-­‐>db-­‐>where('is_active',  1);              $query  =  $this-­‐>db-­‐>get('hogehoge',  3);              return  $query-­‐>result();        } } 27 / 57
  • 28. [ ] Model::CodeIgniter4 <?php  namespace  AppModel; class  HogehogeModel  extends  CodeIgniterModel {        //  ORM対応        protected  $table                  =  'hogehoge';        protected  $allowedFields  =  ['fuga',  'is_active']; } 28 / 57
  • 30. Model::CodeIgniter 4 ORM <?php  namespace  AppModel; class  HogehogeModel  extends  CodeIgniterModel {        public  function  get_view_data()        {            //  CodeIgniter3 QueryBuilder 書 事              $query  =  $this-­‐>db-­‐>table('hogehoge')                  -­‐>where('is_active',  1)                  -­‐>get(3);            return  $query-­‐>getResult();        } } 30 / 57
  • 32. [ ] View::CodeIgniter3 <!DOCTYPE  html> <html>        <head>                <title>Hogehgoe</title>        </head>        <body>                <!-­‐-­‐  CI_Controller 変数 参照渡  -­‐-­‐>                <!-­‐-­‐  $this-­‐>db 呼 出  -­‐-­‐>                  <?php  echo  $this-­‐>pagination-­‐>create_links();?>        </body> </html> 32 / 57
  • 33. [ ] View::CodeIgniter4 <!DOCTYPE  html> <html>        <head>                <title>Hogehgoe</title>        </head>        <body>                <!-­‐-­‐  Controller pager 渡  -­‐-­‐>                  <?=  $pager-­‐>links();?>        </body> </html> 33 / 57
  • 34. [ ] $this new ORM ORM CI3 QueryBuilder namespace 34 / 57
  • 37. [ ] Controller::Todo <?php  namespace  AppControllers; use  AppModels  as  Model; class  Todo  extends  CodeIgniterController {    //   設定      protected  $helpers  =  ['url'];    public  function  index()    {        //   風 書          //  helper('url');        //  session引数 空 Session 取          session()-­‐>start();        $todo_use_orm_model  =  new  ModelTodoUseORMModel();        //  Model CodeIgniter3 pagination相当 引 付        $data  =  [              'todo_data'  =>  $todo_use_orm_model-­‐>paginate(10),              'pager'          =>  $todo_use_orm_model-­‐>pager        ];        return  view('todo',  $data);    }        ... 37 / 57
  • 38. [ ] Controller::Todo On/Off ...    public  function  dead_or_live(string  $id  =  null)    {        if  ($this-­‐>request-­‐>getMethod()  !==  'post')        {            //  404NotFound用Exception              throw  new  CodeIgniterPageNotFoundException();        }        $todo_use_orm_model  =  new  ModelTodoUseORMModel();          $active                          =  (bool)$this-­‐>request-­‐>getPost('deleted');        //  ORM!!!ORM!!!          $todo_use_orm_model-­‐>update($id,  ['deleted'  =>  $active]);        //  RedirectHeader 設定 Exception 発行          $this-­‐>response-­‐>redirect('http://192.168.33.40/todo/index');    } ... 38 / 57
  • 39. [ ] Controller::Todo / ...    public  function  save()    {        if  ($this-­‐>request-­‐>getMethod()  !==  'post')        {            throw  new  CodeIgniterPageNotFoundException();        }        $todo_use_orm_model  =  new  ModelTodoUseORMModel();        //            $todo_model                  =  new  ModelTodoModel($todo_use_orm_model);        $save_data                    =  $this-­‐>request-­‐>getPost(['todo',  'id']);        $todo_model-­‐>doSave($save_data);        $this-­‐>response-­‐>redirect('http://192.168.33.40/todo/index');    } ... 39 / 57
  • 40. [ ] TodoUseORMModel::ORM <?php  namespace  AppModels; //  CI_Model  =>  CodeIgniterModel class  TodoUseORMModel  extends  CodeIgniterModel {    //  table名      protected  $table  =  'todo';    //  編集可能 名      protected  $allowedFields  =  ['deleted',  'todo'];    ... 40 / 57
  • 41. [ ] Model ORM primaryKey string id PrimaryKey returnType string array (array|object) useSoftDeletes boolean false Delete true deleted ) useTimestamps boolean false dateFormat string datetime createField string created_at updatedField string updated_at 41 / 57
  • 42. [ ] TodoUseORMModel:: //  UseORM ORM find 使 実装    public  function  exists($id)    {        //  $this-­‐>db-­‐>table builderObject取得          $builder  =  $this-­‐>db-­‐>table($this-­‐>table);        $builder-­‐>where('id',  $id);        $query  =  $builder-­‐>get(1);        return  (  isset($query)  &&  !  empty($query-­‐>getRow())  );    } 42 / 57
  • 43. [ ] TodoModel:: <?php  namespace  AppModels; use  AppLibrariesValidation; class  TodoModel {    private  $validator;    private  $session;    private  $dao;    //  Autoloader CodeIgniterModel 継承    //   化      public  function  __construct(TodoUseORMModel  $use_orm)    {        $this-­‐>use_orm      =  $use_orm;        $this-­‐>session      =  session();        //  資料作成時 実装 Validation 自作        $this-­‐>validator  =  ValidationFactory::make([],  [            ['id'      =>  ['is_natural',  'min[1]',  [$use_orm,  'exists']]],            ['todo'  =>  'required|lenmax[100]']        ],  ['todo'  =>  '項目']);    } ... 43 / 57
  • 44. [ ] TodoModel::    public  function  doSave($input)    {        $this-­‐>validator-­‐>resetValue($input);        $this-­‐>session-­‐>start();        if  (  !  $this-­‐>validator-­‐>run()  )        {            $error_msg  =  $this-­‐>validator-­‐>getErrorMessage();              $this-­‐>session-­‐>setFlashdata('error_msg',  $error_msg);            return  false;        }        if  (  empty($input['id']))    unset($input['id']);        //  ORM allowedFields 空 場合 protect 解除          //  $this-­‐>use_orm-­‐>protect(false);        if  (  !  $this-­‐>use_orm-­‐>save($input)  )        {            $this-­‐>session-­‐>setFlashdata('error_msg',  'Todo 更新 失敗 ');            return  false;        }        $this-­‐>session-­‐>setFlashdata('success_msg',  'Todo 更新 成功 ');        return  true;    } ... 44 / 57
  • 45. [ ] View::Session <?php  //  第一引数 string 入 良 session 楽?> <?php  if  (session('success_msg')):?>    <div  class="success_msg">        <?=  session('success_msg');?>    </div> <?php  endif;?> <?php  if  (session('error_msg')):?>    <div  class="error_msg">        <?=  session('error_msg');?>    </div> <?php  endif;?> 45 / 57
  • 46. [ ] View::ServiceLocater <form  action="http://192.168.33.40/todo/save"  method="POST">    <input  type="hidden"  name="id"  value="">    <input  type="text"  name="todo"  value="">    <?php  //  ServiceLocater security 取得 ?>    <input  type="hidden"            name="<?=  service('security')-­‐>getCSRFTokenName();?>"          value="<?=  service('security')-­‐>getCSRFHash();?>">    <input  type="submit"  value="Todo!!"> </form> 46 / 57
  • 47. [ ] Controller Filter ...    //  Filter    public  $aliases  =  [        'csrf'        =>  AppFiltersCSRF::class,        'toolbar'  =>  AppFiltersDebugToolbar::class,    ];    public  $globals  =  [        //  csrf 書 alias csrf 動作          'before'  =>  ['csrf'],        'after'    =>  ['toolbar']    ]; ... Controller CSRF Filter 47 / 57
  • 48. [ ] Controller Filter    //   分 事    public  $methods  =  [          'post'  =>  ['csrf']    ];    //特定 以下 設定 事 可能    public  $filters  =  [          'csrf'  =>  ['before'  =>  ['todo/*']]    ];    ... Filter 48 / 57
  • 49. [ ] ::Model <?php  namespace  AppModels; class  TodoUseORMModelTest  extends  CIDatabaseTestCase {    protected  $refresh  =  true;    protected  $seed  =  'TestTodoUseORMSeeder';    public  function  setUp()    {        parent::setUp();        //  CodeIgniterModel 第一引数 DB        //  第二引数 BaseConfig 入 構造        //  DatabaseTestCase DB 突 込          $this-­‐>todo_use_orm_model  =  new  TodoUseORMModel($this-­‐>db);    }    public  function  testTodo 入 ()    {        $this-­‐>assertTrue($this-­‐>todo_use_orm_model-­‐>exists('1'));    } ... 49 / 57
  • 50. [ ] ::Library <?php  namespace  AppLibrariesValidation; class  RulesRunnerTest  extends  CIUnitTestCase{    /**      *  @dataProvider  runnerProvider      **/      public  function  test 正 実行 (          $class_method,            $value,            $expected)      {          //  AutoLoader 自作Libarary new            $rules_runner  =  new  RulesRunner();          $run_result      =  $rules_runner-­‐>run($class_method,  $value);          $this-­‐>assertEquals($expected,  $run_result);      } ... 50 / 57
  • 56. CodeIgniter4 PR github GPG $  git  commit  -­‐s https://bcit-ci.github.io/CodeIgniter4/contributing/signing.html 56 / 57