Source of file AssetCommitterFactory.php
Size: 1,263 Bytes - Last Modified: 2021-12-23T10:50:47+00:00
/var/www/docs.ssmods.com/process/src/code/AssetCommitterFactory.php
12345678910111213141516171819202122232425262728293031323334353637383940414243 | <?php // Support SilverStripe versions lower than 3.7: if (!class_exists('SS_Object')) class_alias('Object', 'SS_Object'); class AssetCommitterFactory extends SS_Object { /** * @conf string */ private static $committer_class = GitAssetCommitter::class; /** * @return AssetCommitterInterface * @throws AssetCommitterFactoryException */ public static function getCommitter() { /** @var AssetCommitterInterface $committer */ static $committer; if (!$committer) { $committer_class = static::config()->committer_class; if (!ClassInfo::classImplements($committer_class, AssetCommitterInterface::class)) { $error = __METHOD__ . ': YAML configuration value for "' . static::class . '.committer_class" should be a class name that implements the ' . AssetCommitterInterface::class . ' interface.'; if (class_exists($committer_class)) { $error .= ' The class name "' . $committer_class . '" exists but is either a wrong class, or maybe the class is missing an "implements" clause.'; } else { $error .= ' The class name "' . $committer_class . '" does not exist.'; } throw new AssetCommitterFactoryException($error); } $committer = singleton($committer_class); } return $committer; } } |