相关疑难解决方法(0)

APC值随机消失

我正在使用APC将类名映射存储到类文件路径.我在自动加载功能中构建这样的地图:

$class_paths = apc_fetch('class_paths');

// If the class path is stored in application cache - search finished.

if (isset($class_paths[$class])) {
    return require_once $class_paths[$class];

// Otherwise search in known places

} else {

    // List of places to look for class

    $paths = array(
        '/src/',
        '/modules/',
        '/libs/',
    );

    // Search directories and store path in cache if found.

    foreach ($paths as $path) {
        $file = DOC_ROOT . $path . $class . '.php';
        if (file_exists($file)) {
            echo 'File was found in => …
Run Code Online (Sandbox Code Playgroud)

php apc

1
推荐指数
1
解决办法
3152
查看次数

标签 统计

apc ×1

php ×1