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
Complex settings table (entities and i18n)
Nobody is stopping you from defining compound PK's, there is no reason why you should have to use an auto-incremental ID column. That's just a default. What you can do on the relation between a data Model and your entities Model is define …
Comment by
WanWizard
April 2019
permalink
Memory consumption is very high when ORM is used inside loops
Careful, there is a big difference between caching() which determines if you get a Cached object back (with all results) or a Result object (which you can only interate over sequentionally, and fetches one record at the time while you do) and cache…
Comment by
WanWizard
April 2019
permalink
Memory consumption is very high when ORM is used inside loops
$ret is a local variable, so PHP will delete that as soon as the method call ends. So there is no memory leak, memory use is temporary. Obviously, you are selecting data, which will be fetched all into memory and returned in a "cached" obj…
Comment by
WanWizard
April 2019
permalink
Memory consumption is very high when ORM is used inside loops
If you don't pass an argument to flush_cache(), it will use the name of the class it's called on, in your case Model_A.
Comment by
WanWizard
April 2019
permalink
Memory consumption is very high when ORM is used inside loops
There is no memory leak, ORM objects are cached by default to ensure data consistency. This makes sure that if you run two queries that result in the same record, those will be represented by the same object. Assuming your isRegister() method fetche…
Comment by
WanWizard
April 2019
permalink
Reflexion on when to use ORM and when not to
If you profile the ORM, the biggest difference in performance (as in 80-90%) between ORM and DB is the hydration into ORM objects. The exact figure depends a bit on the PHP version used, the ORM is relatively faster in 7.x than it is in 5.x. The cod…
Comment by
WanWizard
March 2019
permalink
Problems with pagination
As I wrote, the problem you have is with the relations. Say you run query with parents P and children C, and you use rows_limit(6), and the result is: row 1: P1 joined with C1row 2: P1 joined with C2row 3: P2 joined with C3row 4: P2 joined with C4r…
Comment by
WanWizard
March 2019
permalink
Problems with pagination
I can't see how you construct your query, but my guess is that it includes one-to-many or many-many relations. However, in that case I would expect this behaviour with rows() and limit(), rows_limit() and rows_offset() was meant to exactly fix …
Comment by
WanWizard
March 2019
permalink
Auth::check() always return false
Don't hijack another topic! If libsodium is not installed, and it can not be emulated, you'll get an error message? // check if we have sodium availableif ( ! is_callable('sodium_crypto_generichash') or ! is_callable('random…
Comment by
WanWizard
March 2019
permalink
FuelPHP 1.8.1.6 - paragonie/sodium_compat
It isn't broken afaik. If you get this message, it means Crypt::decode() gets a decoded string that is not encoded with the sodium keys in your crypt config file, and there are no legacy (pre-1.8.1) keys in your config file to try. It usually h…
Comment by
WanWizard
March 2019
permalink
I can not change DB connection from one to the other inside module
I can't reproduce that. See https://bin.fuelphp.com/snippet/view/O5 for my test code and result.
Comment by
WanWizard
March 2019
permalink
Email issues
A permanent solution for this is already implemented, through the smtp options array in the config. The settings from the example code translate to this config: 'options' => array( 'ssl' => array( …
Comment by
WanWizard
February 2019
permalink
Email issues
Thanks for the feedback, I'll add it to the todo list.
Comment by
WanWizard
February 2019
permalink
Table views and their columns
Saw it as soon as I pushed. Which was just to late. Immediately fixed. ;-)
Comment by
WanWizard
February 2019
permalink
Table views and their columns
No, views are (what ORM is concerned) an afterthought. And not very popular, since you've bumped into an issue above that has been present in the code since "custom_data" was introduced, back in 2013. Appearently nobody uses views (i…
Comment by
WanWizard
February 2019
permalink
Table views and their columns
After a quick look you might be right. Anything in _data[] must be defined in the models properties, and is checked and caught first. So by the time you get to the code in get() that deals with view data, it can't be in _data anymore. Which in …
Comment by
WanWizard
February 2019
permalink
Table views and their columns
I have never used Views in combination with the ORM, but that should work. I've looked at the hydrating code, and that just puts all results from the record in an array, which is then fed to Model::forge(). And all fields in the data array will…
Comment by
WanWizard
February 2019
permalink
Auth / ORM - Delete Auth_Group and associated permissions
If it has no side-effects, I'll push an update to the Auth package with this change. If it is wrong, it should be fixed at source, not worked around in your app...
Comment by
WanWizard
February 2019
permalink
Auth / ORM - Delete Auth_Group and associated permissions
There is a many-many relation between group and permission, meaning the same permission can be assigned to multiple groups (or users for that matter). So deleting a group should not delete the permission. If I look in the Auth_Group model, I see it …
Comment by
WanWizard
February 2019
permalink
Found bug in the Log class
Thanks, I'll have a look. This looks like from before we switched to using Monolog.
Comment by
WanWizard
February 2019
permalink
Found bug in the Log class
Not much information to go on. A log level "link" doesn't exist, so where does that come from?
Comment by
WanWizard
February 2019
permalink
Passing attributes to select options
No. The only attributes supported are "value" (obviously) and "selected" (through the "selected" key of the attribute array that can be passed to select(). It also hardcodes a "style" in case indentation is ne…
Comment by
WanWizard
February 2019
permalink
【Question】Regarding Log class
There is no functionality to rotate the logfile name, it is determined when the log class loaded. We generally use separate log files for tasks like that, so you get a log file per task run, instead of per day. To do so, at the top of the run() meth…
Comment by
WanWizard
February 2019
permalink
Nested set: how to get certain children?
Yours is probably working to because you just create a new query object. But is isn't the way it was intended to be used. ;-)
Comment by
WanWizard
February 2019
permalink
Nested set: how to get certain children?
Not sure what build_query() is doing there, it returns a new query object? $page->children()->where('slug', '=', $segment)->get(); should return the subset of children of that page, with that slug.
Comment by
WanWizard
February 2019
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,368
Last Active
3:49AM
Roles
Administrator