Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Implement TestSwarmContext (issue #127) #131
Krinkle merged 5 commits into jquery:master from unknown repository
Mar 22, 2012
Commits on Mar 21, 2012
- This reduces the number of global variables to basically 2 (config and context). There are still some code paths relying on very generic globals from one file to another (such as "$username", "$user_id" etc. from init-usersession.php). and the existing uses of mysql_queryf and $swarmBrowser/$swarmRequest. - Context makes dependency resolving a lot easier, no longer depending on order of php includes. Instead things are created on-demand (context->getBD() will create the Database object when needed). - Might also speed up some JSON responses since objects that aren't needed, won't be created. - Adapting existing classes to get their info from the context instead. I did this without keeping backwards compatibility. These classes were developed only a few days ago, so changed them as if they were created like this from the beginning. * BrowserInfo: - Removed caching from BrowserInfo, became to complicated and not really needed. so far it is only used once for the current user agent, and in the event we do create it for other user agents, the gain in caching them in case we come across the exact same user agent twice within the same request and slim. If that does become an issue we can optimize for that when we actually do that. - Removed redundant findSwarmUAFromBI method
Commits on Mar 22, 2012
- All instances of $swarmBrowser replaced, global removed. - All instances of $swarmConfig replaced, global removed. - All instances of $swarmDB replaced, global removed. - All instances of $swarmRequest replaced, global removed.