findByIdentifier($this->code); if ($pluginObj) { $pluginInfo = $pluginObj->pluginDetails(); foreach ($pluginInfo as $attribute => $info) { $this->{$attribute} = $info; } } else { $this->name = $this->code; $this->description = 'Plugin has been removed from the file system.'; $this->orphaned = true; } } /** * Returns the current version for a plugin * @param string $pluginCode Plugin code. Eg: Acme.Blog * @return string */ public static function getVersion($pluginCode) { if (self::$versionCache === null) { self::$versionCache = self::lists('version', 'code'); } return isset(self::$versionCache[$pluginCode]) ? self::$versionCache[$pluginCode] : null; } }