$mapper->load(['servicename=?', $serviceName]); I can use load, find, findone but it's same
$mapper = new Mapper($f3->get('DB'), 'queuesystem');
while(true) {
Execute a SQL command
array|int|FALSE exec ( string|array $commands [, string|array $args = NULL [, int $ttl = 0 [, bool $log=TRUE ]]] )
$log
is a toggle switch for suppressing or enabling the log of executed commands. You can use it as a profiler as the processing time, in milliseconds, of every SQL command is logged as well./**
* Execute SQL statement(s)
* @return array|int|FALSE
* @param $cmds string|array
* @param $args string|array
* @param $ttl int|array
* @param $log bool
* @param $stamp bool
**/
function exec($cmds,$args=NULL,$ttl=0,$log=FALSE,$stamp=FALSE) {
$tag='';
if (is_array($ttl))
And no memory leaks......
There is only a problem now, I need to use load() for my business, there is a way to disable logs of exec() using load() without change the F3 source code?
EDIT: I've noticed that in this method there is a check:
if ($this->log===FALSE)
$log=FALSE;
and the method:
function log($flag=TRUE) {...............
so if I call ->log(FALSE);
I can disable logging?
EDIT2:
$db = new SQL(...);
$db->log(FALSE);
make use in loop of ->load(...) = no memory leaks anymore
Thanks all! :)
If $sql is your sql object, you can do
$sql->log(FALSE);
To disable logging.
- Rich
From: SoftWord via Fat-Free Framework <f3-framework+APn2wQcnFeBkUoDM53w...@googlegroups.com>
Date: Tuesday, October 9, 2018 at 3:45 AM
To: Fat-Free Framework <f3-fra...@googlegroups.com>
Subject: [f3-framework] Re: Possible memory leak in all load, find, findone methods
I can't trust.........it works!!! I've changed sql.php in this way:
/**
* Execute SQL statement(s)
* @return array|int|FALSE
* @param $cmds string|array
* @param $args string|array
* @param $ttl int|array
* @param $log bool
* @param $stamp bool
**/
function exec($cmds,$args=NULL,$ttl=0,$log=FALSE,$stamp=FALSE) {
$tag='';
if (is_array($ttl))
And no memory leaks......
There is only a problem now, I need to use load() for my business, there is a way to disable logs of exec() using load() without change the F3 source code?
Il giorno lunedì 8 ottobre 2018 23:01:34 UTC+2, Vester ha scritto:
When you iterate over a query that is executed a lot of times, I've found that you should set $log to FALSE to avoid filling up RAM. Mapper uses SQL Class.
exec
Execute a SQL command
array|int|FALSE exec ( string|array $commands [, string|array $args = NULL [, int $ttl = 0 [, bool $log=TRUE ]]] )
The
$log
is a toggle switch for suppressing or enabling the log of executed commands. You can use it as a profiler as the processing time, in milliseconds, of every SQL command is logged as well.
El lunes, 8 de octubre de 2018, 17:51:55 (UTC-3), SoftWord escribió:The memory leak appear everytime you use load/find/findone etc......initiaize inside or outsite it's same.
Try to make only while......new mapper without load, you don't have any leak.
But when you add load etc after 3rd loop leak start.
Il giorno lunedì 8 ottobre 2018 20:24:06 UTC+2, ved ha scritto:Is there any reason to initialize the mapper inside the loop?
And is there any difference if you do something like the following:
$mapper = new Mapper($f3->get('DB'), 'queuesystem');
while(true) {
$mapper->load(['servicename=?', $serviceName]);
}
--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more
options, visit this group at
https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
f3-framework...@googlegroups.com.
To post to this group, send email to
f3-fra...@googlegroups.com.
Visit this group at https://groups.google.com/group/f3-framework.
To view this discussion on the web visit
https://groups.google.com/d/msgid/f3-framework/15bd27f0-a449-4b47-8dd6-2545ed7a6b6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.