Returns the plugin identifiers that are required by the supplied plugin.
@param  string $plugin Plugin identifier, object or class
@return array
977333
public function getDependencies($plugin)
    {
        if (is_string($plugin) && (!$plugin = $this->findByIdentifier($plugin))) {
            return false;
        }

        if (!isset($plugin->require) || !$plugin->require) {
            return null;
        }

        return is_array($plugin->require) ? $plugin->require : [$plugin->require];
    }
697395
public function getBundle($plugin)
    {
        $shortName = $this->getPluginShortName($plugin);

        foreach ($this->getInstalledBundles() as $bundle) {
            if ($bundle['instance']->getName() === $shortName) {
                return $bundle['instance'];
            }
        }

        return null;
    }
640442
public function getIdentifierValues($entity)
    {
        if ($this->isIdentifierComposite) {
            $id = array();

            foreach ($this->identifier as $idField) {
                $value = $this->reflFields[$idField]->getValue($entity);

                if ($value !== null) {
                    $id[$idField] = $value;
                }
            }

            return $id;
        }

        $id = $this->identifier[0];
        $value = $this->reflFields[$id]->getValue($entity);

        if (null === $value) {
            return array();
        }

        return array($id => $value);
    }
107969
public function scanPlugin($plugin)
    {
        if (!Plugin::isLoaded($plugin)) {
            return [];
        }
        $path = Plugin::classPath($plugin);
        $namespace = str_replace('/', '\\', $plugin);
        $prefix = Inflector::underscore($plugin) . '.';

        $commands = $this->scanDir($path . 'Command', $namespace . '\Command\\', $prefix, []);
        $shells = $this->scanDir($path . 'Shell', $namespace . '\Shell\\', $prefix, []);

        return array_merge($shells, $commands);
    }
65062
public function getEntity($plugin)
    {
        $plugin = Inflector::camelize($plugin);
        $slug   = Str::low($plugin);
        $entity = $this->_controller->Extensions->findBySlug($slug)->first();
        if ($entity === null) {
            $entity = $this->_controller->Extensions->newEntity([
                'params' => [],
                'slug'   => $slug,
                'name'   => $plugin
            ]);

            $config = Plugin::getData($plugin, 'meta');
            $entity
                ->set('core', $config->get('core', false))
                ->set('name', $config->get('name', $plugin));
        }

        return $entity;
    }
866733
public function validatePlugin($plugin)
    {
        if($plugin instanceof AdapterInterface) {
            return;
        }

        throw new InvalidPluginException(sprintf(
            'Plugin of type %s is invalid; must implement %s\AdapterInterface and set ID',
            (is_object($plugin) ? get_class($plugin) : gettype($plugin)),
            __NAMESPACE__
        ));
    }
1159705
public function getDiRequirements($className)
    {
        if (!isset($this->classCache[$className])) {
            $reflectionClass = new \ReflectionClass($className);
            $injects = [];
            // get all defined properties
            $props = $reflectionClass->getProperties();
            foreach ($props as $prop) {
                $inject = $this->annotationReader->getPropertyAnnotation(
                    $prop,
                    'Slender\Core\DependencyInjector\Annotation\Inject'
                );
                if ($inject) {

                    // Get the DI identifier
                    $identifier = $inject->getIdentifier();
                    if (!$identifier) {
                        $identifier = Util::hyphenCase($prop->getName());
                    }

                    $data = array(
                        'identifier' => $identifier,
                        'isPublic' => $prop->isPublic(),
                        'setter' => false
                    );

                    // Is there a setter method (cos its still faster andrew...)
                    if (!$prop->isPublic()) {
                        $setter = Util::setterMethodName($prop->getName());
                        if (method_exists($className, $setter)) {
                            $data['hasSetter'] = $setter;
                        };
                    };

                    $injects[$prop->getName()] = $data;
                }
            }
            $this->classCache[$className] = $injects;
        }
        return $this->classCache[$className];
    }
43332
protected function findTagsByIdentifier(string $identifier): array
    {
        $tags = $this->memcache->get($this->identifierPrefix . 'ident_' . $identifier);
        return ($tags === false ? [] : (array)$tags);
    }
704138
protected function getPluginClasses($refresh = false)
    {
        if ($refresh || !$this->pluginClasses) {
            $this->pluginClasses = [];
            $files = $this->globByDirs($this->dirs, '/Plugin.php');
            foreach ($files as $file) {
                $class = $this->guessClassName($file);

                $name = explode('\\', $class)[1];
                $name = $this->dash($name);

                $this->pluginClasses[$name] = $class;
            }
            ksort($this->pluginClasses);
        }

        return $this->pluginClasses;
    }
302564
protected function getPlugins(): array
    {
        if ($this->plugins) {
            return $this->plugins;
        }

        // Load WordPress's plugin helper functions.
        require_once ABSPATH.'wp-admin/includes/plugin.php';

        $plugins = array_diff_key(
            get_plugins('/'.$this->getRelativePath()),
            get_mu_plugins()
        );

        $this->plugins = array_unique($plugins, SORT_REGULAR);

        return $this->plugins;
    }
1029910
public function listNewVersions($plugin)
    {
        $code = is_string($plugin) ? $plugin : $this->pluginManager->getIdentifier($plugin);

        if (!$this->hasVersionFile($code)) {
            return [];
        }

        $databaseVersion = $this->getDatabaseVersion($code);
        return $this->getNewFileVersions($code, $databaseVersion);
    }
23765
public static function plugin($plugin)
    {
        $templates = [];

        foreach (App::path('Template', $plugin) as $path) {
            $templates = array_merge($templates, static::iteratePath($path));
        }

        return $templates;
    }
633741
public function getPluginClasses()
    {
        $arr = array();

        foreach ($this->pluginInformations as $single) {
            $arr = array_merge($arr, $single->getPluginClasses());
        }

        return $arr;
    }
910960
public function getInternalPlugins()
    {
        // Return only plugins with no custom url
        $plugins = [];
        foreach ($this->getPlugins() as $name => $url) {
            if (empty($url)) {
                $plugins[] = $name;
            }
        }
        return $plugins;
    }
880126
public function get_plugin_info($component) {
        list($type, $name) = core_component::normalize_component($component);
        $plugins = $this->get_plugins_of_type($type);
        if (isset($plugins[$name])) {
            return $plugins[$name];
        } else {
            return null;
        }
    }
191949
private function getPluginDefinition(string $handle, array $pluginInfo): array
    {
        $settings = null;
        $plugin = Craft::$app->plugins->getPlugin($handle);
        if ($plugin) {
            $settings = $plugin->getSettings();
        }

        return [
          'isEnabled' => $pluginInfo['isEnabled'],
          'isInstalled' => $pluginInfo['isInstalled'],
          'settings' => $settings ? $settings->attributes : [],
        ];
    }
535096
protected function getIdentifier($entity)
    {
        $entityId = json_decode($this->entityRegistry->getEntityId($entity), true);

        if (is_array($entityId)) {
            $identifier = [];

            foreach ($entityId as $key => $value) {
                $key              = strtolower(Normalise::toUnderscoreSeparated(Normalise::fromCamelCase($key)));
                $identifier[$key] = $value;
            }

            return $identifier;
        }

        $primary = $this->builder->getMeta(get_class($entity))->primary;

        return [$primary => $entityId];
    }