FuelPHPでSentry FuelPHP勉強会 東京 vol.3        fagai
Profile• ファガイ@fagai• 21歳• ニコ生主。(co443753)• 無職→株式会社サムザップ• PHP,HTML5,CSS3,JavaScript
Sentry知ってます?
Sentry  - 認証パッケージ-https://github.com/cartalyst/sentry
Sentryの利点複数フレームワークに対応(Laravel4,FuelPHP1.x,CodeIgniter3.x)フレームワークなしでも動くマニュアルが英語でも分かりやすい!SimpleAuthより多機能(仮登録➡認証も出来る)
ユーザ処理系通常登録(create)仮登録(register)➡認証(activate)機能パスワードリセット機能(reset password)機能制限(parmission)
導入    導入にはComposerが必要    ComposerはFuelPHP1.6から標準対応らしいfuel/app内にて wget http://getcomposer.org/composer.phar
fuel/app/Composer.json{        “require”: {             “cartalyst/sentry”: “2.0.*”,             “illuminate/database”: “4...
install php composer.phar installfuel/app/bootstrap.php Autoloader::register(); require APPPATH. ‘vendor/autoload.php’; cl...
install php composer.phar installfuel/app/bootstrap.php Autoloader::register(); require APPPATH. ‘vendor/autoload.php’; cl...
migration - 1users migration    php oil g migration create_users email:varchar[255]    password:varchar[255] permissions:t...
migration - 2groups migration    php oil g migration create_groups name:varchar[255] permissions:text    created_at:timest...
migration - 3,4throttle migration  php oil g migration create_throttle user_id:int:unsigned attempts:int  suspended:tinyin...
導入終了 - 参考・Github cartalyst/Sentryhttp://github.com/cartalyst/sentry・新人Webエンジニアの記録。http://blog.fagai.net
ご清聴ありがとうございました
Upcoming SlideShare
Loading in …5
×

FuelPHPでSentry導入

3,309 views

Published on

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,309
On SlideShare
0
From Embeds
0
Number of Embeds
66
Actions
Shares
0
Downloads
7
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

FuelPHPでSentry導入

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

×