Browse Source

Move config/dbstructure.php to config/dbstructure.config.php

pull/6199/head
Hypolite Petovan 3 years ago
parent
commit
6eb6cc94c7
  1. 0
      config/dbstructure.config.php
  2. 12
      src/Database/DBStructure.php
  3. 2
      tests/Util/VFSTrait.php
  4. 4
      update.php

0
config/dbstructure.php → config/dbstructure.config.php

12
src/Database/DBStructure.php

@ -28,7 +28,7 @@ class DBStructure
const UPDATE_FAILED = 2; // Database check failed
/**
* Database structure definition loaded from config/dbstructure.php
* Database structure definition loaded from config/dbstructure.config.php
*
* @var array
*/
@ -783,10 +783,10 @@ class DBStructure
}
/**
* Loads the database structure definition from the config/dbstructure.php file.
* Loads the database structure definition from the config/dbstructure.config.php file.
* On first pass, defines DB_UPDATE_VERSION constant.
*
* @see config/dbstructure.php
* @see config/dbstructure.config.php
* @param boolean $with_addons_structure Whether to tack on addons additional tables
* @return array
* @throws Exception
@ -796,16 +796,16 @@ class DBStructure
if (!self::$definition) {
$a = \Friendica\BaseObject::getApp();
$filename = $a->getBasePath() . '/config/dbstructure.php';
$filename = $a->getBasePath() . '/config/dbstructure.config.php';
if (!is_readable($filename)) {
throw new Exception('Missing database structure config file config/dbstructure.php');
throw new Exception('Missing database structure config file config/dbstructure.config.php');
}
$definition = require $filename;
if (!$definition) {
throw new Exception('Corrupted database structure config file config/dbstructure.php');
throw new Exception('Corrupted database structure config file config/dbstructure.config.php');
}
self::$definition = $definition;

2
tests/Util/VFSTrait.php

@ -30,7 +30,7 @@ trait VFSTrait
$this->setConfigFile('config.ini.php');
$this->setConfigFile('settings.ini.php');
$this->setConfigFile('local.ini.php');
$this->setConfigFile('dbstructure.php');
$this->setConfigFile('dbstructure.config.php');
}
/**

4
update.php

@ -21,7 +21,7 @@ require_once 'include/dba.php';
* This function is responsible for doing post update changes to the data
* (not the structure) in the database.
*
* Database structure changes are done in config/dbstructure.php
* Database structure changes are done in config/dbstructure.config.php
*
* If there is a need for a post process to a structure change, update this file
* by adding a new function at the end with the number of the new DB_UPDATE_VERSION.
@ -33,7 +33,7 @@ require_once 'include/dba.php';
*
* 1. Create a function "update_4712()" here in the update.php
* 2. Apply the needed structural changes in config/dbStructure.php
* 3. Set DB_UPDATE_VERSION in config/dbstructure.php to 4712.
* 3. Set DB_UPDATE_VERSION in config/dbstructure.config.php to 4712.
*
* If you need to run a script before the database update, name the function "pre_update_4712()"
*/

Loading…
Cancel
Save