Enable / disable the profiler

@param bool $enabled
543596
public function setProfilerStatus($enabled = true) {
		$this->_profilerEnabled = (bool) $enabled;
		
		if ($this->_profilerEnabled && ! $this->_profilerResolved) {
			$eventsManager = $this->getEventsManager();
			
			if ($eventsManager === null) {
				$eventsManager = new Manager();
				
				$this->setEventsManager($eventsManager);
			}
			
			$eventsManager->attach('db:beforeQuery', function($event, $db) {
				if ($this->_profilerEnabled) {
					$query    = $db->getSQLStatement();
					$profiler = $this->getProfiler();
					
					$action = substr($query, 0, strpos($query, ' '));
					
					if ($action === 'SELECT') {
						$profiler->startRead($query);
					}
					else if ($action === 'UPDATE') {
						$profiler->startWrite($query);
					}
					else if ($action === 'INSERT') {
						$profiler->startInsert($query);
					}
					else if ($action === 'DELETE') {
						$profiler->startDelete($query);
					}
					else {
						$profiler->startInfo($query);
					}
				}
			});
			
			$eventsManager->attach('db:afterQuery', function($event, $db) {
				if ($this->_profilerEnabled) {
					$this->getProfiler()->stopEvent();
				}
			});
			
			$this->_profilerResolved = true;
		}
	}
1112582
public function enabled($enable = null)
    {
        if (!func_num_args()) {
            return $this->_enabled;
        }
        $this->_enabled = $enable;
        return $this;
    }
439613
public function includeInactive($enable = true)
    {
        $this->includeInactive = (bool) $enable;

        $this->refreshSettingDependentCriteria();

        return $this;
    }
1260574
def enable_disable(self):
        
        if self.enabled:
            self.data['enabled'] = False
        else:
            self.data['enabled'] = True
        self.update()
1239299
public function escape($enabled = true)
    {
        if (!is_bool($enabled)) {
            return false;
        }
        $this->setConfig('escape', $enabled);
        Configure::write('Altair.escape', $this->getConfig('escape'));
        return true;
    }
71459
public function isEnabled($id = false)
    {
        $user = $id ? $this->getUser($id) : $this->getCurrentUser();

        return (bool) $user['enabled'];
    }
74435
public function enableCache($enabled = true)
    {
        if ($enabled && extension_loaded('apcu')) {
            $this->_cache = true;
        } else {
            $this->_cache = false;
        }

        return $this->_cache;
    }
1168804
public function getByEnabled($enabled = true)
    {
        $disabledPluggables = [];
        $enabledPluggables = [];

        $pluggables = $this->all();

        // Iterate through each pluggable
        foreach ($pluggables as $pluggable) {
            if ($this->isEnabled($pluggable['slug'])) {
                $enabledPluggables[] = $pluggable;
            } else {
                $disabledPluggables[] = $pluggable;
            }
        }

        if ($enabled === true) {
            return $this->sortByOrder($enabledPluggables);
        }

        return $this->sortByOrder($disabledPluggables);
    }
478732
public function enabled($enabled = true)
    {
        if (is_bool($enabled)) {
            return $this->andWhere(['enabled' => $enabled == true ? 1 : 0]);
        }
        return $this;
    }
1084845
public function toggle($enable = null)
    {
        /** @var \yii\db\ActiveRecord $model */
        $model = $this->owner;
        if (($c = $this->enabledAttribute) !== null) {
            $model->$c = $enable === null ? !$model->$c : $enable;
            return $model->save(false, [$c]);
        } elseif (($c = $this->disabledAttribute) !== null) {
            $model->$c = $enable === null ? !$model->$c : !$enable;
            return $model->save(false, [$c]);
        }
        return null;
    }
1143950
protected function enableProject($enable, $project)
    {
        $project->timestamps = false;

        $project->enabled = $enable;

        $project->save();
    }
595707
public function setSandboxMode($enable)
    {
        if ($enable instanceof SandBoxMode) {
            $sandbox_mode = $enable;
            $this->sandbox_mode = $sandbox_mode;
            return;
        }
        $this->sandbox_mode = new SandBoxMode($enable);
        return;
    }
153457
private function setData($disabled = TRUE) {
    $this->userData->set('social_tour', $this->currentUser->id(), 'onboarding_disabled', $disabled);
  }
570955
public function setSiteSpecificUserAgentExcludeEnabled($enabled)
    {
        Piwik::checkUserHasSuperUserAccess();

        // update option
        Option::set(self::OPTION_SITE_SPECIFIC_USER_AGENT_EXCLUDE_ENABLE, $enabled);

        // make sure tracker cache will reflect change
        Cache::deleteTrackerCache();
    }
48985
public function disableReset(bool $disable = true)
    {
        if ($disable) {
            array_delete($this->buttons, 'reset');
        } elseif (!in_array('reset', $this->buttons)) {
            array_push($this->buttons, 'reset');
        }

        return $this;
    }
605421
public static function isEnabled()
    {
        if (!self::$_checkedEnabled) {
            self::$_checkedEnabled = true;

            $conf = self::getConfiguration();

            $enabled = false;
            if (strtolower($conf->trigger) == 'always') {
                $enabled = true;
            } elseif (strtolower($conf->trigger) == 'parameter') {
                if ((isset($_GET['profile']) && $_GET['profile'] == true) || (isset($_COOKIE['profile']) && $_COOKIE['profile'] == true)) {
                    $enabled = true;
                }
            }

            // Process filters
            if ($enabled && $conf->enableFilters) {

                // sampling filter
                if ($enabled && rand(0,100000) > $conf->filters->sampling * 1000) {
                    $enabled = false;
                }

                // request uri whitelist/blacklist
                $requestUri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; // TODO: use script name instead for cli?
                if ($enabled && $conf->filters->requestUriWhiteList && !preg_match($conf->filters->requestUriWhiteList, $requestUri)) {
                    $enabled = false;
                }
                if ($enabled && $conf->filters->requestUriBlackList && preg_match($conf->filters->requestUriBlackList, $requestUri)) {
                    $enabled = false;
                }

                // note: timeThreshold and memoryThreshold will be checked before persisting records. In these cases data will still be recorded during the request
            }

            if ($enabled) {
                self::enable();
            }
        }
        return self::$_enabled;
    }
929210
function isEnabled( $useCache = true )
    {
        if ( isset( $this->UserCache['info'][$this->ContentObjectID]['is_enabled'] ) && $useCache )
        {
            return $this->UserCache['info'][$this->ContentObjectID]['is_enabled'];
        }

        $setting = eZUserSetting::fetch( $this->attribute( 'contentobject_id' ) );
        if ( $setting and !$setting->attribute( 'is_enabled' ) )
        {
            return false;
        }
        return true;
    }