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
Handling redirect URL when session is timeout
There is no mechanism to detect a user timeout, such a timeout doesn't exist. The login times out simply because the session times out, and when that happens, the session is gone. You might be able to access expired sessions in the database, bu…
Comment by
WanWizard
May 2017
permalink
Relations: Many To Many
Sorry, my mistake, made a typo in the example. And also sorry, but I'm not going to write your application for you. If you want that, we have a paid service you can use. ;-)
Comment by
WanWizard
May 2017
permalink
Relations: Many To Many
One to many and many to many relations work exactly the same from the point of the parent, both are represented by an array of child objects. So assuming $_POST['user_roles'] is an array of Auth\Model_Role id's, you can simply do $use…
Comment by
WanWizard
May 2017
permalink
Relations: Belongs To
You pass the User structure as objects, so $user->group->name should work fine. You probably only have to check in your view that $user->group is an object, which it isn't if the user does not have a group assigned, or has assigned a g…
Comment by
WanWizard
May 2017
permalink
Relations: Belongs To
I don't know. Do you pass data to your view as an array? What does var_dump($user->group) show you? It should be an Auth\Model_Group object.
Comment by
WanWizard
May 2017
permalink
Relations: Belongs To
Check the model to see how the relation is defined. \Auth\Model_User defines: /** * @var array belongs_to relationships */ protected static $_belongs_to = array( 'group' => array( 'model_to' => 'Model\\Auth_Group…
Comment by
WanWizard
May 2017
permalink
Best pratics to integrate with API
If it is a common payment service API, chances are there is already a package for it. If not, and you need to create something yourself, I suggest you have a look at http://omnipay.thephpleague.com/ and make a custom driver for it. It will save you …
Comment by
WanWizard
May 2017
permalink
Best pratics to integrate with API
With integrate, you want you need to call it from your app? If so, a package would be the best option, as it would make it easily reusable. It doesn't have to be a Fuel package, a standard PSR-4 composer package would do to, with the added bene…
Comment by
WanWizard
May 2017
permalink
Relation work but re-called anyway
You can use ->from_cache(false)-> to disable caching on a per-query basis. In 1.9/develop, you can disable the cache completely, using config, and use ->from_cache(true)-> to explicitly cache the query. In general, it is worth while to t…
Comment by
WanWizard
May 2017
permalink
Relation work but re-called anyway
I wouldn't know why that would happen with that specific query. Was that collaborator record already fetched and loaded from cache perhaps, which the cached version not having the relation loaded? Can you test it in case where you are absolutel…
Comment by
WanWizard
May 2017
permalink
Fuel\Core\PhpErrorException [ Fatal Error ]: Input truncated by PHP
Very weird. If you have only two form fields, and the error message says you need at least two more, it suggests that ini_get('max_input_vars') returns zero (or something that evaluates to zero). Can you var_dump(ini_get('max_input_va…
Comment by
WanWizard
May 2017
permalink
Fuel\Core\PhpErrorException [ Notice ]:
Correct. Anything you pass to the View object is encoded by default, including ORM objects. So any injected javascript (for example) is rendered harmless. The third argument is true by default, it is configured in your config.php ("security.aut…
Comment by
WanWizard
May 2017
permalink
Fuel\Core\PhpErrorException [ Notice ]:
That would be the best solution. But even if you don't validate, passing Input::post() from the controller into the View would cause all input data to be encoded, and rendered harmless,
Comment by
WanWizard
May 2017
permalink
Fuel\Core\PhpErrorException [ Notice ]:
Brr... If Oil generates that, it urgently needs to go on the todo list. https://github.com/fuel/oil/issues/254
Comment by
WanWizard
May 2017
permalink
Fuel\Core\PhpErrorException [ Notice ]:
Form::input() requires a string as second argument, as per the documentation. you are passing an array here, because you've commented out the second argument. Now that I see what you do, it is even worse. By using Input::post() in your View, yo…
Comment by
WanWizard
May 2017
permalink
Fuel\Core\PhpErrorException [ Notice ]:
Where is this code from? Your own code? Why would you want to call Input::post() in a form, that is very bad coding practice, a View should not contain any logic. We develop on 7.0.18, and haven't seen any error of this kind, in any of our apps.
Comment by
WanWizard
May 2017
permalink
Best way to store userinformation
Fuel's Auth package stores the userid in the remember-me cookie, using a second session instance of type "cookie", with encryption. The rest doesn't make much sense. No matter how you do it, you need something in the remember-me …
Comment by
WanWizard
May 2017
permalink
Best way to store userinformation
If you use Fuel's session class, and you use either the cookie driver + encryption, or you use a server-side storage driver ( = all others), and you make sure you haven't disabled session id rotation, you are quite safe against session hij…
Comment by
WanWizard
May 2017
permalink
web.config for IIS10
What makes it different / better from the one that is included with Fuel?
Comment by
WanWizard
May 2017
permalink
How set default value for from_cache ?
Cool, thanks for the feedback.
Comment by
WanWizard
May 2017
permalink
How set default value for from_cache ?
This should fix it: https://github.com/fuel/orm/commit/5a8fd186ae937b09034574628a62dbcbd28ffc8c
Comment by
WanWizard
May 2017
permalink
How set default value for from_cache ?
Hmm... You might have a point. I'll have a look.
Comment by
WanWizard
May 2017
permalink
troubleshooting intermittent MySQL errors (FuelPHP 7.1, PHP 5.6, MySQL 5.6.34)
"check configs" was a typo, I meant "check logs". ;) I can imagine with a process design like that, it can't cope very well with multiple processes running simultaneously. Perhaps you need to create a semaphore mechanism, to…
Comment by
WanWizard
May 2017
permalink
troubleshooting intermittent MySQL errors (FuelPHP 7.1, PHP 5.6, MySQL 5.6.34)
Connection time out is controlled by a server setting. In a datacenter setup, it could also be a firewall or a loadbalancer that closes the connection prematurely. If you know the rough time at which the error is occuring (you should be able to get…
Comment by
WanWizard
May 2017
permalink
Issue on selecting an ORM with relations
You have to be very careful with fetching partial results, due to the caching mechanism. If you bump into this issue, it suggests that your code somewhere else does that, so perhaps you need to review that, as disabling the cache will have a perform…
Comment by
WanWizard
May 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
2:24PM
Roles
Administrator