Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How does this code work and what does it do?
y2kbg
New
if (!array_key_exists('USER_WALL_SCHEMA_VERSION', $Context->Configuration)) {
$SQL = file_get_contents($Context->Configuration['EXTENSIONS_PATH'] . 'UserWall/userwall-mysql.sql');
$Context->Database->Execute($SQL, 'UserWall', NULL, 'Could not create User Wall table');
if ($Context->ErrorManager->Iif()) {
AddConfigurationSetting($Context, 'USER_WALL_SCHEMA_VERSION', '1.0');
} else {
$Context->WarningCollector->Add($Context->GetDefinition('UserWallCreateTableError'));
}
}
I want make an extension that involves making a table, i see how it references the external file for the query but how does it know if the table has already been made?
$SQL = file_get_contents($Context->Configuration['EXTENSIONS_PATH'] . 'UserWall/userwall-mysql.sql');
$Context->Database->Execute($SQL, 'UserWall', NULL, 'Could not create User Wall table');
if ($Context->ErrorManager->Iif()) {
AddConfigurationSetting($Context, 'USER_WALL_SCHEMA_VERSION', '1.0');
} else {
$Context->WarningCollector->Add($Context->GetDefinition('UserWallCreateTableError'));
}
}
I want make an extension that involves making a table, i see how it references the external file for the query but how does it know if the table has already been made?
0
This discussion has been closed.
Comments
// checks to see if "USER_WALL_SCHEMA_VERSION" has been added to the settings file. // If it isnt there then it will run the sql table files. Ie make the database tables. if (!array_key_exists('USER_WALL_SCHEMA_VERSION', $Context->Configuration)) { $SQL = file_get_contents($Context->Configuration['EXTENSIONS_PATH'] . 'UserWall/userwall-mysql.sql'); $Context->Database->Execute($SQL, 'UserWall', NULL, 'Could not create User Wall table'); //Checks for errors if ($Context->ErrorManager->Iif()) { // If there were no errors it adds "USER_WALL_SCHEMA_VERSION" to the settings file AddConfigurationSetting($Context, 'USER_WALL_SCHEMA_VERSION', '1.0'); // Otherwise it adds an error saying that the table could not be created or something } else { $Context->WarningCollector->Add($Context->GetDefinition('UserWallCreateTableError')); } }
ok what does 'UserWall' do in this part