classname
stringlengths
2
79
method_name
stringlengths
3
5.05k
description
stringlengths
6
3.95k
method_code
stringlengths
7
8.51k
explanation
stringclasses
1 value
TCMSCronjob_ClearAtomicLocks
_ExecuteCron
* @return void
$this->clearTable();
-
ChameleonSystemAtomicLockExtension
load
* {@inheritDoc} * * @return void
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); $loader->load('services.xml');
-
AtomicLock
getKeyForObject
* The AtomicLock Class allows you to acquire a temporary lock bound to an id/key. * The way you should use it is as follow:. * * $oAtomicLock = new AtomicLock(); * $oLock = $oAtomicLock->acquireLock("mykey"); * if(null === $oLock){ * // already locked from another process * } else { * // do lockworthy stuff * $oLock->release(); * } * * The Lock is being acquired atomically, so there will always be only one lock * per given id. * * There is a CronJob, that currently kills all locks every 10 minutes. * This should not be the final solution, as it possible, that in a * very unlikely case, the atomic nature will break because of this.
return md5(serialize($oObject));
-
AtomicLock
acquireLock
* @var string
if (null !== $this->key) { return null;
-
AtomicLock
release
* @var string
if (null === $this->key) { return false;
-
AutoclassesCacheWarmer
__construct( AutoclassesManagerInterface $autoClassManager, AutoclassesDatabaseAdapterInterface $databaseAdapter, AutoclassesMapGeneratorInterface $autoclassesMapGenerator, IPkgCmsFileManager $filemanager, $cacheDir, ContainerInterface $container )
* @var AutoclassesDatabaseAdapterInterface
$this->autoClassManager = $autoClassManager; $this->databaseAdapter = $databaseAdapter; $this->autoclassesMapGenerator = $autoclassesMapGenerator; $this->fileManager = $filemanager; $this->cacheDir = $cacheDir; \ChameleonSystem\CoreBundle\ServiceLocator::setContainer($container);
-
AutoclassesCacheWarmer
warmUp
* @var AutoclassesManagerInterface
$this->updateAllTables(); return [];
-
AutoclassesCacheWarmer
isOptional
* @var AutoclassesMapGeneratorInterface
return false;
-
AutoclassesCacheWarmer
updateTableById
* @var IPkgCmsFileManager
$tablename = $this->databaseAdapter->getTableNameForId($id); if (null !== $tablename) { $this->updateTableByName($tablename);
-
AutoclassesCacheWarmer
updateTableByName
* @var string
$classesToCreate = $this->getClassListForTableName($tablename); foreach ($classesToCreate as $classToCreate) { $this->autoClassManager->create($classToCreate, $this->cacheDir);
-
AutoclassesCacheWarmer
updateAllTables
* @param AutoclassesManagerInterface $autoClassManager * @param AutoclassesDatabaseAdapterInterface $databaseAdapter * @param AutoclassesMapGeneratorInterface $autoclassesMapGenerator * @param IPkgCmsFileManager $filemanager * @param string $cacheDir
$targetDir = $this->cacheDir; $autoclassesExistedBefore = false; if (file_exists($targetDir)) { $targetDir = $this->createTempCacheDir(); $autoclassesExistedBefore = true;
-
AutoclassesCacheWarmer
getTableClassNamesToLoad
* @param string $id * * @return void
// get all table classes $result = $this->databaseAdapter->getTableClassList(); $convertedList = array(); foreach ($result as $bareClassName) { $classNames = $this->getClassListForTableName($bareClassName); $convertedList = array_merge($convertedList, $classNames);
-
AutoclassesCacheWarmer
regenerateClassmap
* @param string $tablename * * @return void
if (null === $targetDir) { $targetDir = $this->cacheDir;
-
AutoclassesDatabaseAdapter
setConnection
* @var Connection
$this->conn = $conn;
-
AutoclassesDatabaseAdapter
getTableClassList
* {@inheritdoc}
$all = $this->conn->fetchAllAssociative('SELECT `name` from `cms_tbl_conf`'); return $this->getNamesArray($all);
-
AutoclassesDatabaseAdapter
getVirtualClassList
* {@inheritdoc}
$all = $this->conn->fetchAllAssociative('SELECT `name_of_entry_point` as \'name\' FROM `pkg_cms_class_manager`'); return $this->getNamesArray($all);
-
AutoclassesDatabaseAdapter
getTableNameForId
* {@inheritdoc}
$result = $this->conn->fetchAllAssociative('SELECT `name` from `cms_tbl_conf` WHERE id=:id', array('id' => $id)); if (0 === count($result)) { return null;
-
AutoclassesManager
__construct
* {@inheritdoc}
$this->registerHandler(new TPkgCoreAutoClassHandler_TableClass($databaseConnection, $filemanager, $autoClassDataAccess)); $this->registerHandler(new TPkgCoreAutoClassHandler_TPkgCmsClassManager($databaseConnection, $filemanager, $virtualClassManager));
-
AutoclassesManager
registerHandler
* @var TPkgCoreAutoClassHandler_AbstractBase[]
$this->handlerList[] = $handler;
-
AutoclassesManager
create
* to prevent infinite recursion we push each class being processed onto the callstack - and pop it back out when it has been generated. * * @var array
$classCreated = false; if (true === $this->isInCallStack($classname)) { throw new TPkgCmsCoreAutoClassManagerException_Recursion($classname, $this->callStack, __FILE__, __LINE__);
-
AutoclassesMapGenerator
generateAutoclassesMap
* {@inheritdoc}
return $this->getClassesFromDirectory($autoclassesDir);
-
GenerateAutoclassesCommand
__construct
* Class GenerateAutoclassesCommand Creates autoclasses from the console.
parent::__construct('chameleon_system:autoclasses:generate'); $this->autoclassesCacheWarmer = $autoclassesCacheWarmer;
-
AutoclassesDataAccess
__construct
* @var Connection
$this->connection = $connection;
-
AutoclassesDataAccess
getTableExtensionData
* @param Connection $connection
$data = array(); $query = 'SELECT * FROM `cms_tbl_extension` ORDER BY `position` DESC'; $statement = $this->connection->executeQuery($query); while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { $data[$row['cms_tbl_conf_id']][] = $row;
-
AutoclassesDataAccess
getFieldData
* {@inheritdoc}
$data = array(); $query = 'SELECT `cms_field_conf`.*, `cms_tbl_conf`.`name` AS tablename FROM `cms_field_conf` INNER JOIN `cms_tbl_conf` ON `cms_field_conf`.`cms_tbl_conf_id` = `cms_tbl_conf`.`id` ORDER BY `position` ASC'; $statement = $this->connection->executeQuery($query); $fieldTypes = array(); while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { $tableConfId = $row['cms_tbl_conf_id']; if (false === isset($data[$tableConfId])) { $data[$tableConfId] = new TIterator();
-
AutoclassesDataAccess
getConfig
* {@inheritdoc}
$cmsConfig = new TCMSConfig(); $cmsConfig->Load(1); return $cmsConfig;
-
AutoclassesDataAccess
getTableOrderByData
@var $field TCMSField
$data = array(); $query = 'SELECT `name`, `sort_order_direction`, `cms_tbl_conf_id` FROM `cms_tbl_display_orderfields` ORDER BY `position` ASC'; $statement = $this->connection->executeQuery($query); while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { $tableConfId = $row['cms_tbl_conf_id']; if (false === isset($data[$tableConfId])) { $data[$tableConfId] = array();
-
AutoclassesDataAccess
getTableConfigData
* {@inheritdoc}
$data = array(); $query = 'SELECT * FROM `cms_tbl_conf`'; $statement = $this->connection->executeQuery($query); while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { $data[$row['id']] = $row;
-
AutoclassesRequestCacheDataAccess
__construct
* @var AutoclassesDataAccessInterface
$this->decorated = $decorated;
-
AutoclassesRequestCacheDataAccess
clearCache
* @var array
$this->tableExtensionData = null; $this->fieldData = null; $this->config = null; $this->tableOrderByData = null; $this->tableConfigData = null;
-
AutoclassesRequestCacheDataAccess
getTableExtensionData
* @var array
if (null === $this->tableExtensionData) { $this->tableExtensionData = $this->decorated->getTableExtensionData();
-
AutoclassesRequestCacheDataAccess
getFieldData
* @var TCMSConfig
if (null === $this->fieldData) { $this->fieldData = $this->decorated->getFieldData();
-
AutoclassesRequestCacheDataAccess
getConfig
* @var array
if (null === $this->config) { $this->config = $this->decorated->getConfig();
-
AutoclassesRequestCacheDataAccess
getTableOrderByData
* @var array
if (null === $this->tableOrderByData) { $this->tableOrderByData = $this->decorated->getTableOrderByData();
-
AutoclassesRequestCacheDataAccess
getTableConfigData
* @param AutoclassesDataAccessInterface $decorated
if (null === $this->tableConfigData) { $this->tableConfigData = $this->decorated->getTableConfigData();
-
ChameleonSystemAutoclassesExtension
load
* @return void
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); $loader->load('services.xml');
-
TPkgCmsCoreAutoClassManagerException_Recursion
__construct
* @var string|null
$this->sNameOfClassAttemptedToGenerate = $sNameOfClassAttemptedToGenerate; $this->aClassCallStack = $aClassCallStack; parent::__construct($this->generateMessageFromCallDetails(), 0, E_USER_ERROR, $filename, $lineno);
-
TPkgCoreAutoClassHandler_AbstractBase
__construct
* @var mixed
$this->databaseConnection = $databaseConnection; $this->filemanager = $filemanager;
-
TPkgCoreAutoClassHandler_AbstractBase
resetInternalCache
* @var null|array
$this->aClassMapping = null; $this->aClassExtensionList = null; $this->aClassNameList = null;
-
TPkgCoreAutoClassHandler_TableClass
create
* {@inheritdoc}
$tableConfId = $this->getTableConfIdForClassName($sClassName); if (null === $tableConfId) { return;
-
TPkgCoreAutoClassHandler_TableClass
__construct
* @param string $className * * @return int|string|null
parent::__construct($databaseConnection, $filemanager); $this->autoClassesDataAccess = $autoClassesDataAccess;
-
TPkgCoreAutoClassHandler_TableClass
getClassNameFromKey
* @param string $tableName * * @return string|null
return TCMSTableToClass::GetClassName(TCMSTableToClass::PREFIX_CLASS, $sKey);
-
TPkgCoreAutoClassHandler_TableClass
canHandleClass
* converts the key under which the auto class definition is stored into the class name which the key stands for. * * @param string $sKey * * @return string
$bIsTdbObject = (TCMSTableToClass::PREFIX_CLASS == substr( $sClassName, 0, strlen(TCMSTableToClass::PREFIX_CLASS) )); if (true === $bIsTdbObject) { return true;
-
TPkgCoreAutoClassHandler_TableClass
getClassNameList
* returns true if the auto class handler knows how to handle the class name passed. * * @param string $sClassName * * @return bool
if (null === $this->aClassNameList) { $this->aClassNameList = array(); $query = 'SELECT `name` FROM `cms_tbl_conf` ORDER BY `cmsident`'; $tRes = $this->getDatabaseConnection()->query($query); while ($aRow = $tRes->fetch(\PDO::FETCH_NUM)) { $this->aClassNameList[] = $this->getClassNameFromKey($aRow[0]);
-
TPkgCoreAutoClassHandler_TPkgCmsClassManager
__construct
* {@inheritdoc}
parent::__construct($databaseConnection, $filemanager); $this->virtualClassManager = $virtualClassManager;
-
TPkgCoreAutoClassHandler_TPkgCmsClassManager
create
* converts the key under which the auto class definition is stored into the class name which the key stands for. * * @param string $sKey * * @return string|false
$virtualClassManager = clone $this->virtualClassManager; if (true === $virtualClassManager->load($sClassName)) { $virtualClassManager->UpdateVirtualClasses($targetDir); return;
-
TPkgCoreAutoClassHandler_TPkgCmsClassManager
getClassNameFromKey
@psalm-suppress InvalidArrayOffset
$sClassName = false; $query = 'SELECT `name_of_entry_point` FROM `pkg_cms_class_manager` WHERE `id` = :key'; if ($aClass = $this->getDatabaseConnection()->fetchAssociative($query, array('key' => $sKey))) { /** @psalm-suppress InvalidArrayOffset */ $sClassName = $aClass[0];
-
TPkgCoreAutoClassHandler_TPkgCmsClassManager
canHandleClass
* returns true if the auto class handler knows how to handle the class name passed. * * @param string $sClassName * * @return bool
$aClassList = $this->getClassNameList(); $bClassExists = in_array($sClassName, $aClassList); if ($bClassExists) { return true;
-
TPkgCoreAutoClassHandler_TPkgCmsClassManager
getClassNameList
* @return array
if (null === $this->aClassNameList) { $this->aClassNameList = array(); $query = 'SELECT `name_of_entry_point` FROM `pkg_cms_class_manager` ORDER BY `cmsident`'; try { $tRes = $this->getDatabaseConnection()->query($query); while ($aRow = $tRes->fetch(\PDO::FETCH_NUM)) { $this->aClassNameList[] = $aRow[0];
-
RequestListener
__construct
* @var string
$this->autoclassesDir = $autoclassesDir; $this->cacheWarmer = $cacheWarmer; $this->requestInfoService = $requestInfoService;
-
RequestListener
checkAutoclasses
* @var \ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesCacheWarmer
if (HttpKernelInterface::MAIN_REQUEST !== $evt->getRequestType()) { return;
-
AutoclassesCacheWarmerTest
it_updates_single_tables_by_id
@var AutoclassesCacheWarmer
/** @var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container */ $container = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerInterface'); /** @var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy */ $manager = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface'); /** @var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy */ $adapter = $this->prophesize('\ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesDatabaseAdapterInterface'); $adapter ->getTableNameForId('123') ->willReturn( 'foo_table' ) ; /** @var \IPkgCmsFileManager|ObjectProphecy $filemanager */ $filemanager = $this->prophesize('\IPkgCmsFileManager'); $cacheDir = __DIR__.'/cache/'; /** @var $autoclassesMapGenerator \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface|ObjectProphecy */ $autoclassesMapGenerator = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface'); $autoclassesMapGenerator ->generateAutoclassesMap($cacheDir) ->willReturn(array( 'TestClass' => 'TestType', )); $this->warmer = new AutoclassesCacheWarmer($manager->reveal(), $adapter->reveal(), $autoclassesMapGenerator->reveal(), $filemanager->reveal(), $cacheDir, $container->reveal()); $this->warmer->updateTableById('123'); $manager->create('TdbFooTable', $cacheDir)->shouldHaveBeenCalled(); $manager->create('TdbFooTableList', $cacheDir)->shouldHaveBeenCalled(); $manager->create('TAdbFooTable', $cacheDir)->shouldHaveBeenCalled(); $manager->create('TAdbFooTableList', $cacheDir)->shouldHaveBeenCalled();
-
AutoclassesCacheWarmerTest
it_updates_single_tables_by_name
* @test
/** @var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container */ $container = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerInterface'); /** @var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy */ $manager = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface'); /** @var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy */ $adapter = $this->prophesize('\ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesDatabaseAdapterInterface'); /** @var \IPkgCmsFileManager|ObjectProphecy $filemanager */ $filemanager = $this->prophesize('\IPkgCmsFileManager'); $cacheDir = __DIR__.'/cache/'; /** @var $autoclassesMapGenerator \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface|ObjectProphecy */ $autoclassesMapGenerator = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface'); $autoclassesMapGenerator ->generateAutoclassesMap($cacheDir) ->willReturn(array( 'TestClass' => 'TestType', )); $this->warmer = new AutoclassesCacheWarmer($manager->reveal(), $adapter->reveal(), $autoclassesMapGenerator->reveal(), $filemanager->reveal(), $cacheDir, $container->reveal()); $this->warmer->updateTableByName('foo_table'); $manager->create('TdbFooTable', $cacheDir)->shouldHaveBeenCalled(); $manager->create('TdbFooTableList', $cacheDir)->shouldHaveBeenCalled(); $manager->create('TAdbFooTable', $cacheDir)->shouldHaveBeenCalled(); $manager->create('TAdbFooTableList', $cacheDir)->shouldHaveBeenCalled();
-
AutoclassesCacheWarmerTest
it_ignores_nonexistant_tables
@var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container
/** @var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container */ $container = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerInterface'); /** @var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy */ $adapter = $this->prophesize('\ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesDatabaseAdapterInterface'); $adapter ->getTableNameForId('123') ->willReturn( null ); /** @var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy */ $manager = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface'); /** @var $autoclassesMapGenerator \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface|ObjectProphecy */ $autoclassesMapGenerator = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface'); /** @var \IPkgCmsFileManager|ObjectProphecy $filemanager */ $filemanager = $this->prophesize('\IPkgCmsFileManager'); $cacheDir = ''; $this->warmer = new AutoclassesCacheWarmer($manager->reveal(), $adapter->reveal(), $autoclassesMapGenerator->reveal(), $filemanager->reveal(), $cacheDir, $container->reveal()); $this->warmer->updateTableById('123'); $manager->create(Argument::any(), $cacheDir)->shouldNotHaveBeenCalled();
-
AutoclassesCacheWarmerTest
it_converts_underscore_names_to_autoclass_names
@var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy
/** @var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container */ $container = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerInterface'); /** @var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy */ $manager = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface'); /** @var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy */ $adapter = $this->prophesize('\ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesDatabaseAdapterInterface'); $adapter ->getTableClassList() ->willReturn( array( 'foo_bar', 'bar_baz', 'a_b_cx', ) ); $adapter ->getVirtualClassList() ->willReturn( array( 'vfoo_bar', 'vbar_baz', 'va_b_cx', ) ); /** @var $autoclassesMapGenerator \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface|ObjectProphecy */ $autoclassesMapGenerator = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface'); /** @var \IPkgCmsFileManager|ObjectProphecy $filemanager */ $filemanager = $this->prophesize('\IPkgCmsFileManager'); $cacheDir = ''; $expected = array( 'virtualClasses' => array( 'vfoo_bar', 'vbar_baz', 'va_b_cx', ), 'tableClasses' => array( 'TdbFooBar', 'TAdbFooBar', 'TdbFooBarList', 'TAdbFooBarList', 'TdbBarBaz', 'TAdbBarBaz', 'TdbBarBazList', 'TAdbBarBazList', 'TdbABCx', 'TAdbABCx', 'TdbABCxList', 'TAdbABCxList', ), ); $this->warmer = new AutoclassesCacheWarmer($manager->reveal(), $adapter->reveal(), $autoclassesMapGenerator->reveal(), $filemanager->reveal(), $cacheDir, $container->reveal()); $result = $this->warmer->getTableClassNamesToLoad(); $this->assertEquals($expected, $result);
-
AutoclassesCacheWarmerTest
it_should_warm_the_complete_cache
@var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy
/** @var \Symfony\Component\DependencyInjection\ContainerInterface|ObjectProphecy $container */ $container = $this->prophesize('\Symfony\Component\DependencyInjection\ContainerInterface'); /** @var $adapter AutoclassesDatabaseAdapterInterface|ObjectProphecy */ $adapter = $this->prophesize('\ChameleonSystem\AutoclassesBundle\CacheWarmer\AutoclassesDatabaseAdapterInterface'); $adapter ->getTableClassList() ->willReturn( array( 'foo_bar', ) ); $adapter ->getVirtualClassList() ->willReturn( array( 'vfoo_bar', ) ); /** @var \IPkgCmsFileManager|ObjectProphecy $filemanager */ $filemanager = $this->prophesize('\IPkgCmsFileManager'); $cacheDir = __DIR__.'/cache/'; $tempCacheDir = __DIR__.'/cach_/'; /** @var $autoclassesMapGenerator \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface|ObjectProphecy */ $autoclassesMapGenerator = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesMapGeneratorInterface'); $autoclassesMapGenerator ->generateAutoclassesMap($tempCacheDir) ->willReturn(array( 'TestClass' => 'TestType', )); /** @var $manager \ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface|ObjectProphecy */ $manager = $this->prophesize('\ChameleonSystem\AutoclassesBundle\ClassManager\AutoclassesManagerInterface'); $this->warmer = new AutoclassesCacheWarmer($manager->reveal(), $adapter->reveal(), $autoclassesMapGenerator->reveal(), $filemanager->reveal(), $cacheDir, $container->reveal()); $this->warmer->updateAllTables(); $manager->create('TdbFooBar', $tempCacheDir)->shouldHaveBeenCalled(); $manager->create('TAdbFooBar', $tempCacheDir)->shouldHaveBeenCalled(); $manager->create('TdbFooBarList', $tempCacheDir)->shouldHaveBeenCalled(); $manager->create('TAdbFooBarList', $tempCacheDir)->shouldHaveBeenCalled(); $manager->create('vfoo_bar', $tempCacheDir)->shouldHaveBeenCalled(); rmdir($tempCacheDir);
-
AutoclassesMapGeneratorTest
it_should_generate_a_complete_autoclasses_classmap
* @var AutoclassesMapGenerator
$cacheDir = __DIR__.'/cache/'; $actual = $this->mapGenerator->generateAutoclassesMap($cacheDir); $expected = array(); $expected['TestClass'] = 'TestType'; $this->assertEquals($expected, $actual);
-
RequestListenerTest
it_generates_autoclasses_if_there_arent_any
* @test
$cacheWarmer = $this->getCacheWarmerProphet(); $evt = $this->getResponseEventProphet(HttpKernelInterface::MAIN_REQUEST, RequestTypeInterface::REQUEST_TYPE_BACKEND); $infoService = $this->getRequestInfoService(true); $listener = new RequestListener(__DIR__.'/fixtures/nonexistantdir', $cacheWarmer->reveal(), $infoService); $listener->checkAutoclasses($evt->reveal()); $cacheWarmer->updateAllTables()->shouldHaveBeenCalled(); $this->assertTrue(true);
-
RequestListenerTest
it_leaves_existing_autoclasses_alone
* @test
$cacheWarmer = $this->getCacheWarmerProphet(); $evt = $this->getResponseEventProphet(HttpKernelInterface::MAIN_REQUEST, RequestTypeInterface::REQUEST_TYPE_BACKEND); $infoService = $this->getRequestInfoService(true); $listener = new RequestListener(__DIR__.'/fixtures/autoclasses', $cacheWarmer->reveal(), $infoService); $listener->checkAutoclasses($evt->reveal()); $cacheWarmer->updateAllTables()->shouldNotHaveBeenCalled(); $this->assertTrue(true);
-
RequestListenerTest
it_only_checks_on_master_request
* @test
$cacheWarmer = $this->getCacheWarmerProphet(); $evt = $this->getResponseEventProphet(HttpKernelInterface::SUB_REQUEST, RequestTypeInterface::REQUEST_TYPE_BACKEND); $infoService = $this->getRequestInfoService(true); $listener = new RequestListener(__DIR__.'/fixtures/nonexistantdir', $cacheWarmer->reveal(), $infoService); $listener->checkAutoclasses($evt->reveal()); $cacheWarmer->updateAllTables()->shouldNotHaveBeenCalled(); $this->assertTrue(true);
-
RequestListenerTest
it_only_runs_on_backend_request
* @test
$cacheWarmer = $this->getCacheWarmerProphet(); $evt = $this->getResponseEventProphet(HttpKernelInterface::MAIN_REQUEST, RequestTypeInterface::REQUEST_TYPE_FRONTEND); $infoService = $this->getRequestInfoService(false); $listener = new RequestListener(__DIR__.'/fixtures/nonexistantdir', $cacheWarmer->reveal(), $infoService); $listener->checkAutoclasses($evt->reveal()); $cacheWarmer->updateAllTables()->shouldNotHaveBeenCalled(); $this->assertTrue(true);
-
TPkgCmsActionPluginManager
__construct
* @var array<string, object>|null
$this->oActivePage = $oActivePage;
-
TPkgCmsActionPluginManager
actionPluginExists
* @var TCMSActivePage|null
$aPluginList = $this->getActionPluginList(); return isset($aPluginList[$sPluginName]);
-
TPkgCmsActionPluginManager
callAction
* @param string $sPluginName * * @return bool
$oPlugin = $this->getActionPlugin($sPluginName); if (false === method_exists($oPlugin, $sActionName) || false === is_callable(array($oPlugin, $sActionName))) { throw new TPkgCmsActionPluginException_ActionNotPublic('action "'.$sActionName.'" does not exists', 0, E_USER_WARNING, __FILE__, __LINE__);
-
TPkgCmsActionPlugin_ChangeLanguage
changeLanguage
* @param array $data * * @return void
$languageIso = isset($data['l']) ? $data['l'] : ''; if (empty($languageIso)) { return;
-
BackendSession
__construct( readonly private RequestStack $requestStack, readonly private Security $security, readonly private Connection $connection, readonly private LanguageServiceInterface $languageService )
@var CmsUserModel $user
null
-
BackendSession
getCurrentEditLanguageId: string
@var CmsUserModel $user
$iso = $this->getCurrentEditLanguageIso6391(); if (null === $iso) { return $this->languageService->getCmsBaseLanguageId();
-
BackendSession
getCurrentEditLanguageIso6391: ?string
@var CmsUserModel $user
$session = $this->getSession(); if (null === $session) { return null;
-
ChameleonSystemCmsBackendExtension
load
* @return void
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../config/')); $loader->load('services.xml');
-
ClearChameleonCacheCommand
__construct
* @var CacheInterface
parent::__construct($name); $this->cache = $cache;
-
ChameleonSystemCmsCacheExtension
load
* @return void
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/')); $loader->load('services.xml'); $active = $container->getParameter('chameleon_system_core.cache.memcache_activate'); if ($active) { $cacheDefinition = $container->getDefinition('chameleon_system_cms_cache.cache'); $cacheDefinition->replaceArgument(2, $container->getDefinition('chameleon_system_cms_cache.storage.memcache'));
-
Cache
__construct( RequestStack $requestStack, Connection $dbConnection, StorageInterface $oCacheStorage, $cacheKeyPrefix, $cacheAllowed, HashInterface $hashArray, RequestStateHashProviderInterface $requestStateHashProvider )
* @var RequestStack
$this->setRequestStack($requestStack); $this->setDbConnection($dbConnection); $this->setStorage($oCacheStorage); $this->cacheKeyPrefix = $cacheKeyPrefix; $this->cacheAllowed = $cacheAllowed; $this->hashArray = $hashArray; $this->requestStateHashProvider = $requestStateHashProvider;
-
Cache
setStorage
* @var Connection
$this->storage = $oCacheStorage;
-
Cache
disable
* @var StorageInterface|null
$this->isActive = false;
-
Cache
enable
* @var bool
$this->isActive = true;
-
Cache
isActive
* @var string
return $this->cacheAllowed && $this->isActive;
-
Cache
get
* @var bool
if (false === $this->isActive()) { return null;
-
Cache
set
* @var HashInterface
if (false === $this->isActive()) { return;
-
Cache
delete
* @var RequestStateHashProviderInterface
if (false === $this->isActive()) { return false;
-
Cache
clearAll
* @param RequestStack $requestStack * @param Connection $dbConnection * @param StorageInterface $oCacheStorage * @param string $cacheKeyPrefix * @param bool $cacheAllowed * @param HashInterface $hashArray * @param RequestStateHashProviderInterface $requestStateHashProvider
if (false === $this->isActive()) { return;
-
Cache
callTrigger
* @param StorageInterface $oCacheStorage * * @return void
if (CHAMELEON_CACHE_ENABLE_CACHE_INFO === false) { return;
-
Cache
getKey
* {@inheritdoc}
if ($addStateKey) { $aParameters['__state'] = [ self::REQUEST_STATE_HASH => $this->requestStateHashProvider->getHash($this->requestStack->getCurrentRequest()), ];
-
Cache
setRequestStack
* {@inheritdoc}
$this->requestStack = $requestStack;
-
Cache
setDbConnection
* {@inheritdoc}
$this->dbConnection = $dbConnection;
-
Memcache
__construct
* @var \TCMSMemcache
$this->memcache = $memcache;
-
Memcache
get
* {@inheritdoc}
$content = $this->memcache->Get($key); if (true === $this->memcache->getLastGetRequestReturnedNoMatch()) { return null;
-
Memcache
delete
* {@inheritdoc}
return $this->memcache->Delete($key);
-
Memcache
clearAll
* {@inheritdoc}
return $this->memcache->Flush();
-
Memcache
set
* {@inheritdoc}
return $this->memcache->Set($key, $value, $expireInSeconds);
-
NullStorage
get
* {@inheritdoc}
return null;
-
NullStorage
delete
* {@inheritdoc}
return true;
-
NullStorage
clearAll
* {@inheritdoc}
return true;
-
NullStorage
set
* {@inheritdoc}
return true;
-
TdbCmsLanguage
it_creates_cache_key
* @var Cache
$this->cache->disable(); $params = [ 'foo' => 'bar', 'foo2' => 'bar2', ]; $expectedParams = $params; $expectedParams['__uniqueIdentity'] = null; $expected = \md5(\json_encode($expectedParams)); $result = $this->cache->getKey($params, false); $this->assertEquals($expected, $result);
-
TdbCmsLanguage
it_works_with_special_chars
* @test
$this->cache->disable(); $params = [ 'foo2' => '中国 农业', 'foo' => 'bar', ]; $expectedParams = $params; $expectedParams['__uniqueIdentity'] = null; $expected = \md5(\json_encode($expectedParams)); $result = $this->cache->getKey($params, false); $this->assertEquals($expected, $result);
-
TPkgCmsCaptcha
GenerateNewCaptchaImage
* factory creates a new instance and returns it. * * @param string|array $sData - either the id of the object to load, or the row with which the instance should be initialized * @param string $sLanguage - init with the language passed * * @return TdbPkgCmsCaptcha
$iLength = 6; $iWidth = 120; $iHeight = 40; if (array_key_exists('l', $aParameter)) { $iLength = intval($aParameter['l']);
-
TPkgCmsCaptcha
CodeIsValid
* returns the path to TTF font file, that is used for the captcha. * * @return string
$sCodeInSession = TdbPkgCmsCaptcha::GetCodeFromSession($sIdentifier); if (false === $sCodeInSession) { return false;
-
TPkgCmsCaptcha
getHTMLSnippet
* generates the captcha image and outputs it. * * @param string $sIdentifier * @param array $aParameter * * @return void
return '<input type="text" name="'.$sIdentifier.'" id="'.$sIdentifier.'" value="" />';
-
TPkgCmsCaptcha
GetRequestURL
* @return bool
$sURL = '/'.self::URL_IDENTIFIER.'/'.$this->sqlData['cmsident'].'/'.$sIdentifier; $aParameter['rnd'] = rand(1000000, 9999999); if (count($aParameter) > 0) { $sURL .= '?'.TTools::GetArrayAsURL($aParameter);
-
TPkgCmsCaptcha_TextFieldJavascriptHidden
CodeIsValid
* return true if the code in session was submitted in user data AND is empty * note: the code will be removed from session. * * @param string $sIdentifier * @param string $sCode will be ignored by this type of captcha and shall be passed as empty string * * @return bool
$sCodeFromSession = TdbPkgCmsCaptcha::GetCodeFromSession($sIdentifier); if (false === $sCodeFromSession) { return false;
-

No dataset card yet

Contribute a Dataset Card
Downloads last month
13