Initialises the cache.

Once this has been done the cache is all set to be used.

@throws coding_exception if the instance has already been initialised.
@param cache_definition $definition
770406
public function initialise(cache_definition $definition) {
        if ($this->is_initialised()) {
            throw new coding_exception('This memcached instance has already been initialised.');
        }
        $this->definition = $definition;
        $this->isinitialised = true;
    }
815307
public static void initialize()
    {
        if (InfinispanCache.get().exists(AccessSet.UUIDCACHE)) {
            InfinispanCache.get().<UUID, AccessSet>getCache(AccessSet.UUIDCACHE).clear();
        } else {
            InfinispanCache.get().<UUID, AccessSet>getCache(AccessSet.UUIDCACHE)
                            .addListener(new CacheLogListener(AccessSet.LOG));
        }
        if (InfinispanCache.get().exists(AccessSet.IDCACHE)) {
            InfinispanCache.get().<Long, AccessSet>getCache(AccessSet.IDCACHE).clear();
        } else {
            InfinispanCache.get().<Long, AccessSet>getCache(AccessSet.IDCACHE)
                            .addListener(new CacheLogListener(AccessSet.LOG));
        }
        if (InfinispanCache.get().exists(AccessSet.NAMECACHE)) {
            InfinispanCache.get().<String, AccessSet>getCache(AccessSet.NAMECACHE).clear();
        } else {
            InfinispanCache.get().<String, AccessSet>getCache(AccessSet.NAMECACHE)
                            .addListener(new CacheLogListener(AccessSet.LOG));
        }
    }
57550
public function initialise(cache_definition $definition) {
        $this->definition = $definition;
        $this->cacheprefix = $this->storeprefix.$definition->generate_definition_hash().'__';
        return true;
    }
71539
protected function init() {
        $this->data['crud'] = 'r';
        $this->data['edulevel'] = self::LEVEL_OTHER;
        if (strstr($this->component, 'mod_') === false) {
            throw new \coding_exception('The event name or namespace is invalid.');
        } else {
            $this->modname = str_replace('mod_', '', $this->component);
        }
    }
191778
public function initialize()
    {
        if ($this->initialized) {
            throw new Exception('The Reflection Service can only be initialized once.', 1232044696);
        }
        $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
        $this->cacheIdentifier = 'ReflectionData_' . $frameworkConfiguration['extensionName'];
        $this->loadFromCache();
        $this->initialized = true;
    }
283220
private synchronized void initCache() {

    if (this.cache == null) {
      ClasspathFolder rootFolder = new ClasspathFolder(null, "");
      Set<String> resourceNames = this.reflectionUtil.findResourceNames("", true, ConstantFilter.getInstance(true));
      List<ClasspathFile> fileList = new ArrayList<>(resourceNames.size());
      for (String resource : resourceNames) {
        ResourcePathNode<Void> path = ResourcePathNode.create(resource);
        ClasspathFolder parent = createFolderRecursive(path.getParent(), rootFolder);
        ClasspathFile file = new ClasspathFile(parent, path.getName());
        parent.children.add(file);
        fileList.add(file);
      }
      this.cache = new Cache(rootFolder, fileList);
    }
  }
189417
protected void initCacheObject() {

        CmsImageCacheHelper helper = new CmsImageCacheHelper(getCms(), false, false, true);
        setKeys("" + helper.getFilesCount());
        setVariations("" + helper.getVariationsCount());
        setCurSize(CmsFileUtil.formatFilesize(helper.getVariationsSize(), getLocale()));
    }
1239486
public static void initialize()
    {
        if (InfinispanCache.get().exists(Company.UUIDCACHE)) {
            InfinispanCache.get().<UUID, Company>getCache(Company.UUIDCACHE).clear();
        } else {
            InfinispanCache.get().<UUID, Company>getCache(Company.UUIDCACHE)
                            .addListener(new CacheLogListener(Company.LOG));
        }
        if (InfinispanCache.get().exists(Company.IDCACHE)) {
            InfinispanCache.get().<Long, Company>getCache(Company.IDCACHE).clear();
        } else {
            InfinispanCache.get().<Long, Company>getCache(Company.IDCACHE)
                            .addListener(new CacheLogListener(Company.LOG));
        }
        if (InfinispanCache.get().exists(Company.NAMECACHE)) {
            InfinispanCache.get().<String, Company>getCache(Company.NAMECACHE).clear();
        } else {
            InfinispanCache.get().<String, Company>getCache(Company.NAMECACHE)
                            .addListener(new CacheLogListener(Company.LOG));
        }
    }
1333773
protected function addForeign(String $definition)
	{
		$this->runQueryWithExpression(Expressions::addForeign($this->tableName, $definition));
	}
556546
protected function _initCache()
    {
        if (!Cache::getConfig(static::$cacheConfig)) {
            Cache::setConfig(static::$cacheConfig, [
                'className' => $this->_getDefaultCacheConfigClassName(),
                'prefix' => static::$cacheConfig . '_' . $this->_identifier,
                'duration' => $this->getConfig('interval'),
            ]);
        }
    }
1342485
public function init()
	{
		parent::init();

		$db=$this->getDbConnection();
		$db->setActive(true);
		if($this->autoCreateCacheTable)
		{
			$sql="DELETE FROM {$this->cacheTableName} WHERE expire>0 AND expire<".time();
			try
			{
				$db->createCommand($sql)->execute();
			}
			catch(Exception $e)
			{
				$this->createCacheTable($db,$this->cacheTableName);
			}
		}
	}
977243
protected function initialize()
    {
        parent::initialize();
        $this->setSchemaDomainMapping(new Domain(PropelTypes::BOOLEAN, 'BOOLEAN'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::TINYINT, 'INT2'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::SMALLINT, 'INT2'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::BIGINT, 'INT8'));
        //$this->setSchemaDomainMapping(new Domain(PropelTypes::REAL, 'FLOAT'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::DOUBLE, 'DOUBLE PRECISION'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::FLOAT, 'DOUBLE PRECISION'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARCHAR, 'TEXT'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::BINARY, 'BYTEA'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::VARBINARY, 'BYTEA'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARBINARY, 'BYTEA'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::BLOB, 'BYTEA'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::CLOB, 'TEXT'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::OBJECT, 'BYTEA'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::PHP_ARRAY, 'TEXT'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::ENUM, 'INT2'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::SET, 'INT4'));
        $this->setSchemaDomainMapping(new Domain(PropelTypes::DECIMAL, 'NUMERIC'));
    }
345587
private function _initialize()
    {
        if ($this->getInitialized()) {
            return;
        }

        $params = $this->getParameters();
        if ($params !== null) {
            foreach ($params as $param) {
                if ('in' == $param->getName()) {
                    $this->setInputEncoding($param->getValue());
                } else {
                    if ('out' == $param->getName()) {
                        $this->setOutputEncoding($param->getValue());
                    }
                }
            }
        }

        $this->setInitialized(true);
    }
1205044
public function initialise(cache_definition $definition) {
        $keyarray = $definition->generate_multi_key_parts();
        $this->storeid = $keyarray['mode'].'/'.$keyarray['component'].'/'.$keyarray['area'].'/'.$keyarray['siteidentifier'];
        $this->store = &self::register_store_id($this->storeid);
        $maxsize = $definition->get_maxsize();
        $this->simpledata = $definition->uses_simple_data();
        $this->igbinaryfound = extension_loaded('igbinary');
        if ($maxsize !== null) {
            // Must be a positive int.
            $this->maxsize = abs((int)$maxsize);
            $this->storecount = count($this->store);
        }
    }
445093
public function init()
    {
        parent::init();

        $this->cache = $this->enabled ? Instance::ensure($this->cache, Cache::className()) : null;

        if ($this->cache instanceof Cache && $this->getCachedContent() === false) {
            $this->getView()->cacheStack[] = $this;
            ob_start();
            ob_implicit_flush(false);
        }
    }
104944
public function set_definition_mappings($definition, $mappings) {
        if (!array_key_exists($definition, $this->configdefinitions)) {
            throw new coding_exception('Invalid definition name passed when updating mappings.');
        }
        foreach ($mappings as $store) {
            if (!array_key_exists($store, $this->configstores)) {
                throw new coding_exception('Invalid store name passed when updating definition mappings.');
            }
        }
        foreach ($this->configdefinitionmappings as $key => $mapping) {
            if ($mapping['definition'] == $definition) {
                unset($this->configdefinitionmappings[$key]);
            }
        }
        $sort = count($mappings);
        foreach ($mappings as $store) {
            $this->configdefinitionmappings[] = array(
                'store' => $store,
                'definition' => $definition,
                'sort' => $sort
            );
            $sort--;
        }

        $this->config_save();
    }
633861
protected function _init() {
		$this->connection = $this->connection ?: new Memcached();
		$this->connection->addServers($this->_formatHostList($this->_config['host']));

		if ($this->_config['scope']) {
			$this->connection->setOption(Memcached::OPT_PREFIX_KEY, "{$this->_config['scope']}:");
		}
	}