Welcome Guest, Not a member yet? Register   Sign In
Can we change config file values within install page code to our applications ?
#1

[eluser]Aljebrini[/eluser]
hello,

i want to ask about some thing faced me before, all of us need to build a CMS with an Install Page to make config for his site,
with CI we need to define pre values like

Code:
$config['base_url'] = "http://localhost/website1";

and database Information manually in CI config files , is there any way that we can set this variable throw an install page without need to change it manually ?
#2

[eluser]InsiteFX[/eluser]
This is in the CodeIgniter users guide!

Code:
$this->config->set_item('item_name', 'item_value');

Enjoy
InsiteFX
#3

[eluser]puzzlebox[/eluser]
wow I didn't know this one.. Would be a very useful thing.. Thanks!
#4

[eluser]Aljebrini[/eluser]
that's great for Config, but not useful for Database configuration !
we may need to create Database config file template(temp file : have the same content as orginal database config file) and get the database information from user then replace the values in the temp file and replace the orginal file with the temp file.

with this way we can get the db informations and save it, ( in Installer )

any body have best solution for this issue ?
#5

[eluser]InsiteFX[/eluser]
Code:
-- --------------------------------------------------------

--
-- Table structure for table `acs_settings`
--

CREATE TABLE `acs_settings` (
  `id`        int(11)        NOT NULL    default '1',
  `name`    varchar(100)    NOT NULL    default '',
  `value`    text        NOT NULL,
  PRIMARY KEY (`id`)
) TYPE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `acs_settings`
---

INSERT INTO `acs_settings` (`id`, `name`, `value`) VALUES (1, 'min_username_length', '3');
INSERT INTO `acs_settings` (`id`, `name`, `value`) VALUES (2, 'max_username_length', '8');
INSERT INTO `acs_settings` (`id`, `name`, `value`) VALUES (3, 'min_password_length', '5');
INSERT INTO `acs_settings` (`id`, `name`, `value`) VALUES (4, 'max_password_length', '8');
INSERT INTO `acs_settings` (`id`, `name`, `value`) VALUES (5, 'connection', '');
INSERT INTO `acs_settings` (`id`, `name`, `value`) VALUES (6, 'lockcount', '3');

Enjoy
InsiteFX
#6

[eluser]Aljebrini[/eluser]
InsiteFX, Can you please give some explanation fot your table and what it used for ?




Theme © iAndrew 2016 - Forum software by © MyBB