Submit Search
FuelPHPでSentry導入
•
3 likes
•
3,535 views
F
fagai
Follow
1 of 15
Download now
Download to read offline
More Related Content
FuelPHPでSentry導入
1.
FuelPHPでSentry FuelPHP勉強会 東京
vol.3 fagai
2.
Profile • ファガイ@fagai • 21歳 •
ニコ生主。(co443753) • 無職→株式会社サムザップ • PHP,HTML5,CSS3,JavaScript
3.
Sentry 知ってます?
4.
Sentry -
認証パッケージ- https://github.com/cartalyst/sentry
5.
Sentryの利点 複数フレームワークに対応 (Laravel4,FuelPHP1.x,CodeIgniter3.x) フレームワークなしでも動く マニュアルが英語でも分かりやすい! SimpleAuthより多機能(仮登録➡認証も出来る)
6.
ユーザ処理系 通常登録(create) 仮登録(register)➡認証(activate)機能 パスワードリセット機能(reset password) 機能制限(parmission)
7.
導入
導入にはComposerが必要 ComposerはFuelPHP1.6から標準対応らしい fuel/app内にて wget http://getcomposer.org/composer.phar
8.
fuel/app/Composer.json {
“require”: { “cartalyst/sentry”: “2.0.*”, “illuminate/database”: “4.0.*”, “ircmaxell/password-compat”: “1.0.*” }, “minimum-stability”: “dev” }
9.
install php composer.phar
install fuel/app/bootstrap.php Autoloader::register(); require APPPATH. ‘vendor/autoload.php’; class_alias(‘CartalystSentryFacadesFuelPHPSentry’, ‘Sentry’);
10.
install php composer.phar
install fuel/app/bootstrap.php Autoloader::register(); require APPPATH. ‘vendor/autoload.php’; class_alias(‘CartalystSentryFacadesFuelPHPSentry’, ‘Sentry’);
11.
migration - 1 users
migration php oil g migration create_users email:varchar[255] password:varchar[255] permissions:text activated:tinyint[4]:default[0] activation_code:varchar[255]:default[null] persist_code:varchar[255]:default[null] reset_password_code:varchar[255]:default[null] first_name:varchar[255] last_name:varchar[255] created_at:timestamp updated_at:timestamp fuel/app/migrations/001_create_users.php public function up() { ! DBUtil::create_table('users', array(省略), array('id')); DBUtil::create_index('users', 'email', 'users_email_unique', 'UNIQUE'); }
12.
migration - 2 groups
migration php oil g migration create_groups name:varchar[255] permissions:text created_at:timestamp updated_at:timestamp fuel/app/migrations/002_create_groups.php public function up() { ! DBUtil::create_table('groups', array(省略), array('id')); DBUtil::create_index('groups', 'name', 'groups_name_unique', 'UNIQUE'); }
13.
migration - 3,4 throttle
migration php oil g migration create_throttle user_id:int:unsigned attempts:int suspended:tinyint[4] banned:tinyint[4] last_attempt_at:timestamp suspended_at:timestamp –no-timestamp users_groups migration php oil g migration create_users_groups user_id:int:unsigned group_id:int:unsigned –no-timestamp php oil refine migrate
14.
導入終了 - 参考 ・Github
cartalyst/Sentry http://github.com/cartalyst/sentry ・新人Webエンジニアの記録。 http://blog.fagai.net
15.
ご清聴ありがとうございました
Download