downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

apc_sma_info> <apc_inc
Last updated: Fri, 20 May 2011

view this page in

apc_load_constants

(PECL apc >= 3.0.0)

apc_load_constants Carga un conjunto de constantes de la caché

Descripción

bool apc_load_constants ( string $key [, bool $case_sensitive = true ] )

Carga un conjunto de constantes de la caché.

Parámetros

key

El nombre del conjunto de constantes (que fue almacenado con apc_define_constants()) que se va a recuperar.

case_sensitive

El comportamiento predeterminado para las constantes es ser declaradas sensibles a mayúsculas-minúsculas; es decir, CONSTANTE y Constante representan valores diferentes. Si este parámetro es FALSE las constantes serán declaradas como símbolos insensibles a mayúsculas-minúsculas.

Valores devueltos

Devuelve TRUE en caso de éxito o FALSE en caso de error.

Ejemplos

Example #1 Ejemplo de apc_load_constants()

<?php
$constantes 
= array(
    
'UNO'   => 1,
    
'DOS'   => 2,
    
'TRES' => 3,
);
apc_define_constants('números'$constantes);
apc_load_constants('números');
echo 
UNODOSTRES;
?>

El resultado del ejemplo sería:

123

Ver también



add a note add a note User Contributed Notes apc_load_constants
webmaster at thedigitalorchard dot ca 26-Apr-2010 12:41
There doesn't seem to be a way to store constants that have already been defined. This function, apc_define_constants(), does both things: (1) defines a constant, and (2) stores the constant in the cache. This is unfortunate, since it introduces the requirement to handle constant definitions differently when APC is not available.

(If this function had a "$do_not_define" parameter, or the like, that would give it more flexibility. I suppose filing a bug report would be a step in the right direction to getting this idea considered.)

 
show source | credits | stats | sitemap | contact | advertising | mirror sites