Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 254... Línea 254...
254
    }
254
    }
255
}
255
}
Línea 256... Línea 256...
256
 
256
 
257
// sometimes default PHP settings are borked on shared hosting servers, I wonder why they have to do that??
257
// sometimes default PHP settings are borked on shared hosting servers, I wonder why they have to do that??
258
ini_set('precision', 14); // needed for upgrades and gradebook
258
ini_set('precision', 14); // needed for upgrades and gradebook
Línea 259... Línea 259...
259
ini_set('serialize_precision', 17); // Make float serialization consistent on all systems.
259
ini_set('serialize_precision', -1); // Make float serialization consistent on all systems.
260
 
260
 
261
// Scripts may request no debug and error messages in output
261
// Scripts may request no debug and error messages in output
262
// please note it must be defined before including the config.php script
262
// please note it must be defined before including the config.php script
Línea 678... Línea 678...
678
    }
678
    }
679
    unset($dbhash);
679
    unset($dbhash);
680
}
680
}
Línea 681... Línea 681...
681
 
681
 
682
// Load any immutable bootstrap config from local cache.
682
// Load any immutable bootstrap config from local cache.
-
 
683
$bootstraplocalfile = $CFG->localcachedir . '/bootstrap.php';
-
 
684
$bootstrapsharedfile = $CFG->cachedir . '/bootstrap.php';
-
 
685
 
-
 
686
if (!is_readable($bootstraplocalfile) && is_readable($bootstrapsharedfile)) {
-
 
687
    // If we don't have a local cache but do have a shared cache then clone it,
-
 
688
    // for example when scaling up new front ends.
-
 
689
    make_localcache_directory('', true);
-
 
690
    copy($bootstrapsharedfile, $bootstraplocalfile);
683
$bootstrapcachefile = $CFG->localcachedir . '/bootstrap.php';
691
}
684
if (is_readable($bootstrapcachefile)) {
692
if (is_readable($bootstraplocalfile)) {
685
    try {
693
    try {
686
        require_once($bootstrapcachefile);
694
        require_once($bootstraplocalfile);
687
        // Verify the file is not stale.
695
        // Verify the file is not stale.
688
        if (!isset($CFG->bootstraphash) || $CFG->bootstraphash !== hash_local_config_cache()) {
696
        if (!isset($CFG->bootstraphash) || $CFG->bootstraphash !== hash_local_config_cache()) {
689
            // Something has changed, the bootstrap.php file is stale.
697
            // Something has changed, the bootstrap.php file is stale.
690
            unset($CFG->siteidentifier);
698
            unset($CFG->siteidentifier);
-
 
699
            @unlink($bootstraplocalfile);
691
            @unlink($bootstrapcachefile);
700
            @unlink($bootstrapsharedfile);
692
        }
701
        }
693
    } catch (Throwable $e) {
702
    } catch (Throwable $e) {
694
        // If it is corrupted then attempt to delete it and it will be rebuilt.
703
        // If it is corrupted then attempt to delete it and it will be rebuilt.
-
 
704
        @unlink($bootstraplocalfile);
695
        @unlink($bootstrapcachefile);
705
        @unlink($bootstrapsharedfile);
696
    }
706
    }
Línea 697... Línea 707...
697
}
707
}
698
 
708