
/modules/Welcome/config_tmpl/database.php Highlighted file source
Line 15: * Database connection settings.
Line 29: * database Database name
Line 30: * character_set Database character set
Line 40: 'database' => '{{PROD-DATABASE}}',
Line 47: // Rather than entering the PRODUCTION database password direct in
Line 59: if (!file_exists(DOCROOT . '../database.config.php')) {
Line 60: throw new Exception('Missing database password config file');
Line 63: require DOCROOT . '../database.config.php';
Line 75: 'database' => '{{TEST-DATABASE}}',

/modules/Welcome/Controllers/WelcomeController.php Highlighted file source
Line 26: use Sprout\Helpers\DatabaseSync;
Line 97: unset($_SESSION['database_config']);
Line 131: * Test the database config is correct
Line 137: if (!file_exists(DOCROOT . 'config/database.php')) {
Line 185: return [false, 'Unable to connect to database'];
Line 206: return [false, 'Unable to connect to database'];
Line 229: * Show a UI for generating a database config
Line 233: unset($_SESSION['database_config']);
Line 245: $skin->browser_title = 'Database sync';
Line 246: $skin->main_title = 'Database sync';
Line 260: if (empty($_POST['database'])) Json::out(['result' => 'You must specify a database']);
Line 264: "mysql:host={$_POST['host']};dbname={$_POST['database']}",
Line 276: * Display the generated database config
Line 283: $valid->required(['production', 'host', 'user', 'pass', 'database']);
Line 292: $_SESSION['database_config'] = $_POST;
Line 295: $view->db_config_url = 'welcome/db_conf_database';
Line 303: $view->pass_filename = implode(DIRECTORY_SEPARATOR, $parts) . DIRECTORY_SEPARATOR . 'database.config.php';
Line 312: $skin->browser_title = 'Database sync';
Line 313: $skin->main_title = 'Database sync';
Line 320: * Generate and download a database config file
Line 322: public static function dbConfDatabase()
Line 324: $config = self::genDbConfig($_SESSION['database_config']);
Line 327: header('Content-disposition: attachment; filename="database.php"');
Line 348: * Generate a database config from given parameters
Line 350: * @param array $data Config params; 'production', 'host', 'user', 'pass', 'database'
Line 355: $db_config = file_get_contents(__DIR__ . '/../config_tmpl/database.php');
Line 360: $db_config = str_replace('{{PROD-DATABASE}}', $data['database'], $db_config);
Line 363: $db_config = str_replace('{{TEST-DATABASE}}', '-- database --', $db_config);
Line 369: $db_config = str_replace('{{TEST-DATABASE}}', $data['database'], $db_config);
Line 371: $db_config = str_replace('{{PROD-DATABASE}}', '-- database --', $db_config);
Line 418: $config = self::genPassConfig($_SESSION['database_config']);
Line 421: header('Content-disposition: attachment; filename="database.config.php"');
Line 428: * Generate a database password file from given parameters
Line 442: * Run a database sync
Line 446: $sync = new DatabaseSync(true);
Line 456: $log = $sync->updateDatabase();
Line 458: Notification::error('Please configure Database - Step 1 of checklist.');
Line 470: $skin->browser_title = 'Database sync';
Line 471: $skin->main_title = 'Database sync';
Line 561: Notification::error('Please configure Database - Step 1 of checklist. It\'s required for validation!');
Line 634: Notification::error('Please configure Database - Step 1 of checklist.');

/modules/Welcome/views/db_conf_form.php Highlighted file source
Line 39: opts.database = $('input[name="database"]').val();
Line 44: if (opts.database == '') { alert('Please specify a database'); return; }
Line 66: Form::nextFieldDetails('Username', true, 'The database username (e.g. example_web)');
Line 76: Form::nextFieldDetails('Database name', true, 'The name of the actual database (e.g. example_v1)');
Line 77: echo Form::text('database');

/sprout/config/database.php Highlighted file source
Line 3: * Database connection settings.
Line 17: * database Database name
Line 18: * character_set Database character set
Line 28: 'database' => ' -- database -- ',
Line 39: // Rather than entering the PRODUCTION database password direct in
Line 51: if (file_exists(DOCROOT . '../database.config.php')) {
Line 52: require DOCROOT . '../database.config.php';
Line 65: 'database' => ' -- database --',

/sprout/Controllers/Admin/FileAdminController.php Highlighted file source
Line 435: return Json::error('Database error');
Line 446: return Json::error('Database error');
Line 647: return array('error' => 'Unable to upload file; database error (main)');
Line 658: return array('error' => 'Unable to upload file; database error (cat)');
Line 667: return array('error' => 'Unable to upload file; database error (joiner)');
Line 758: * Saves the provided POST data into this file in the database
Line 1199: Notification::error('Database error performing cleanup');

/sprout/Controllers/Admin/ManagedAdminController.php Highlighted file source
Line 506: // Find columns in database table
Line 740: * Try to guess the database name for a given CSV heading.
Line 745: * @return string The database field name to use. Must exactly match the database field name.
Line 771: * @param array $new_data The CSV data, with database-mapped names, but before
Line 772: * the database quoting has happened.
Line 1021: $items_view = '<p>No records currently exist in the database.</p>';
Line 1351: * @return array Database row

/sprout/Controllers/Controller.php Highlighted file source
Line 48: * Stores a history item in the database, recording an add (i.e. insert), edit, or delete.
Line 151: * Fetches the pre-update record from the database.
Line 480: * @param int $item_id Database ID of record to store data in. If zero, a new record will be inserted, and as this

/sprout/Controllers/DbToolsController.php Highlighted file source
Line 37: use Sprout\Helpers\DatabaseSync;
Line 75: * Provides tools for dealing with the database
Line 90: [ 'url' => 'dbtools/sync', 'name' => 'Database sync', 'desc' => 'Syncs the db structure to match db_struct.xml' ],
Line 101: [ 'url' => 'dbtools/moduleBuilderDb', 'name' => 'Database struct generator', 'desc' => 'Generates db_struct.xml content for a module' ],
Line 122: [ 'url' => 'dbtools/exportTables', 'name' => 'Export database', 'desc' => 'Export tables to an SQL file' ],
Line 124: [ 'url' => 'dbtools/importTables', 'name' => 'Import database', 'desc' => 'Import database tables from a .sql file' ],
Line 213: * Shows a list of database tools
Line 221: $this->template('Database and system tools', $view->render());
Line 352: $sync = new DatabaseSync($act);
Line 356: echo '<p>Insufficent database permissions for this tool.</p>';
Line 366: $this->template('Database sync');
Line 370: $out = $sync->updateDatabase();
Line 421: $this->template('Database sync');
Line 486: $this->template('Database structure', $view->render());
Line 767: * Import database tables from a .sql file
Line 943: $sync = new DatabaseSync(true);
Line 952: echo $sync->updateDatabase();
Line 1222: echo "<p><a href=\"SITE/dbtools/gettempfile/export-database/{$f_url}/{$f}\">{$f}</a></p>";
Line 1315: * @param string $source The source of the file, one of 'export-database', 'export-files', 'module-builder'
Line 1324: 'export-database' => '/^export-[0-9]+-(?:sql_[-0-9]+_.+\.zip|.+\.sql)$/',
Line 1939: if (strpos($_POST['content'], '<database>') === false) {
Line 1940: $_POST['content'] = '<database>' . $_POST['content'] . '</database>';
Line 1958: $sync = new DatabaseSync(false);
Line 2035: $sync = new DatabaseSync(false);

/sprout/Helpers/AdminAuth.php Highlighted file source
Line 138: * Checks the password on the database matches the one provided
Line 388: return self::hasDatabaseRecord() ? @$_SESSION[self::KEY]['login_id'] : 0;
Line 402: if (self::hasDatabaseRecord()) {
Line 498: * Does the record-id for this login correspond to a local database record?
Line 500: * @return bool True if the logged-in operator has a database record
Line 502: public static function hasDatabaseRecord()

/sprout/Helpers/DatabaseSync.php Highlighted file source
Line 19: use karmabunny\pdb\Compat\DatabaseSync as RealDatabaseSync;
Line 23: * Provides a system for syncing a database to a database definition.
Line 25: * The database definition is stored in one or more XML files, which get merged
Line 29: class DatabaseSync extends RealDatabaseSync
A total of 167 lines in 33 files were found