PHPフレームワークを

俯瞰してみた

PHPカンファレンス 関西 2015

たきぐち(@atakig)

@atakig たきぐち

  • PHPカンファレンス関西 2015 スタッフ
  • 某エンタープライズなインターネット企業で主にPHPのエンジニア
  • PhpStorm、Emacs、Atom
  • CLIなツール
  • 筆記用具は万年筆
  • バイクはtriumph streettriple 85
  • WordCamp関西 2015 スタッフ

7/25(土), 26(日)

大阪大学豊中キャンパス 大阪大学会館

アジェンダ

  1. フレームワークに至る歴史
  2. 今時のフレームワークの動向とその所感

フラットファイル

Adminer (formerly phpMinAdmin) is a full-featured database management tool written in PHP.

  • ビジネスロジックとhtmlが混ざる
  • 可読性がない
  • デザイナさんと分業できない
  • プログラマ同士で分業できない
  • 1つのミスで全てが真っ白

NG

  • ファイルの管理
  • 調査の手間

GOOD

おれおれ

フレームワーク

特定の組織や

限られた人達のみで使われている

フレームワーク

PHPerの数だけ、

フレームワークがある

どのフレームワークを使ってもしっくりこない

  • 非標準的なやり方が標準になってしまう
  • 作った人の世界から出られない

NG

  • 作った人しか使い方が分らない
  • 人によって使い方が違う

NG

NG

日々、技術的負債を積み重ねていないか

必要な機能は

大抵揃っている

GOOD

学習コストが低い

GOOD

特定のパターンでは、素晴しい生産性を発揮する

GOOD

メジャーな

フレームワーク

  • マイクロフレームワーク
  • フルスタックフレームワーク

マイクロフレームワーク

  • Silex
  • slim
  • CodeIgniter

フルスタックフレームワーク

  • Laravel
  • CakePHP
  • Symfony
  • Yii
  • Phalcon
  • FuelPHP

???

  • ZendFramework
  • Aura
  • BEAR.Sunday

??????

最近の動向

CakePHP 3 リリース

2015-3-22

A New ORM

  • Faster and More Flexible Routing
  • Improved Migrations
  • Better Internationalization
  • Improved Debugging Toolbar
  • Composer Usage
  • Standalone libraries
  • View Cells

Laravel 5 リリース

2014-2-4

  • The old app/models directory has been entirely removed
  • Controllers, middleware, and requests are now grouped under the app/Http directory
  • A new app/Providers directory replaces the app/start files from previous versions of Laravel 4.x

New Folder Structure

  • Contracts
  • Route Cache
  • Route Middleware
  • Controller Method Injection
  • Authentication Scaffolding
  • Event Objects
  • Commands / Queueing
  • Database Queue
  • Laravel Scheduler
  • Tinker / Psysh
  • DotEnv
  • Laravel Elixir
  • Laravel Socialite
  • Flysystem Integration
  • Form Requests
  • Simple Controller Request Validation
  • New Generators
  • Configuration Cache
  • Symfony VarDumper

Phalcon 2 リリース

2015-4-18

  • We had to create a brand new language Zephir which allows developers to write PHP extensions easily.
  • We had to completely rewrite most of Phalcon 1.3.x, offering the same functionality as before so as to ensure that upgrading will be very easy.
  • Zephir had to be adjusted and enhanced as we moved through the rewrite, offering more functions and options to developers.
  • Additional features were implemented for 2.0, mostly thanks to our contributors!

Zephir

Zephir

Welcome to Zephir, an open source, high-level/domain specific language designed to ease the creation and maintainability of extensions for PHP with a focus on type and memory safety.

Ze(nd Engine) Ph(p) I(nt)r(mediate)

型とメモリの安全性にフォーカスした、PHPの拡張を作成する際のメンテ性を解消するために作成されたオープンソースで、ハイレベルなDSLです

Zephir

Zephir was not created to replace PHP or C, instead of this, we think it is a complement to them, allowing developers to venture into code compilation and static typing. Zephir is precisely an attempt to join good things from the C and PHP worlds, looking for opportunities to make their applications faster.

ZephirはPHPやCを置き替えるために作られたのではありません。そうではなく、それらを補完して、開発者にコードのコンパイルと静的な型付けにチャレンジできるようにするためです

Zephirはまさに、CとPHPの世界の良いところを結合する試みです。

開発者のアプリケーションをより速くするチャンスを探しているのです

  • Full rewrite of most components in Zephir
  • Added Phalcon\Mvc\Micro::error for better handling of exceptions
  • Phalcon\Forms\Form::label does not share attributes with the ones that belong to the element
  • Added parameter 'params' to set default conditions when retrieving related records
  • Added filters "int!" and "float!" that cast values to the respective type
  • Filter "alphanum" now uses a regular expression instead of internal functions for better behaviour in 64bits
  • Added 'allowEmpty' option in Phalcon\Validation validators to skip validation if the value is empty
  • Added Phalcon\Validation::setDefaultMessages to set default values in validators - Added Phalcon\Validation\Validator\Numericality
  • Added events in Phalcon\Di: beforeServiceResolve / afterServiceResolve
  • Mysql database introspector now uses DATABASE() as default schema
  • Added option to disable cache keys in Cache\Backend\Memcache
  • Mvc\View component is now disabled automatically when redirecting using Http\Response
  • Mvc\Model::dynamicUpdate now works better as it compares if every field has changed according to its data type
  • Added Db\Adapter\Pdo::getErrorInfo() to obtain the last error generated in a PDO connection

Yii 2 リリース

2014-10-12

  • Adopting Standards and Latest Technologies
  • Solid Foundation Classes
  • Development Tools
  • Security
  • Databases
  • RESTful APIs
  • Caching
  • Forms
  • Authentication and Authorization
  • Widgets
  • Helpers
  • Internationalization
  • Template Engines
  • Testing
  • Application Templates
  • Extensions

Symfony 3

2015-11

What is Symfony 3.0?

  • Symfony 3.0 is more standard (usage of PSR-3 for logging and ...)
  • Symfony 3.0 fixes some architecture mistakes ...

  • Symfony 3.0 is more decoupled and more reusable than ever ...

Symfony 3.0 is not going to be a revolution and the low-level architecture of the framework won't change

Zend Framework 3

2015 Q3

  • Separating components into individual, versioned projects. This enables broader re-use and higher velocity of innovation.
  • Strong emphasis on HTTP messages, with Matthew leading the PSR-7 specification.
  • Updating our existing full-stack MVC framework to depend on the newly independent components for better reuse and simplicity. ZF2 MVC applications will have a documented upgrade path to ZF3 requiring minimal changes.
  • Embracing middleware runtime patterns as a lighter weight alternative to the enterprise MVC framework stack.
  • Enabling Apigility to work as a middleware stack, for better performance and simplicity, with the same streamlined, powerful user experience.
  • Optimizing for PHP 7, but supporting PHP 5.5 onwards.

FuelPHP 2 Alpha 1リリース

2015-1-1

FuelPHP 2 リリース

this comming summer

  • Folder structure reordering
  • Adoption of Composer/Packagist and PSR-0 & PSR-1
  • Terminology
  • Facade classes
  • Context
  • Language
  • Configuration
  • Input
  • Context inheritance
  • Facades and context
  • Dependency Injection, extensions, Inversion of Control
  • ViewModel becomes Presenter
  • Query Builder
  • ORM
  • Migrations
  • Oil reimplemented as an Application with Tasks as specialized Controllers

BEAR.Sunday

1.0.0-rc5 リリース

2015-4-30

  • Resource Orientated Framework
  • Injected Dependency Framework
  • Aspect Wrapped Framework
  • Has no components of its own. Choose from the best.
  • Everything is a resource. The API is core, REST is central.
  • Decouple everything. Code your intention, then bind the implementation.
  • Very Fast. A DRY Runtime boosts performance.
  • Very Testable. Because everything is injected.
  • standardが当り前に(yii,fuel,symfony)
  • ライブラリの独立性(cake,symfony,zend)
  • デバッグ情報の豊富さ(cake,laravel,yii)
  • View独自ロジックの実装方法(cake,fuel)

最近の動向より

Yii2

CakePHP3

Laravel

Phalcon

Symfony

13:00-

13:45-

14:30-

14:30-

15:15-

フレームワーク関係セッションのご案内

805(ココ)

805(ココ)

805(ココ)

803

805(ココ)

ご清聴ありがとうございました

一日楽しんでいってください

Made with Slides.com