PHP Velho Oeste 2024

apc_load_constants

(PECL apc >= 3.0.0)

apc_load_constants Önbellekten bir sabit kümesini yükler

Açıklama

apc_load_constants ( string $anahtar [, bool $buyukluk_duyarli = true ] ) : bool

Önbellekten bir dizi sabiti yükler.

Değiştirgeler

anahtar

Sabitleri yığın halinde apc_define_constants() ile önbelleğe saklarken verilmiş isim.

buyukluk_duyarli

İşlevin öntanımlı davranışı harf büyüklüğüne duyarlıdır, yani SABIT ile Sabit farklı değerlerdir. Eğer bu değiştirge FALSE olarak ayarlanırsa sabitler harf büyüklüğüne duyarsız sembollerle tanımlanacaktır.

Dönen Değerler

Başarı durumunda TRUE, başarısızlık durumunda FALSE döner.

Örnekler

Örnek 1 - apc_load_constants() örneği

<?php
$sabitler 
= array(
    
'BIR'   => 1,
    
'IKI'   => 2,
    
'UC' => 3,
);
apc_define_constants('sayilar'$sabitler);
apc_load_constants('sayilar');
echo 
BIRIKIUC;
?>

Yukarıdaki örneğin çıktısı:

123

Ayrıca Bakınız

add a note add a note

User Contributed Notes 1 note

up
2
webmaster at thedigitalorchard dot ca
14 years ago
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.)
To Top