public function __construct($config = array()) { parent::__construct(); // Loading the configuration fo migration $this->config->load('migration'); foreach ($this->config->config as $key => $val) { $this->{'_' . $key} = $val; } log_message('debug', 'Migrations class initialized'); // Are they trying to use migrations while it is disabled? if ($this->_migration_enabled !== TRUE) { show_error('Migrations has been loaded but is disabled or set up incorrectly.'); } // If not set, set it $this->_migration_path == '' and $this->_migration_path = APPPATH . 'migrations/'; // Add trailing slash if not set $this->_migration_path = rtrim($this->_migration_path, '/') . '/'; // Load migration language $this->lang->load('migration'); // They'll probably be using dbforge $this->load->dbforge(); // If the migrations table is missing, make it if (!$this->db->table_exists('migrations')) { $this->dbforge->add_field(array('version' => array('type' => 'INT', 'constraint' => 3))); $this->dbforge->create_table('migrations', TRUE); $this->db->insert('migrations', array('version' => 0)); } }
public function __construct($config = array()) { parent::__construct($config); // If the migrations type column is missing, add it if (!$this->db->field_exists('type', $this->_migration_table)) { $this->dbforge->add_column($this->_migration_table, array('type' => array('type' => 'VARCHAR', 'constraint' => 40, 'first' => TRUE))); $this->db->update($this->_migration_table, array('type' => 'core')); } }
/** * Class constructor method * * @param array $config Array of parameters to initialize class */ public function __construct($config = []) { parent::__construct($config); $this->_set_table(); $this->_check_table(); $this->_set_directory_migrations(); $this->_set_database_migrations(); log_message('info', __CLASS__ . ' Class Initialized'); }
/** * Class Constructor * * @param array $config Migration library config arguments. */ public function __construct($config = array()) { parent::__construct($config); if (!$this->db->field_exists('module', $this->_migration_table)) { $fields = array('module' => array('type' => 'VARCHAR', 'first' => TRUE, 'constraint' => '100', 'null' => FALSE)); $this->dbforge->add_column($this->_migration_table, $fields); $this->db->query("ALTER TABLE {$this->_migration_table} ADD PRIMARY KEY(module);"); $this->db->query("UPDATE {$this->_migration_table} SET module = '{$this->_module_name}' LIMIT 1;"); } $this->_set_migration_path(); log_message('info', 'Craftsman Migration Class Init'); }
public function __construct() { parent::__construct(); }
public function __construct() { parent::__construct(); $this->db->data_cache = array(); }
public function __construct() { parent::__construct(); $this->load->dbforge(); }
public function __construct($config = array()) { parent::__construct($config); $this->load->model('settings_model'); }
public function __construct($config = array()) { parent::__construct($config); $this->db->data_cache = array(); // reset data cache to get fresh info }
public function __construct($config = array()) { parent::__construct($config); $this->load->model('ranking_model'); $this->load->model('country_model'); }