Yii Framework Forum: A Web Page For Configuration - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

A Web Page For Configuration

#1 User is offline   saegeek 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 245
  • Joined: 09-December 09
  • Location:Montpellier - France

Posted 20 January 2013 - 01:26 PM

Hi,

I think we need a web interface to quickly change the fields in /protected/config/main.php
like accessing Gii (http://localhost/index.php?r=gii), it will result into something like http://localhost/index.php?r=config

Also why don't you use a DBA file (key-value database file) instead ?
And [for] their saying, "Indeed, we have killed the Messiah, Jesus, the son of Mary, the messenger of God ." And they did not kill him, nor did they crucify him; but [another] was made to resemble him to them. And indeed, those who differ over it are in doubt about it. They have no knowledge of it except the following of assumption. And they did not kill him, for certain.Rather, God raised him to Himself.
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,778
  • Joined: 17-January 09
  • Location:Russia

Posted 20 January 2013 - 03:23 PM

I don't think it's a good idea. Yii is not a CMS.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   Orteko 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 02-March 10

Posted 20 January 2013 - 09:39 PM

One issue with having a web page for editing the configuration is that the file then needs to be writable by the web server.

With that said you need the same level of access in order to be able to use gii so I guess it doesn't really make a lot of difference in the dev environment.

It would have the potential advantage that configuration options could be validated & include documentation on the same page.


It does seem that using php for the configuration file is a bit of overkill.

Something like yaml might make things a little clearer however this would then add in another dependency for a yaml-processor.
0

#4 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 21 January 2013 - 07:44 AM

I already proposed something like this http://www.yiiframew...4465-db-config/

But it seems like people prefer to edit a text file :D
Yii user #37
0

#5 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 21 January 2013 - 08:04 AM

There are extensions for both.

However, I don't understand the motivation behind having a web interface for the configuration?

Firstly, there is little to prevent you from having (some of) the app settings stored in a database.

I mean: do you want to edit the actual files in the browser too? :)
"Less noise - more signal"
0

#6 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,085
  • Joined: 16-February 11
  • Location:Japan

Posted 22 January 2013 - 12:24 PM

I wrote my own version of db-based system configuration utility with a web interface.
And, I have to confess that I don't like it very much myself, although I enjoyed its functionality for a while ... yeah, you have to believe me, it worked great. But I had to discard it.

After all, when you are not using a CMS but constructing a web application, the system configurations should be stored much more handy in a text file (i.e. a PHP source file). When you consider the needs for version controlling and documentation, a plain text file is much more preferable than a db table. And, do we need a web interface for a text configuration file? No, I don't think so.
0

#7 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 22 January 2013 - 01:56 PM

View Postsoftark, on 22 January 2013 - 12:24 PM, said:

After all, when you are not using a CMS but constructing a web application, the system configurations should be stored much more handy in a text file (i.e. a PHP source file).


Yes, but sometimes you build a CMS :)
Yii user #37
0

#8 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 22 January 2013 - 06:20 PM

View Postekerazha, on 22 January 2013 - 01:56 PM, said:

Yes, but sometimes you build a CMS :)


And in that case it would be pleasing to learn that there exist several Yii extensions to help you perform that job :)
"Less noise - more signal"
0

#9 User is offline   ekerazha 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 526
  • Joined: 10-October 08
  • Location:European Union

Posted 23 January 2013 - 04:29 AM

View Postjacmoe, on 22 January 2013 - 06:20 PM, said:

And in that case it would be pleasing to learn that there exist several Yii extensions to help you perform that job :)


Extensions like EConfig http://www.yiiframew...xtension/config allows to get/set settings to the database, however:

1) It's not made to change Yii settings (i.e. medium of cache storage, website name etc. etc.)
2) A built-in mechanism would be nice

However this was already discussed: http://www.yiiframew...4465-db-config/

As I've already said, it looks like people prefer to use text files (with permission issues etc.) :)
Yii user #37
0

#10 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 23 January 2013 - 11:16 AM

You can use Appmanager - or you could override some Yii classes.

Except from the ability to modify cache engine, site name and other more or less fixed parameters, I don't really see the need to have the app config stored in a database.

I can't think of a framework which does this.

Maybe it could be done using a sqlite db, separate from the main db configuration?
"Less noise - more signal"
0

#11 User is offline   yJeroen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 94
  • Joined: 06-September 11
  • Location:The Netherlands

Posted 27 January 2013 - 05:33 AM

I think people need two things:

  • Settings that rarely change (database, cache. etc) and are managed by a developer
  • Webapplication settings that can change over time depending on what the business wants. Params for example. These would be managed by an Application Manager. (Not totally sure if that's the name in english..)


For the first, a file can be better. For a second, a database config is better. Why not have both? They serve different purposes. The EConfig extension is a nice example of #2.
0

#12 User is offline   Psih 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 115
  • Joined: 30-June 10

Posted 27 January 2013 - 07:32 AM

It's so easy to implement params, that you need a simple table, Gii and 5 minutes to add a few methods to the model for ease of use. See under the spoiler. I don't think that there should be a default implementation, because it's very easy and most of us do that to our liking (some will add more fields, others will chop it down to keyword + value and make keyword unique. I for once sometimes use multiple records with the same keyword and different values).

Spoiler

1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users