Cakephpstudy5 hacks jp

Embed Size (px)

DESCRIPTION

 

Text of Cakephpstudy5 hacks jp

  • 1. 5 CakePHP @Tokyo ON 2010/5/29( )
  • 2.
    • http://bit.ly/cakestudy_hiromi
  • 3. About me
    • : Shimizu Hiroki
    • @hiromi2424
    • CakePHP
      • TransitionComponent
      • /
  • 4.
    • Hacks
      • CakeRoute
      • Engines
  • 5.
  • 6.
  • 7.
  • 8.
    • ( )
  • 9.
    • ( )
  • 10.
  • 11.
    • App/libs/*
    • Core App
    Dirty Hack
  • 12.
    • Static Classes
    • Basic functions
    Use Lithium
  • 13. Hacks
  • 14. Hack components
  • 15. Components - ACL
    • Configure::write('Acl.classname, MyAcl)
    • MyAclComponent extends AclBase
  • 16. Components - Others
    • Component::_loaded[$key]
      • Initialize()
  • 17. Components - Others
    • Component class flow
    init() initialize() startup() Starting Process
  • 18. Components - Others
    • var $components = (Session, Auth, Security);
    NO Auth initialized Undefined $loaded[Security] YES NO Session initialized NO NO Security initialized Undefined $loaded[Auth] $loaded[Session] Auth::initialize() Auth::__construct()
  • 19. Components - Others
    • $Component->enabled = boolean
    • SessionComponent::__construct($base)
    AliasComponent
  • 20. Hack helpers
  • 21. Helpers
    • $view::loaded[$key]
      • beforeRender()
    • View::_loadHelpers()
    AliasHelper
  • 22. Hacks Models
  • 23. Models
    • ClassRegistry::init()
    • alias option
    • Example
      • ClassRegistry::init(array( class => MockPost, alias => Post, ))
    • Initialization timing
      • Before Controller::constructClasses
  • 24. Hacks CakeRoute
  • 25. CakeRoute
    • From 1.3
    • (Plugin | App)/libs/routes/my_route.php
    • App::import(Lib, routes/MyRoute)
    • Router::connect(, , array(routeClass => MyRoute))
    • class MyRoute extends CakeRoute
      • parse()
      • match()
      • ETC
  • 26. CakeRoute
    • parse()
      • URL
  • 27. CakeRoute
    • match()
      • URL
      • URL
  • 28. CakeRoute
    • Example
      • Mark Story
  • 29. Engines
  • 30. Cache
    • (Plugin | App)/libs/cache/my_cache.php
    • Cache::config(default, array(engine => MyCache))
    • class MyCache extends CacheEngine
      • write()
      • read()
      • delete()
  • 31. CakeLog
    • From 1.3
    • (Plugin | App)/libs/log/my_logger.php
    • CakeLog::config(my, array(engine => MyCache))
    • class MyLogger
      • write()
    • Example
      • if($type == error)
  • 32.
    • CakePHP
    • CakePHP2.0