Blog

If you run the function, the class will init

Calling from the depths of hollywood, I think it’s safe to say not everyone wants random ghostlike baseball players on their farm. As an example of this, I think we should start implementing some sort of class shift from inclusion by default into inclusion via need.

So, instead of the entire site loading up PodAPI and all other classes on every page load, I believe using the following will provide the best solution long-term.

So running $api = new PodAPI(); or $pods = new Pod(‘podname’); would actually map to a function which includes the real class object itself. This would be for backwards-compatibility, in which future use would be through $api = pods_api(); and $pods = pods(‘pod_name’);

Make sense? Throw rocks if you don’t like this idea, but if you throw rocks I’ll make sure it snows more in the north east with my fancy weather producing satellite.