Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
WanWizard
a.k.a. WanWizard
Discussions
4
Comments
8242
Activity
Oil CLI, Options are removed from $argv
Did a test locally (linux, using 1.9/develop): [wanwizard@catwoman]$ php oil g model proxy type:varchar[50] ip:varchar[50] country:varchar[5] --no-migration Creating model: /data/www/testhosts/fuel19dev/fuel/app/classes/model/proxy.php[wanwizard@c…
Comment by
WanWizard
June 2017
permalink
Auth check() returns false
To be clear: your default database also contains all your ORM Auth tables, and Auth should continue to use that default DB for all Auth queries, even when you switch db.active over to another database?
Comment by
WanWizard
June 2017
permalink
Oil CLI, Options are removed from $argv
Because they are not arguments to the function. So they have to be filtered from the list of arguments. In other words, in your example, "--no-migration" is removed since it is not an argument for generate:model, it is a flag, a switch. Sw…
Comment by
WanWizard
June 2017
permalink
Oil CLI, Options are removed from $argv
I don't have PHP on Windows here, but I'll have a look later. There have been some changes to oil recently, so it might be worthwhile to check 1.9/develop to see if you have the same issue there.
Comment by
WanWizard
June 2017
permalink
Oil CLI, Options are removed from $argv
What platform (OS) did you test this on? Can you give the exact oil command you used, so we can verify and debug it if needed?
Comment by
WanWizard
June 2017
permalink
File::create_dir() getting Invalid basepath: cannot create directory at this location
You get that if APPPATH.'tmp/' does not exist or is not accessable. I assume you haven't configured any base area in your file.php config file? Is this on Windows? Does that trailing slash need to be there (I don't think so)?
Comment by
WanWizard
June 2017
permalink
Master/slave doesn't working with new database/connection.php
Ok, thanks for the feedback. Fixed here: https://github.com/fuel/core/commit/59d460eac4424bf15a720b0f7e0b751715b2c797
Comment by
WanWizard
June 2017
permalink
Master/slave doesn't working with new database/connection.php
Any feedback on this?
Comment by
WanWizard
June 2017
permalink
Master/slave doesn't working with new database/connection.php
So, in /fuel/core/classes/db.php, change the select() method to public static function select($args = null) { return \Database_Connection::instance(null, null, false)->select(func_get_args()); } That should solve it the correct w…
Comment by
WanWizard
June 2017
permalink
Master/slave doesn't working with new database/connection.php
I didn't say that, I just asked you to test it, and confirm that it will fix your problem. Your solution will break the next time you upgrade, as 1.9/dev contains major database changes.
Comment by
WanWizard
June 2017
permalink
Master/slave doesn't working with new database/connection.php
I've checked the ORM, if it has separate read and write connections defined, it will explicitly use them by passing the connection to execute() when running the generated query. If not, it will use the mechanism used in the database layer. It s…
Comment by
WanWizard
June 2017
permalink
Master/slave doesn't working with new database/connection.php
Does it work if you do \Database_Connection::instance(null, null, false)->select()->execute(); instead of \DB::select()->execute() ?
Comment by
WanWizard
June 2017
permalink
Master/slave doesn't working with new database/connection.php
Ok. I'll see if I can reproduce it. I assume you have defined both readonly and readwrite in your ORM model? I don't think it will use the setting in your db.php, but I'll have to check.
Comment by
WanWizard
June 2017
permalink
Master/slave doesn't working with new database/connection.php
And you're using a standard DB::Select() call, not ORM or Model_Crud?
Comment by
WanWizard
June 2017
permalink
Master/slave doesn't working with new database/connection.php
Yes, Packagist (composer) is newer, as it is automatically updated from github, and therefore also contains hotfix releases. The zip on the website is only updated wth official releases, so it is still at 1.8.0. I am not sure what you mean with &qu…
Comment by
WanWizard
June 2017
permalink
set fieldset select option selected
A snippet from one of our apps (manually created fieldset): $options = \DB::select('id', array(\DB::expr('CONCAT(surname,", ",initials," ",prefix)'), 'name')) ->from('people') ->…
Comment by
WanWizard
June 2017
permalink
set fieldset select option selected
How do you create the fieldset? Manually? Or from an ORM model? In general, it uses the current value of the fieldset field as the selected option in case of a dropdown.
Comment by
WanWizard
June 2017
permalink
Custom Validation in Modules
You're welcome. Happy coding. ;)
Comment by
WanWizard
June 2017
permalink
Custom Validation in Modules
Yes. Or in a package if you want the ability to reuse it in other apps (without having to copy files).
Comment by
WanWizard
June 2017
permalink
Custom Validation in Modules
We use a global rule class for those rules. You can add multiple classes.
Comment by
WanWizard
June 2017
permalink
Custom Validation in Modules
If you pass a string to add_callable(), make sure it's fully qualified, so "\Mymodule\Myrules".
Comment by
WanWizard
June 2017
permalink
Custom Validation in Modules
You mean: if I create a Validation object in my myrules controller which is in my mymodule module? the answer is yes, all the above options should work fine. I don't know how and where you have defined your own rules, and you try to use them, s…
Comment by
WanWizard
June 2017
permalink
Check Permission From Roles
You need to populate the database first. Assuming "administrator" is a Role, you need to create this role, and assign the user "admin" to it. Then you need to create the Permission records for that role. Your app will direct how …
Comment by
WanWizard
June 2017
permalink
Custom Validation in Modules
There are several ways of using custom validation rules, depending on your need. Extending the core validation is easy, all your own rules are available immediately and everywhere, but it isn't really clean, it creates a dependency if you'…
Comment by
WanWizard
June 2017
permalink
Check Permission From Roles
You need to know how to check it, or how to store it? To check: see https://fuelphp.com/docs/packages/auth/ormauth/usage.html To store: see https://fuelphp.com/docs/packages/auth/ormauth/intro.html#/acl
Comment by
WanWizard
June 2017
permalink
More Comments
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
About
Username
WanWizard
Joined
January 2011
Visits
2,369
Last Active
10:21AM
Roles
Administrator