Fix dbstructure console outputting addon structure as well

This commit is contained in:
Hypolite Petovan 2018-10-21 02:52:11 -04:00
parent 015e2a84b1
commit 2debdbd0c9

View file

@ -173,7 +173,7 @@ class DBStructure
} }
public static function printStructure() { public static function printStructure() {
$database = self::definition(); $database = self::definition(false);
echo "-- ------------------------------------------\n"; echo "-- ------------------------------------------\n";
echo "-- ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION." (".FRIENDICA_CODENAME,")\n"; echo "-- ".FRIENDICA_PLATFORM." ".FRIENDICA_VERSION." (".FRIENDICA_CODENAME,")\n";
@ -833,10 +833,11 @@ class DBStructure
* On first pass, defines DB_UPDATE_VERSION constant. * On first pass, defines DB_UPDATE_VERSION constant.
* *
* @see config/dbstructure.php * @see config/dbstructure.php
* @param boolean $with_addons_structure Whether to tack on addons additional tables
* @return array * @return array
* @throws Exception * @throws Exception
*/ */
public static function definition() public static function definition($with_addons_structure = true)
{ {
if (!self::$definition) { if (!self::$definition) {
$a = \Friendica\BaseObject::getApp(); $a = \Friendica\BaseObject::getApp();
@ -858,7 +859,9 @@ class DBStructure
$definition = self::$definition; $definition = self::$definition;
} }
Hook::callAll('dbstructure_definition', $definition); if ($with_addons_structure) {
Hook::callAll('dbstructure_definition', $definition);
}
return $definition; return $definition;
} }