Пример #1
0
 /**
  * Performs all "ExpensiveCheck" methods. Note that this is usually
  * invoked in the Configuration check screen and therefore any
  * errors set here are "non-lethal", i.e. the application still works
  * although certain features may not function properly.
  */
 public static function performExpensive()
 {
     self::$opa_error_messages = array();
     self::$opo_db = new Db();
     self::$opo_config = ConfigurationCheck::$opo_db->getConfig();
     /* execute checks */
     $vo_reflection = new ReflectionClass("ConfigurationCheck");
     $va_methods = $vo_reflection->getMethods();
     foreach ($va_methods as $vo_method) {
         if (strpos($vo_method->name, "ExpensiveCheck") !== false) {
             if (!$vo_method->invoke("ConfigurationCheck")) {
                 // true means keep on doing checks; false means stop performing checks
                 return;
             }
         }
     }
 }
Пример #2
0
    /**
     * Returns number of currently loaded schema version
     */
    public static function getSchemaVersion()
    {
        if (!self::$opo_db) {
            self::$opo_db = new Db();
        }
        $qr_res = self::$opo_db->query('
			SELECT max(version_num) n
			FROM ca_schema_updates
		');
        if ($qr_res->nextRow()) {
            return $qr_res->get('n');
        }
        return null;
    }