note 97551 modified in function.apc-define-constants by danbrown

From: Date: Mon, 26 Apr 2010 14:36:42 +0000
Subject: note 97551 modified in function.apc-define-constants by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-168659@lists.php.net to get a copy of this message
An observation that I've made is that the nature of apc_define_constants() binding the list of constants to a key and then requiring that key to load the constants is limiting. Furthermore, there's no way to append additional constants to a given key. A solution that I've been adopting is to build a list of constants to be defined, and then do one of two things: 1) if APC is enabled, then use apc_define_constants(); 2) ...else loop through the list and define each constant normally. The problem I've run into is when this process happens at different places in a large application, it can introduce overhead that otherwise wouldn't be there if it was possible to append to an existing list of defined constants in APC. --was-- A second observation that I've made is that the nature of apc_define_constants() binding the list of constants to a key and then requiring that key to load the constants is limiting. Furthermore, there's no way to append additional constants to a given key. A solution that I've been adopting is to build a list of constants to be defined, and then do one of two things: 1) if APC is enabled, then use apc_define_constants(); 2) ...else loop through the list and define each constant normally. The problem I've run into is when this process happens at different places in a large application, it can introduce overhead that otherwise wouldn't be there if it was possible to append to an existing list of defined constants in APC. http://php.net/manual/en/function.apc-define-constants.php

« previous php.notes (#168659) next »