# |
Jan 13th 2020, 16:33 |
neon1024 |
Is why that message is being displayed |
# |
Jan 13th 2020, 16:33 |
neon1024 |
missing PHP extension |
# |
Jan 13th 2020, 16:33 |
Human_G33k |
so why the error message ? |
# |
Jan 13th 2020, 16:33 |
Human_G33k |
il my all config file |
# |
Jan 13th 2020, 16:33 |
Human_G33k |
'driver' => Postgres::class, |
# |
Jan 13th 2020, 16:33 |
neon1024 |
So read the error out loud now to yourself |
# |
Jan 13th 2020, 16:32 |
neon1024 |
Right, so nothing to do with Postgres then. |
# |
Jan 13th 2020, 16:32 |
Human_G33k |
is the error |
# |
Jan 13th 2020, 16:32 |
Human_G33k |
Database driver Cake\Database\Driver\Mysql cannot be used due to a missing PHP extension or unmet dependency |
# |
Jan 13th 2020, 16:32 |
neon1024 |
That doesn’t sound right, MySQL wouldn’t have a Postgres config file, they’re different databases |
# |
Jan 13th 2020, 16:31 |
neon1024 |
You said “but not from the lan” |
# |
Jan 13th 2020, 16:31 |
Human_G33k |
and it talk about mysql but all conf file contain postgres |
# |
Jan 13th 2020, 16:31 |
neon1024 |
Oh sure, 127.0.0.1 will work, that’s localhost |
# |
Jan 13th 2020, 16:31 |
neon1024 |
192.168.1.12 or whatever it is |
# |
Jan 13th 2020, 16:31 |
Human_G33k |
but it s work in local |
# |
Jan 13th 2020, 16:31 |
neon1024 |
..and then access is using the machines lan ip |
# |
Jan 13th 2020, 16:30 |
Human_G33k |
it says database driver is wrong |
# |
Jan 13th 2020, 16:30 |
neon1024 |
You would need to expose the database to the network |
# |
Jan 13th 2020, 16:30 |
Human_G33k |
but not from the lan |
# |
Jan 13th 2020, 16:30 |
Human_G33k |
local work with 127 |
# |
Jan 13th 2020, 16:30 |
Human_G33k |
the conf in local or app not work |
# |
Jan 13th 2020, 16:29 |
ndm |
Basically, yes. You'd most likely use `allowEmptyString()`, as most of the time request data is actually a string, as validation happens before marshalling. If you have an API, and therefore parse raw data into request data, you might have a problem, as @dereuromark pointed out, as you'd likely receive integers as actual integers. |
# |
Jan 13th 2020, 16:29 |
Human_G33k |
how can i set up config (database) for local network with embed dev php server ? |
# |
Jan 13th 2020, 16:25 |
phantomwatson |
Oh, cool. So essentially for a nullable integer field, I just need `allowEmptyArbitrary()` :) |
# |
Jan 13th 2020, 16:24 |
ndm |
fyi, all `allowEmpty*` methods do allow `null` |
# |
Jan 13th 2020, 16:23 |
phantomwatson |
So you'd recommend adding `allowEmptyString()` and having the value saved as `'field' => $value ?? ''`? It feels hacky, but it's ultimately just six more characters, so not a huge deviation from what I was originally doing. |
# |
Jan 13th 2020, 16:20 |
dereuromark |
the API is an issue for sure these days. I keep the old ones with deprecations silenced for usability. |
# |
Jan 13th 2020, 16:20 |
dereuromark |
mainly the "As request data is all strings" only being partially the case, even thow most of the time. @neon1024 is still right about the approach. |
# |
Jan 13th 2020, 16:19 |
dereuromark |
Nah, I was just adding a remark :) All good. |
# |
Jan 13th 2020, 16:18 |
neon1024 |
I’ve kept the deprecation errors :zipper_mouth_face: |
# |
Jan 13th 2020, 16:18 |
phantomwatson |
Whoops, didn't mean to open up a can of works. :) |
# |
Jan 13th 2020, 16:18 |
neon1024 |
I’ll hand over to @dereuromark he’ll have a much better idea of it than I will 8) |
# |
Jan 13th 2020, 16:17 |
dereuromark |
which is not even true, some can come in via API, and will not be strings. I pointed out before this should have been allowEmptyScalar() if anything. |
# |
Jan 13th 2020, 16:17 |
neon1024 |
So you might want allowEmptyString and isNumeric |
# |
Jan 13th 2020, 16:17 |
neon1024 |
As request data is all strings, perhaps it’s just allow string |
# |
Jan 13th 2020, 16:17 |
neon1024 |
https://api.cakephp.org/3.8/class-Cake.Validation.Validator.html#_allowEmptyString |
# |
Jan 13th 2020, 16:17 |
neon1024 |
Man, I hate the validation now |
# |
Jan 13th 2020, 16:16 |
neon1024 |
Ah, just a missing method |
# |
Jan 13th 2020, 16:16 |
phantomwatson |
In the Validator class? |
# |
Jan 13th 2020, 16:16 |
neon1024 |
It’s in 3.x |
# |
Jan 13th 2020, 16:16 |
phantomwatson |
Is `allowEmptyInteger()` something in CakePHP 4? I'm not seeing it in 3. |