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
how i can execute a module and get output?
Calling code cross-context is a bad thing to do, as it will destroy any loose coupling between components. You call a controller using an HMVC call: try { // assuming the method called returns HTML $html = \Request::forge('mymodone/co…
Comment by
WanWizard
July 2015
permalink
Use two auth drivers for two database tables
This is not going to work with the standard methods, Auth is designed around username and password. Are they using a different backend, in other words, could there be an admin user "abc" and one or more master users "abc" (each …
Comment by
WanWizard
July 2015
permalink
Migration creates unnesessary tables
Why would you submit a PR to not create them? Simply because you don't use them, and break it for a lot of other users? They are used/required by the Opauth component of Auth. The migrations can't smell you are not going to use that comp…
Comment by
WanWizard
July 2015
permalink
Can I control role of users and permission using ormauth?
No. Your config should be ok with it's default settings. What is cached, with which cache key, and how to deal with it, is all documented: http://docs.fuelphp.com/packages/auth/ormauth/intro.html#/caching
Comment by
WanWizard
July 2015
permalink
Can I control role of users and permission using ormauth?
If you use the Auth models, the array stored in the permission will automatically be expanded on read and serialized back on write, they use the typing observer for that purpose.
Comment by
WanWizard
July 2015
permalink
Can I control role of users and permission using ormauth?
Have you flushed the permission cache every time you changed the permission assignment, like is mentioned in the documenation? The current users efffective rights are cached to avoid heavy queries and calculations on each page request, so if you do…
Comment by
WanWizard
July 2015
permalink
where, when using related models and limit / offset with relation consistence
Read the documentation. Limit and Offset are applied on the parent model, to make sure the results are consistent. When you create a query with related objects, it could be that you get more or less records than defined by your limit. If you want …
Comment by
WanWizard
July 2015
permalink
Is there a tutorial or example on how to use the cache class?
No, it doesn't. If you want to renew it after a get(), you need to set() it again. The expiration is stored as part of the metadata of the cache object, as it has to function independently of the storage mechanism used.
Comment by
WanWizard
July 2015
permalink
What does the request class really do?
FuelPHP has HMVC built in as part of it's core. It means that requests can fire secondary requests, and that in turn means the main request (the one initialized by the client) is not always the active or current request. So this method returns…
Comment by
WanWizard
July 2015
permalink
Can I control role of users and permission using ormauth?
It can be anything you want, but using "module, controller" would be a logical grouping. I personally don't map permissions to code elements, but to functional sections of the application, so I would use something like area = "…
Comment by
WanWizard
July 2015
permalink
Can I control role of users and permission using ormauth?
Sorry, typo, my fault. It is a "many" relation, so it must be "permissions", not "permission".
Comment by
WanWizard
July 2015
permalink
Is there a tutorial or example on how to use the cache class?
It's very simple: try { // retrieve a value from cache $cached_value = \Cache::get('somevalue'); } catch (\CacheNotFoundException $e) { // not found in cache, construct the value $cached_value = 'some_value'…
Comment by
WanWizard
July 2015
permalink
Can I control role of users and permission using ormauth?
So you don't want to create permissions, you want to assign permissions? The most logical is to create the permission records in a migration, use a logical separation, for example the module name as area, so you can use has_access("hotel.…
Comment by
WanWizard
July 2015
permalink
Can I control role of users and permission using ormauth?
Yes, why not? Note that this only creates the permission record, it does not assign it to anything (user, group or role). Also, permissions are only useful when checked in the application. Unless that is going to be dynamic (i.e. the user can ad…
Comment by
WanWizard
July 2015
permalink
How to join tables in Orm relation
ORM queries are left joins by default. I personally never use find() and array notation, as it becomes messy and difficult to read very quickly, as you can see. ;-) This should work fine: $data['master_accounts'] =\Model_Master_Account…
Comment by
WanWizard
July 2015
permalink
Can I control role of users and permission using ormauth?
p.s. providers, scopes, sessions, and session scopes are OpAuth tables, the will only be used if you use Opauth (social media logins).
Comment by
WanWizard
July 2015
permalink
Can I control role of users and permission using ormauth?
users_permissions contain the permissions themselfs. users_role_permission relates roles to permissions, users_user_permissions relates users to permissions, users_group_permissions relates groups to permissions. All of them are many-many relations…
Comment by
WanWizard
July 2015
permalink
Email sending with cron jobs
That is not related to cron jobs afaik?
Comment by
WanWizard
July 2015
permalink
search in model relation
It's not wrong, there are two ways of coding ORM queries, one with find() and array notation, one wiith method chaining. I personally find the second one easier to read, which helps if you are working in a team and not all code is written by …
Comment by
WanWizard
July 2015
permalink
How to change data type and remove column in fuelphp
Or just code the migration by hand, once you have a few I find it easier to copy and change it than use oil magic, but I prefer to know exactly what is happening...
Comment by
WanWizard
July 2015
permalink
Model not loading?
Ah, a subview. Variables are not inherited automatically. If you have a view that includes sub-views, you need to pass the variables required to it explicitly. How is that view assigned to $body?
Comment by
WanWizard
July 2015
permalink
search in model relation
I personally hate this syntax, so I can't comment on it, perhaps something is wrong. Enable the profiler in your app config.php, enable database profiling in your db.php, and check what query that code generates. Perhaps you can spot the probl…
Comment by
WanWizard
July 2015
permalink
Email sending with cron jobs
Have a look at https://www.codeyellow.nl/queue.html You would have a cron job that fires the queue processor (every minute, 5 minutes), it would pick up any jobs in the queue. You could extend it to run time based jobs as well.
Comment by
WanWizard
July 2015
permalink
Email sending with cron jobs
Not sure I understand what you mean? What exactly do you want to manage?
Comment by
WanWizard
July 2015
permalink
Can I control role of users and permission using ormauth?
Configure your database config file, and configure auth (= copy the auth.php config from the package to your app/config folder and configure it) before you run the migrations. Auth migrations adapt to how you have configured it.
Comment by
WanWizard
July 2015
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:33PM
Roles
Administrator