Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 4 Playground
#41

There was some database setting in the .env file that I copied into my project. I have removed this lines in .env
Code:
# database.default.database = ../writable/database.db
# database.default.DBDriver = SQLite3
..and no I'm in. Cheers!
Reply
#42

@muuucho
> ...and no I'm in. Cheers!

Is SQLite3 the dbdriver being used or the default MySqli? I tried and failed with SQLite3 and PDO only MySqli was successful.
Reply
#43

(12-09-2019, 07:22 AM)John_Betong Wrote: @muuucho
> ...and no I'm in. Cheers!

Is SQLite3 the dbdriver being used or the default MySqli?  I tried and failed with SQLite3 and PDO only MySqli was successful.
Not sure if I follow you right. I have MySQL installed (I use Xampp) so I have configured $default[] in app/Config/Database.php tlike this:
PHP Code:
public $default = [
        
'DSN'      => '',
        
'hostname' => 'localhost',
        
'username' => 'root',
        
'password' => '',
        
'database' => 'playground',
        
'DBDriver' => 'MySQLi',
        
'DBPrefix' => '',
        
'pConnect' => false,
        
'DBDebug'  => (ENVIRONMENT !== 'production'),
        
'cacheOn'  => false,
        
'cacheDir' => '',
        
'charset'  => 'utf8',
        
'DBCollat' => 'utf8_general_ci',
        
'swapPre'  => '',
        
'encrypt'  => false,
        
'compress' => false,
        
'strictOn' => false,
        
'failover' => [],
        
'port'     => 3306,
    ]; 
...and then I commented out the database settings in .env like this:
PHP Code:
# database.default.database = ../writable/database.db
# database.default.DBDriver = SQLite3 
Reply
#44

@muuucho,
I thought that because the error shown was about SQLite3 that was the selected dbdriver.

I also had problems with the .env settings and prefer the old style even though they are in numerous config files.

My policy is to get it too work then make it better Smile
Reply
#45

I like to see a complete CRUD on Heroes and/or on Dungeons.
Nice approach with the comments in the code, makes it much easier to learn, thanks!
Reply
#46

@John_Betong SQLite3 is the default driver because it is the fastest and easiest way for a developer to get the code and run it - no need to have or install a database (assuming SQLite3 is available). Developers certainly can still switch the database, either via .env or app/Config/Database.php

@muuucho a full CRUD is high on the priority list! I'd like to see a few different versions, including a RESTful presenter (and eventual controller API) and "classic" methods. Probably add some more database tables too so we can do some example relationship handling and have other options for entities, arrays, and objects.
Reply
#47

(12-08-2019, 10:59 AM)muuucho Wrote: Thanks, after having moved the system folder I know get this message:Class 'SQLite3' not found

SYSTEMPATH/Database\SQLite3\Connection.php at line 89

If I run php spark migrate php spark dbConfusedeed PlaygroundSeeder
I get pretty much the same error:
An uncaught Exception was encountered

Type:        Error
Message:    Class 'SQLite3' not found
Filename:    C:\xampp\htdocs\playground\system\Database\SQLite3\Connection.php
Line Number: 89
Reply
#48

I've been waiting for a long to get into CI4, but now I want to give it a try.

I have a project folder named d:\wamp64\www\ci4_test, where I installed CI4 with composer.
From my project folder, I also installed playground with composer.
Now, both the project folder and the playground folder have subfolders like app, public, tests, vendor and writable.
Where to go from here? The docs aren't clear on this.
Reply
#49

I’m not sure I understand. Did you put Playground in your test app? Playground is it’s own project and doesn’t need to be added to another project or have anything else added. I’d recommend working through the README file (if you haven't already) and looking at the docs folder to help understand what’s going on. Being that there isn’t a lot to do in Playground yet, but you can start writing your own code to learn the framework. Try adding a migration file, a seeder, and Model, Controller, and views for monsters.
Reply
#50

(This post was last modified: 12-24-2019, 08:34 AM by John_Betong.)

@Wouter60,
You could try installing the strict version from Github...

https://github.com/John-Betong/ci4-strict
Reply




Theme © iAndrew 2016 - Forum software by © MyBB