SproutCMS

This is the code documentation for the SproutCMS project

class Database

Session database driver.

Source code (33 results)

/config/cache.php   Highlighted file source

Line 11: * driver - Cache backend driver. Kohana comes with file, database, and memcache drivers.
Line 13: * > Database cache can be used to cache items remotely, but is slower.

/config/database.php   Highlighted file source

Line 15: * Database connection settings.
Line 29: * database Database name
Line 30: * character_set Database character set
Line 41: 'database' => 'heroku_11cb2d367015e0a',
Line 58: 'database' => 'harbor_and-sprout',

/modules/Welcome/config/routes.php   Highlighted file source

Line 31: $config['welcome/db_conf_database'] = $ns . 'WelcomeController/dbConfDatabase';

/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');

/modules/Welcome/views/db_conf_result.php   Highlighted file source

Line 45: <h3>Database config</h3>
Line 47: <p>The main database config file is stored in the top-level config directory.</p>
Line 51: <li>Save the file as <code><?php echo Enc::html(DOCROOT . 'config/database.php'); ?></code></li>

/scripts/dbsync.php   Highlighted file source

Line 4: use Sprout\Helpers\DatabaseSync;
Line 8: $sync = new DatabaseSync(true);
Line 19: $log = $sync->updateDatabase();
Line 27: echo 'Please configure Database.', PHP_EOL;

/sprout/config/cache.php   Highlighted file source

Line 26: * driver - Cache backend driver. Kohana comes with file, database, and memcache drivers.
Line 28: * > Database cache can be used to cache items remotely, but is slower.

/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/HasCategoriesAdminController.php   Highlighted file source

Line 363: $items_view = '<p>No records currently exist in the database.</p>';
Line 900: Notification::error('Database error');

/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/Admin/OperatorAdminController.php   Highlighted file source

Line 170: * Saves the provided POST data into a new record in the database
Line 277: if (AdminAuth::hasDatabaseRecord() and $item_id == AdminAuth::getId()) {
Line 302: if (AdminAuth::hasDatabaseRecord() and $item_id == AdminAuth::getId()) {

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 286: * Saves the provided POST data into a new page in the database
Line 1266: * Saves the provided POST data into this page in the database
Line 2406: return Cron::failure('Database error');
Line 2445: return Cron::failure('Database error');

/sprout/Controllers/AdminController.php   Highlighted file source

Line 1526: Notification::error('There was a database error deleting the specified item');
Line 2178: Notification::error('Database error during restore');
Line 2305: return Cron::failure('Database error');

/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/Controllers/PageController.php   Highlighted file source

Line 319: * @param array $page Page details from the database
Line 370: * @param array $page Database record
Line 382: * Loads the widgets from the database for this page.

/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/AdminDashboard.php   Highlighted file source

Line 53: if (!AdminAuth::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

/sprout/Helpers/Database_Expression.php   Highlighted file source

Line 20: * Database expression class to allow for explicit joins and where expressions.
Line 22: class Database_Expression
Line 37: } // End Database Expr Class

/sprout/Helpers/Drivers/Session/Database.php   Highlighted file source

Line 27: * Session database driver.
Line 29: class Database implements SessionDriver
Line 31: // Database settings
Line 60: Kohana::log('debug', 'Session Database Driver Initialized');
Line 152: } // End Session Database Driver

/sprout/Helpers/ExportDBMS_MySQL.php   Highlighted file source

Line 22: . "-- Sprout3 Database Dump\n"

/sprout/Helpers/ExportDBMS_SQLite.php   Highlighted file source

Line 22: . "-- Sprout3 Database Dump\n"

/sprout/Helpers/Pdb.php   Highlighted file source

Line 20: * Class for doing database queries via PDO (PDO Database => Pdb)
Line 30: $config = Kohana::config('database.' . $name);

/sprout/i18n/en_US/errors.php   Highlighted file source

Line 19: E_DATABASE_ERROR => array( 1, 'Database Error', 'A database error occurred while performing the requested procedure. Please review the database error below for more information.'),

/sprout/tests/navigationTest.php   Highlighted file source

Line 63: public function testDatabaseSetupWorked()

/sprout/views/admin/generic_import.php   Highlighted file source

Line 34: <tr><th>CSV field</th><th>Data sample</th><th>Database field</th></tr>
Line 59: 'new' => 'Add as new database record',
Line 60: 'merge' => 'Merge CSV record into existing database record',

/sprout/views/admin/main_layout.php   Highlighted file source

Line 189: <?php if (AdminAuth::hasDatabaseRecord()): ?>

A total of 167 lines in 33 files were found