* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with the APF. If not, see http://www.gnu.org/licenses/lgpl-3.0.txt. * --> */ namespace APF\core\singleton; use APF\core\pagecontroller\APFObject; use Exception; use ReflectionClass; // ID#178: use closure functions instead of [] to avoid issued with PHP 5.4.x register_shutdown_function(function () { ApplicationSingleton::saveObjects(); }); /** * Implements the generic application singleton pattern. Can be used to create singleton objects from * every class. This eases unit tests, because explicit singleton implementations cause side * effects during unit testing. * <p/> * Application singleton objects remain valid throughout multiple requests and sessions and only loose * their validity when the web server is restarted. * <p/> * Usage: * <pre>$instance = ApplicationSingleton::getInstance('VENDOR\..\Class');</pre> * * @author Christian Achatz * @version * Version 0.1, 17.07.2013<br />