render element; when $force is FALSE a cached element rendering is re-used

@param boolean $force
@return string
@throws \vxPHP\Application\Exception\ApplicationException
@throws \vxPHP\Template\Exception\SimpleTemplateException
187032
public function render($force = false) {

		if(empty($this->html) || $force) {

            if($this->template) {

                parent::render();

            }

            else {

                $name = $this->parentElement->getName();
                $value = $this->getValue();

                if($this->selected) {
                    $this->attributes['checked'] = 'checked';
                }
                else {
                    unset($this->attributes['checked']);
                }

                if(!isset($this->attributes['id'])) {
                    $formId = $this->parentElement->getForm()->getAttribute('id');
                    $this->attributes['id'] = ($formId ? ($formId . '_') : '') . $name . '_' . $value;
                }

                $this->attributes['value'] = $this->getValue();
                $this->attributes['name'] = $this->parentElement->getName();

                $attr = [];

                foreach($this->attributes as $k => $v) {
                    $attr[] = sprintf('%s="%s"', $k, $v);
                }

                $this->html = sprintf(
                    '<input type="radio" %s>',
                    implode(' ', $attr)
                );

                if($this->label) {
                    $this->html .= $this->label->setAttribute('for', $this->attributes['id'])->render();
                }

            }

		}

		return $this->html;

	}
515929
public static function loadConfiguration($force = false)
    {
        if ($force === false && static::$isConfigurationLoaded === true)
        {
            return true;
        }

        if (class_exists('\Bitrix\Main\Config\Configuration'))
        {
            $config = Configuration::getInstance()->get('monolog');

            if (is_array($config) && !empty($config))
            {
                Cascade::fileConfig($config);

                return true;
            }
        }

        return false;
    }
1095926
public function stopProcessesCommand(bool $force = false)
    {
        $count = $this->processManager->killAllProcesses($force);
        $this->outputLine();

        if ($force === true) {
            $this->outputFormatted('<comment>force stopped %s</comment>', [
                $count === 1 ? '1 process' : $count . ' processes'
            ]);
        } else {
            $this->outputFormatted('<success>stopped %s</success>', [
                $count === 1 ? '1 process' : $count . ' processes'
            ]);
        }

        $this->outputLine();
        $this->outputFormatted('The processes will automatically restart during the next request');
        $this->outputLine();
    }
225960
public static function load($force = false) 
    {
        // already loaded
        if (!$force && self::$_loaded) {
            return false;
        }
        self::_resolveDefaultPath();

        $files = glob(realpath(self::$_path)."/*.php");
        foreach ($files as $file) {
            Log::log("loading factory from $file ...");
            include_once $file;
        }
        self::$_loaded = true;
        return self::$_loaded;
    }
480805
public function reset($force = false)
    {
        $this->isBroadcast = false;
        $this->to = [];

        if ($force) {
            $this->sender = null;
            $this->userId = null;
        }

        return $this;
    }
842199
final public function delete($force = false)
    {
        if ($force) {
            app('em')->remove($this);
        } else {
            $this->deletedAt = new DateTime();
            app('em')->persist($this);
        }
        app('em')->flush();
        return $this;
    }
1249168
public function renderJSON($force_echo = true, $region = null)
    {
        try {
            $this->renderAll();

            return json_encode(['success' => true,
                                'message' => 'Success',
                                'atkjs'   => $this->getJS($force_echo),
                                'html'    => $this->template->render($region),
                                'id'      => $this->name, ]);
        } catch (\Exception $exception) {
            $this->_rendered = false;
            $l = $this->add(new self());
            if ($exception instanceof \atk4\core\Exception) {
                $l->template->setHTML('Content', $exception->getHTML());
            } elseif ($exception instanceof \Error) {
                $l->add(new self(['ui' => 'message', get_class($exception).': '.
                                                            $exception->getMessage().' (in '.$exception->getFile().':'.$exception->getLine().')',
                    'error', ]));
                $l->add(new Text())->set(nl2br($exception->getTraceAsString()));
            } else {
                $l->add(new self(['ui' => 'message', get_class($exception).': '.$exception->getMessage(), 'error']));
            }

            return json_encode(['success' => false,
                                'message' => $l->getHTML(), ]);
        }
    }
348320
public function delete($force = false) {
        Event::trigger('record_before_delete', $this);
        $model = get_called_class();
        $pk = $this->getPkField();
        $id = $this->$pk;
        if (isset($id)) {
            $where[ $pk ] = $id;
            $delete_time = "delete_time";
            if (property_exists($model, $delete_time)) {
                if (!$force) {
                    $this->$delete_time = time();
                    $this->update();
                    return;
                }
            }
            DB::delete($this->getTable(), null)->where($pk, $id)->excuse();
        }
        //删除缓存
        /* @var $db_cache DBCache */
        $db_cache = Ioc::get(DBCache::class);
        $db_cache->recordWhereCacheDel($model, $this->cacheKeys(), $this->_db_data);
        $db_cache->recordCacheDel($model, $id);
    }
669586
public function info($force = null) {
		if (isset ( $force )) {
			$displayInfoAsString = ($force === true) ? true : false;
		} else {
			$displayInfoAsString = $this->_displayInfoAsString ();
		}
		return $this->loadView ( $this->_getFiles ()->getViewInfo (), [ "connected" => USession::get ( $this->_getUserSessionKey () ),"authURL" => $this->getBaseUrl (),"bodySelector" => $this->_getBodySelector () ], $displayInfoAsString );
	}
787531
public function output($format = 'json', $force = false)
	{
		// generate output
		if ($force || !$this->cache())
		{
			$this->generate();
		}

		// option to switch formats
		switch ($format)
		{
			case 'array':
				break;
			case 'php':
				$this->output = serialize($this->output);
				break;
			case 'json':
			default:
				$this->output = json_encode($this->output);
		}

		return $this->output;
	}
1174075
public function getUpdates($force = FALSE) {
		if (!$force) {
			$result = $this->cache->get('updates');
			if ($result) {
				return $result;
			}
		}

		// Make sure we're logged in and have a valid access token.
		if (!$this->auth_token || !$this->username) {
			return FALSE;
		}

		$timestamp = parent::timestamp();
		$result = parent::post(
			'/all_updates',
			array(
				'timestamp' => $timestamp,
				'username' => $this->username,
			),
			array(
				$this->auth_token,
				$timestamp,
			)
		);

		if (!empty($result->updates_response)) {
			$this->auth_token = $result->updates_response->auth_token;
			$this->cache->set('updates', $result->updates_response);
			return $result->updates_response;
		}

		return $result;
	}
995635
public function getJsApiTicket($force = false)
    {
        $time = time(); // 为了更精确控制.取当前时间计算
        $cache_name = 'wechat_jsapi_ticket_' . $this->corpId . '_' . $this->app;
        if ($this->_jsApiTicket === null || $this->_jsApiTicket['expire'] < $time || $force) {
            $result = $this->_jsApiTicket === null && !$force ? $this->getCache($cache_name, false) : false;
            if ($result === false) {
                if (!($result = $this->requestJsApiTicket())) {
                    throw new HttpException(500, 'Fail to get jsapi_ticket from wechat server.');
                }
                $result['expire'] = $time + $result['expires_in'];
                $this->trigger(self::EVENT_AFTER_JS_API_TICKET_UPDATE, new Event(['data' => $result]));
                $this->setCache($cache_name, $result, $result['expires_in']);
            }
            $this->setJsApiTicket($result);
        }
        return $this->_jsApiTicket['ticket'];
    }
1115160
public function hasTranslations(bool $force = false)
    {
        $this->getTranslations($force);

        return $this->translations_list->isFilled();

    }
512951
public function get_displaytitle( $force = false ) {

		if( !$force ) {
			return $this->displaytitle;
		}

		$tArray = array(
			'action' => 'query',
			'prop'   => 'info',
			'inprop' => 'displaytitle',
			'titles' => $this->title,
		);

		pecho( "Getting the title formatting for {$this->title}..\n\n", PECHO_NORMAL );

		$tRes = $this->wiki->apiQuery( $tArray );

		if( isset( $tRes['query']['pages'][$this->pageid]['displaytitle'] ) ) {
			$this->displaytitle = $tRes['query']['pages'][$this->pageid]['displaytitle'];
		} else $this->displaytitle = null;

		return $this->displaytitle;
	}
1281224
public function getCachePath($force = FALSE) {

		if($this->hasCache($force)) {
			return $this->path . self::CACHE_PATH.DIRECTORY_SEPARATOR;
		}

	}
730568
public function render($force_echo = true)
    {
        $this->renderAll();

        return
            $this->getJS($force_echo).
            $this->template->render();
    }
933550
public function compile($force = false)
    {
        $this->commandCaller->compile($this->configFile, $force, $this->target);
    }