[Core] object method executions after instantiation from the locator

Review Request #386 — Created Sept. 21, 2015 and submitted

tardypad
Lunr
tardypad:locator_instantiation_method
lunr
Core: object method executions after instantiation from the locator
unit tests
  • 0
  • 0
  • 2
  • 0
  • 2
Description From Last Updated
tardypad
Pol
  1. 
      
  2. src/Lunr/Core/ConfigServiceLocator.php (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
    I don't understand.. why do you want to be able to execute methods when the object is created?
    1. To be able to execute setup functions on the object before it's returned by the locator. Like this you can for example get a read-only db connection, by executing ->set_readonly(TRUE) in the locator.
  3. 
      
pprkut
  1. 
      
  2. src/Lunr/Core/ConfigServiceLocator.php (Diff revision 2)
     
     
     
     
     
     
     
    I don't like the amounts of issets we're now getting. Might be better to do this a bit earlier when we load the config file, to enter a standardized format into the cache. Not a big deal to keep as is, but could use some optimization.
  3. src/Lunr/Core/ConfigServiceLocator.php (Diff revision 2)
     
     
    you don't really need this line
  4. 
      
tardypad
pprkut
  1. Ship It!
  2. 
      
tardypad
Review request changed

Status: Closed (submitted)

Change Summary:

Merged into master
Loading...