-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
refactor: [db:create] add command line message on detect extension sqlite3 not loaded #9051
Conversation
add command line message on detect extension sqlite3 not loaded
What you want to solve? and describe a problem |
if (!extension_loaded('sqlite3')) { | ||
CLI::error("extension [sqlite3] not loaded. Uncomment it in the php.ini file", 'light_gray', 'red'); | ||
CLI::newLine(); | ||
|
||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't accept this in here. It is only for SQLite3, so it should not in this class.
Why do you need this? |
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:
***@***.***>
|
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 |
Can you show the exact error message that does not help? |
|
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
*/ |
Great. Much better. But |
I think the same happens with the other drivers |
Closed by #9160 |
add command line message on detect extension sqlite3 not loaded
Description
Explain what you have changed, and why.
Checklist: