Uh oh!
There was an error while loading. Please reload this page.
refactor: [db:create] add command line message on detect extension sqlite3 not loaded - #9051
refactor: [db:create] add command line message on detect extension sqlite3 not loaded#9051renpv wants to merge 1 commit into
Conversation
add command line message on detect extension sqlite3 not loaded
ddevsr
commented
Jul 19, 2024
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.
I don't accept this in here. It is only for SQLite3, so it should not in this class.
kenjis
commented
Jul 19, 2024
Why do you need this? |
renpv
commented
Jul 19, 2024
via email
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:
***@***.***>
|
renpv
commented
Jul 19, 2024
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 |
kenjis
commented
Jul 19, 2024
Can you show the exact error message that does not help? |
renpv
commented
Jul 20, 2024
kenjis
commented
Jul 20, 2024
|
kenjis
commented
Jul 20, 2024
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 |
renpv
commented
Jul 22, 2024
I think the same happens with the other drivers |
kenjis
commented
Aug 30, 2024
kenjis
commented
Sep 5, 2024
Closed by #9160 |

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