@param string $id
@param bool   $on
@param bool   $echo

@return FS_Logger
492206
public static function get_logger( $id, $on = false, $echo = false ) {
			$id = strtolower( $id );

			if ( ! isset( self::$_processID ) ) {
				self::init();
			}

			if ( ! isset( self::$LOGGERS[ $id ] ) ) {
				self::$LOGGERS[ $id ] = new FS_Logger( $id, $on, $echo );
			}

			return self::$LOGGERS[ $id ];
		}
551653
public function read(int $id, int &$offset = 0, bool $cleanup = true)
    {
        $this->logger->beginProfile('read_' . $id);
        $key    = $this->getSharedItemKey($id);
        $sh     = shmop_open($key, 'a', 0, 0);
        $header = shmop_read($sh, 0, self::HEADER_SIZE);
        list($id, $off, $size, $flags) = $this->unpackHeader($header);
        $this->logger->debug(sprintf('Reading state: (key = 0x%08x, shmid = %d)', $key, $sh));
        $this->logger->debug(sprintf("State header: (id = %d, offset = %d, size = 0x%08x, flags = 0x%03x)", $id,
            $offset,
            $size, $flags));

        $result = shmop_read($sh, self::HEADER_SIZE, $size);
        $this->logger->debug(sprintf('State data: (size = 0x%08x)', mb_strlen($result, 'utf-8')));
        if ($cleanup) {
            shmop_delete($sh);
        }

        shmop_close($sh);

        $result = $this->getResult($result, $flags);
        $offset = $off;

        $this->logger->endProfile('read_' . $id, "Reading {$id} data");

        return $result;
    }
225477
function onIceCandidate(id,data)
    {
        if(scope.hasWebRTCSupport())
        {
            getOrCreatePeer(id).onServerMessage(JSON.parse(data));
        }
    }
916899
public function byId($id)
    {
        if ($user = $this->sentinel->getUserRepository()->findById($id)) {
            $this->sentinel->setUser($user);

            return true;
        }

        return false;
    }
263437
public function getDetailDownload($tab = false, $on = "")
    {
        empty($on) ? $on = "user" : ""; //by default always report on user

        //set title
        $this->title = $this->app->trans('report:: Detail des telechargements');

        $this->setDateField('log_docs.date');
        $sqlBuilder = new module_report_sql($this->app, $this);
        $filter = $sqlBuilder->getFilters()->getReportFilter();
        $params = array_merge([], $filter['params']);

        $sql = "
                SELECT TRIM(" . $on . ") AS " . $on . ", SUM(1) AS nb, log_docs.final, log.usrid
                FROM log_docs
                    INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_docs.log_id)
                    LEFT JOIN record ON (record.record_id = log_docs.record_id)
                WHERE (" . $filter['sql'] . ") AND !ISNULL(usrid)
                AND (log_docs.action = 'download' OR log_docs.action = 'mail')
                AND (log_docs.final = 'preview' OR log_docs.final = 'document')
                GROUP BY usrid";

// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);

        $stmt =  $sqlBuilder->getConnBas()->prepare($sql);
        $stmt->execute($params);
        $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
        $stmt->closeCursor();

        $save_user = "";
        $i = -1;
        $total = [
            'nbdoc'    => 0,
            'nbprev'   => 0,
        ];

        $this->setChamp($rs);

        $this->setDisplay($tab);

        foreach ($rs as $row) {
            $user = $row[$on];
            if (($save_user != $user) && ! is_null($user) && ! empty($user)) {
                if ($i >= 0) {
                    if (($this->result[$i]['nbprev'] + $this->result[$i]['nbdoc']) == 0) {
                        unset($this->result[$i]);
                    }
                }

                $i ++;

                $this->result[$i]['nbprev'] = 0;
                $this->result[$i]['nbdoc'] = 0;
            }

            //doc info
            if ($row['final'] == 'document' &&
                ! is_null($user) && ! is_null($row['usrid'])) {
                $this->result[$i]['nbdoc'] = ( ! is_null($row['nb']) ? $row['nb'] : 0);
                $this->result[$i]['user'] = empty($row[$on]) ?
                    "<i>" . $this->app->trans('report:: non-renseigne') . "</i>" : $row[$on];
                $total['nbdoc'] += $this->result[$i]['nbdoc'];
                $this->result[$i]['usrid'] = $row['usrid'];
            }
            //preview info
            if (($row['final'] == 'preview') &&
                ! is_null($user) &&
                ! is_null($row['usrid'])) {

                $this->result[$i]['nbprev'] += ( ! is_null($row['nb']) ? $row['nb'] : 0);

                $this->result[$i]['user'] = empty($row[$on]) ?
                    "<i>" . $this->app->trans('report:: non-renseigne') . "</i>" : $row[$on];
                $total['nbprev'] += ( ! is_null($row['nb']) ? $row['nb'] : 0);
                $this->result[$i]['usrid'] = $row['usrid'];
            }

            $save_user = $user;
        }

        unset($this->result[$i]);
        $nb_row = $i + 1;
        $this->total = $nb_row;

        if ($this->total > 0) {
            $this->result[$nb_row]['user'] = '<b>TOTAL</b>';
            $this->result[$nb_row]['nbdoc'] = '<b>' . $total['nbdoc'] . '</b>';
            $this->result[$nb_row]['nbprev'] = '<b>' . $total['nbprev'] . '</b>';
        }

        foreach($this->result as $k=>$row) {
            $_row = array();
            foreach((array) $tab as $k2=>$f) {
                $_row[$k2] = array_key_exists($k2, $row) ? $row[$k2] : '';
            }
            $_row['usrid'] = array_key_exists('usrid', $row) ? $row['usrid'] : '';
            $this->result[$k] = $_row;
        }

// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s) %s\n\n", __FILE__, __LINE__, var_export($this->result, true)), FILE_APPEND);

        $this->total = sizeof($this->result);
        $this->calculatePages();
        $this->setDisplayNav();
        $this->setReport();

        return $this->report;
    }
1255303
public function load($id) {
		if (isset($this->_helpers[$id])) {
			return $this->_helpers[$id];
		}
		
		$helper = $this->loadHelper($id);
		
		if ($helper === null) {
			return;
		}
		
		if ($this->_onInit !== null) {
			$this->_onInit->__invoke($helper);
		}
		
		if ($helper instanceof LocatorAwareInterface && ! $helper->hasLocator() && $this->hasLocator()) {
			$helper->setLocator($this->getLocator());
		}
		
		$this->_helpers[$id] = $helper;
		
		return $helper;
	}
627250
public function has($table,  $on, $server=null, $fields='', $joinType='left'){
		$joinType = $joinType.' JOIN';	
		$this->driver->join($table, $on, $server, $fields, $joinType);
		return $this;
	}
1193213
public function setHandler($id)
    {
        if (is_string($id)) {
            $this->handler = $this->file->getHandler($id);
        } else {
            $this->handler = $id;
        }

        return $this;
    }
361407
public function toggleAction($id)
    {
        /** @var Menus_Entity_Table_Menu $table */
        $table = ORM::getTable($this->plugin, 'Menu');
        /** @var Menus_Entity_Menu $menu */
        $menu = $table->find($id);

        if (!is_null($menu))
        {
            $menu->active = !$menu->active;
            $table->update($menu);
        }

        HTTP::redirect(str_replace('&amp;', '&', $this->ui->url()));
    }
1208643
public SqlBuilder on(String on) {
		if (StrUtil.isNotBlank(on)) {
			this.sql.append(" ON ").append(on);
		}
		return this;
	}
612874
static function instance( $id, $load = false ) {
            if ( ! isset( self::$_instances[ $id ] ) ) {
                self::$_instances[ $id ] = new FS_Options( $id, $load );
            }

            return self::$_instances[ $id ];
        }
1039180
public function _id($_id = false)
    {

        $this->_id = $_id;

        $this->filter[] = ["term" => ["_id" => $_id]];

        return $this;
    }
471917
public function start($id = false, $doNotDie = false)
    {
        $this->_cancel = false;
        $lastMatchingRegexp = null;
        if (isset($_SERVER['REQUEST_URI'])) {
            foreach ($this->_specificOptions['regexps'] as $regexp => $conf) {
                if (preg_match("`$regexp`", $_SERVER['REQUEST_URI'])) {
                    $lastMatchingRegexp = $regexp;
                }
            }
        }
        $this->_activeOptions = $this->_specificOptions['default_options'];
        if ($lastMatchingRegexp !== null) {
            $conf = $this->_specificOptions['regexps'][$lastMatchingRegexp];
            foreach ($conf as $key=>$value) {
                $this->_activeOptions[$key] = $value;
            }
        }
        if (!($this->_activeOptions['cache'])) {
            return false;
        }
        if (!$id) {
            $id = $this->_makeId();
            if (!$id) {
                return false;
            }
        }
        $array = $this->load($id);
        if ($array !== false) {
            $data = $array['data'];
            $headers = $array['headers'];
            if (!headers_sent()) {
                foreach ($headers as $key=>$headerCouple) {
                    $name = $headerCouple[0];
                    $value = $headerCouple[1];
                    header("$name: $value");
                }
            }
            if ($this->_specificOptions['debug_header']) {
                echo 'DEBUG HEADER : This is a cached page !';
            }
            echo $data;
            if ($doNotDie) {
                return true;
            }
            die();
        }
        ob_start(array($this, '_flush'));
        ob_implicit_flush(false);
        return false;
    }
1227315
public function onSession($id, array $data)
    {
        $data = $this->resolverFactory->createDeviceSessionResolver()->resolve($data);

        return $this->api->request('POST', '/players/'.$id.'/on_session', [], json_encode($data));
    }
11351
public function join($foreign, $on, $joinType = Joins::INNER)
    {
        $builder = $this->getJoinStatement()->getBuilder();
        $foreign = is_array($foreign) ? $foreign : [$foreign];
        $foreign[0] = !($foreign[0] instanceof Expression) ? new Table($foreign[0]) : $foreign[0];
        
        $foreign = $builder->completeExpression(...$foreign);
        
        if (is_array($on)) {
            $whereOn = new Statement\Where($builder);
            $on = count($on) === count($on, true) ? [$on] : $on;
            
            foreach ($on as $criteria) {
                list($criteria[0], $criteria[1]) = [
                    ($criteria[0] instanceof Expression) ? $criteria[0] : $builder->createColumn($criteria[0]),
                    ($criteria[1] instanceof Expression) ? $criteria[1] : $builder->createColumn($criteria[1]),
                ];
                $whereOn->where(...$criteria);
            }
            
            $on = $whereOn;
        }
        
        $this->addJoin($foreign, $on, $joinType);
        
        return $this;
    }
1336778
public function loginUsingId( $id, $remember = false )
	{
		$acct = $this->auth->retrieveById( $id );

		if ( !is_null( $acct ) )
		{
			$this->login( $acct, $remember );

			return $acct;
		}

		return false;
	}
273057
public function getOneById($id)
    {
        $plugin = $this->getById($id);
        if (!$plugin) {
            throw new Exception(sprintf('Plugin "%s" not found', $id));
        }

        return $plugin;
    }