Conversation
|
|
||
| function get_gyms($swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0) | ||
| { | ||
| if (!is_null($adapter)) { |
There was a problem hiding this comment.
What does this exactly do? looks like if theres no value its gona return the following stated, but what is it exactly?
Thanks man
There was a problem hiding this comment.
$adapter is NULL when not running my fork.
It contains MonkeyFork object when running monkey fork.
Check out line 8 in raw_data.php 👆
There was a problem hiding this comment.
Ya on line 8 you defined get_gyms to be your class MonkeyFork, i understand now that what you did there is an alternative to not run your fork interesting, but if u have multiple forks how would you apply it? since we know theres more forks there.
There was a problem hiding this comment.
I don't care about the rest.
As far as $adapter is concerned, it runs from adapter if it exists, else, it runs from the rest of the code.
Notice the return on line 707. If there is $adapter, it runs get_gyms from $adapter and exit the function. Otherwise, it continues as usual to process other forks.
There was a problem hiding this comment.
ahhh, so if no $adapter = other code for the rest of forks works, i see. Smart thats what i was missing :P
There was a problem hiding this comment.
This way, I don't need to break anything in this raw_data file. No touching on messy parts as well.
| function get_gyms($swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0) | ||
| { | ||
| if (!is_null($adapter)) { | ||
| return $adapter->get_gyms($swLat, $swLng, $neLat, $neLng, $tstamp, $oSwLat, $oSwLng, $oNeLat, $oNeLng); |
There was a problem hiding this comment.
When $adapter is defined, you can use it to get_gyms from adapter. Notice that, there is no monkey around here.
I generalized the concept of forks.
No description provided.