Activate a component

@param string $component The component name to activate.

@return boolean Whether the component was activated.

@since 2.7.0
484182
public function activate_component( $component ) {

		$activated = false;

		if ( ! $this->is_component_active( $component ) ) {
			if ( empty( $this->components ) ) {
				// Setup components
				PodsInit::$components->get_components();
			}

			if ( isset( $this->components[ $component ] ) ) {
				$this->settings['components'][ $component ] = array();

				$this->update_settings( $this->settings );

				$activated = true;
			}
		} else {
			$activated = true;
		}//end if

		return $activated;

	}
491868
private function is_disabled( $component )
    {
        return 
            $component instanceof DisableableComponentInterface &&
            (
                true === $component->disabled ||
                true === $component->readonly
            );
    }
1155685
public function instance($name, $instance) {
		list($name, $alias) = $this->extractName($name);

		$componentName = $this->getAlias($name);

		if ($this->isSingleton($componentName) && $this->resolved($componentName)) {
			throw new ComponentRegisterException('Can\'t register component, The ' . $name . ' component is singleton, and it had resolved');
		}

		if (!is_null($alias)) {
			$this->alias($alias, $name);
		}

		$this->instances[$name] = $instance;
	}
337628
def component_activated(self, component):
        
        component.env = self
        super(Environment, self).component_activated(component)
545548
def activate(self, engine):
        

        LOGGER.debug("> Activating '{0}' Component.".format(self.__class__.__name__))

        self.__engine = engine
        self.__settings = self.__engine.settings
        self.__settings_section = self.name

        self.activated = True
        return True
1178514
private static function padRgbaComponent($component)
    {
        $result = \dechex($component);

        if (2 > \strlen($result)) {
            $result = '0' . $result;
        }

        return $result;
    }
644093
public function toggle( $component, $toggle_mode = false ) {

		$toggled = null;

		$toggle_mode = (boolean) pods_v( 'toggle', 'get', $toggle_mode );

		if ( $toggle_mode ) {
			$toggled = $this->activate_component( $component );
		} else {
			$this->deactivate_component( $component );

			$toggled = false;
		}

		return $toggled;

	}
400991
protected void activate(ComponentContext compcontext) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Activating " + this.getClass().getName());
        }
        this.unauthenticatedSubjectServiceRef.activate(compcontext);
    }
567613
public function activate($xmlBody = false)
    {
        $this->request($this->dataciteUrl . 'metadata/', $xmlBody);

        return $this->hasError() ? false : true;
    }
895237
public function update(Component $component)
    {
        try {
            execute(new UpdateComponentCommand(
                $component,
                Binput::get('name'),
                Binput::get('description'),
                Binput::get('status'),
                Binput::get('link'),
                Binput::get('order'),
                Binput::get('group_id'),
                Binput::get('enabled', $component->enabled),
                Binput::get('meta', null),
                (bool) Binput::get('silent', false)
            ));
        } catch (QueryException $e) {
            throw new BadRequestHttpException();
        }

        if (Binput::has('tags')) {
            $component->tags()->delete();

            // The component was added successfully, so now let's deal with the tags.
            Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) {
                return trim($tag);
            })->map(function ($tag) {
                return execute(new CreateTagCommand($tag));
            })->each(function ($tag) use ($component) {
                execute(new ApplyTagCommand($component, $tag));
            });
        }

        return $this->item($component);
    }
1145950
protected function check_plugin_is_installed(string $component) : Bool {
        if (!isset($this->checkedplugins[$component])) {
            $pluginmanager = \core_plugin_manager::instance();
            $plugin = $pluginmanager->get_plugin_info($component);
            $this->checkedplugins[$component] = !is_null($plugin);
        }
        return $this->checkedplugins[$component];
    }
155451
public function activate($id)
    {
        $user = $this->findById($id);

        try
        {
            if ( $user->attemptActivation($user->getActivationCode()) )
            {
                $this->event->fire('users.activate',array($user));
                return true;
            }
        }
        catch (UserAlreadyActivatedException $e){}


        return false;
    }
262021
public function matches($component)
    {
        $parts = explode('.', $component, 2);

        $key = $parts[0];
        $value = isset($parts[1]) ? $parts[1] : null;

        return $this->doesKeyOrValueMatch($key, $value);
    }
52262
public function callComponent($componentName)
    {
        if (!isset($this->components[$componentName])) {
            $requiredInterface = isset(static::$defaultComponents[$componentName][1])
                ? static::$defaultComponents[$componentName][1]
                : null;
            $componentConfig = isset(static::$defaultComponents[$componentName][2])
                ? static::$defaultComponents[$componentName][2]
                : [];
            if (isset($this->config['components'][$componentName])){
                $componentConfig = array_merge($componentConfig, $this->config['components'][$componentName]);
            }
            if (isset($componentConfig['class'])) {
                $componentClassName = $componentConfig['class'];
            } else {
                $componentClassName = isset(static::$defaultComponents[$componentName][0])
                    ? static::$defaultComponents[$componentName][0]
                    : null;
            }
            unset($this->config['components'][$componentName]);
            if (isset($componentConfig['class']))
            unset($componentConfig['class']);
            if ($componentClassName) {
                $instance = new $componentClassName($componentConfig, $this);
                if (null === $requiredInterface || ($instance instanceof $requiredInterface)) {
                    $this->components[$componentName] = $instance;
                } else {
                    throw new InvalidInterfaceException([$componentName, $componentClassName, $requiredInterface]);
                }
            } else {
                throw new UnknownComponentException($componentName);
            }
        }
        return $this->components[$componentName];
    }
1339019
private function update_value( $component, $value )
    {
        $component->set_value( $value );
        $this->final_instance[$component->get_name()] = $value;
    }
655565
public function insert($component)
    {
        if (is_string($component)) {
            $component = $this->getRepository()->fetch(array('component' => $component));
        }

        if ($component->isAssignable()) {
            $assignment = $component->assignments->findOrAddNew(array('actor' => $this->_actor));
        }

        if ($this->isLoaded()) {
            parent::insert($component);
        }
    }
1072151
public function setComponents($components)
	{
	    if ($components) foreach ($components as $k => $v) {
	        $v = static::formatDefinition($k, $v);
	        if (is_numeric($k)) {
	            $k = static::formatName($v);
	        }
	        $this->set($k, $v);
	    }
	}