refactor: [db:create] add command line message on detect extension sqlite3 not loaded#9051
Closed
renpv wants to merge 1 commit intocodeigniter4:developfrom
Closed
refactor: [db:create] add command line message on detect extension sqlite3 not loaded#9051renpv wants to merge 1 commit intocodeigniter4:developfrom
renpv wants to merge 1 commit intocodeigniter4:developfrom
Conversation
add command line message on detect extension sqlite3 not loaded
Collaborator
|
What you want to solve? and describe a problem |
kenjis
reviewed
Jul 19, 2024
Comment on lines
+99
to
+104
| if (!extension_loaded('sqlite3')) { | ||
| CLI::error("extension [sqlite3] not loaded. Uncomment it in the php.ini file", 'light_gray', 'red'); | ||
| CLI::newLine(); | ||
|
|
||
| return; | ||
| } |
Member
There was a problem hiding this comment.
I don't accept this in here. It is only for SQLite3, so it should not in this class.
Member
|
Why do you need this? |
Author
|
Com essa extensão desabilitada, se tentar conectar a um banco SQLite o
sistema retorna o seguinte erro:
[image: c8b6bcc0-391d-443c-97ed-a6b3945161f6.png]
Essa mensagem dificulta a resolução do problema.
Com essa linha de código o sistema vai retornar essa mensagem:
[image: image.png]
Estou sugerindo incluir esse código porque não é a primeira vez que eu
perco um tempo considerável tentando resolver um problema baseado em uma
mensagem errada.
Eu coloquei nesse arquivo porque ele faz algumas validações iniciais
relacionadas ao SQLite.
Fico à disposição.
Atenciosamente,
Em qui., 18 de jul. de 2024, 23:53, kenjis ***@***.***>
escreveu:
… Why do you need this?
—
Reply to this email directly, view it on GitHub
<#9051 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGKSQJ2D2MKWLDUPVB3BZTZNB5UBAVCNFSM6AAAAABLDSSJKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZXHE4DANRUGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Author
With the extension disabled, when trying to execute a command related to SQLite the system returns an error that does not help with resolution. I'm including this code because it's not the first time I've spend a specific amount of time trying to solve a problem based on a |
Member
|
Can you show the exact error message that does not help? |
Author
Member
|
Member
|
How about this? --- a/system/Database/SQLite3/Connection.php
+++ b/system/Database/SQLite3/Connection.php
@@ -55,6 +55,16 @@ class Connection extends BaseConnection
*/
protected $busyTimeout;
+ public function __construct(array $params)
+ {
+ assert(
+ extension_loaded('sqlit3'),
+ 'The required PHP extension "sqlit3" is not loaded.'
+ );
+
+ parent::__construct($params);
+ }
+
/**
* @return void
*/ |
Author
Great. Much better. But |
Author
|
I think the same happens with the other drivers |
5 tasks
Member
Member
|
Closed by #9160 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

add command line message on detect extension sqlite3 not loaded
Description
Explain what you have changed, and why.
Checklist: