Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using sqlite problem #8

Open
dadinugroho opened this issue May 22, 2014 · 1 comment
Open

Using sqlite problem #8

dadinugroho opened this issue May 22, 2014 · 1 comment

Comments

@dadinugroho
Copy link

Hi cornernote,

Since this is a bit move from the archive issue, I decide to open a new issue.

How to use sqlite instead of mysql? Is that only by comment out the 'connectionId' ?

Is there any specific things that make you store the file in runtime? I see someone using protected/data to store a file, when not using database. See yii auth module. I understand that this may be a personal interest but I just want to know whether any other reason for this.

Thanks so much.

Daniel

@cornernote
Copy link
Owner

Hi @dadinugroho,

First you need to create a database connection in your config/main.php, under the components section. It may look like this:

return array(
    'components' => array(
        'dbAudit' => array(
            'class' => 'CDbConnection',
            'connectionString' => 'sqlite:/path/to/audit.db',
        ),
    ),
),

More info on setting up db connections can be found here: http://www.yiiframework.com/doc/blog/1.1/en/prototype.database

Next you need to set 'connectionID'='dbAudit'.

If you don't define a connectionID, then AuditModule will put its own database in the runtime folder. This is not recommended for production, it's more of a "lets just run out of the box with no config" type thing.

@csa12 csa12 mentioned this issue Jun 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants