_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q256100
Quickbooks_Payments._http
test
protected function _http($Context, $url_path, $raw_body = null, $operation = null) { if($operation !== null) { $method = $operation; } else { $method = 'GET'; if ($raw_body) { $method = 'POST'; } } $url = $this->_getBaseURL() . $url_path; $authcreds = $Context->authcreds(); $par...
php
{ "resource": "" }
q256101
QuickBooks_Callbacks_API_Callbacks._mapToQuickBooksID
test
protected static function _mapToQuickBooksID($func, $user, $type, $ID) { if (strlen($func)) { if (false === strpos($func, '::')) { return $func($type, $ID); } else { $tmp = explode('::', $func); return call_user_func(array( $tmp[0], $tmp[1] ), $type, $ID); } } else { $e...
php
{ "resource": "" }
q256102
QuickBooks_Callbacks_API_Callbacks._mapToApplicationID
test
static protected function _mapToApplicationID($func, $user, $type, $ListID_or_TxnID) { if (strlen($func)) { if (false === strpos($func, '::')) { return $func($type, $ListID_or_TxnID); } else { $tmp = explode('::', $func); return call_user_func(array( $tmp[0], $tmp[1] ), $type, $Lis...
php
{ "resource": "" }
q256103
QuickBooks_Callbacks_API_Callbacks.ShipMethodAddRequest
test
public static function ShipMethodAddRequest($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale, $config = array(), $qbxml = null) { return QuickBooks_Callbacks_API_Callbacks::_doAddRequest($requestID, $user, $action, $ID, $extra, $err, $last_action_time, $las...
php
{ "resource": "" }
q256104
QuickBooks_Callbacks_SQL_Callbacks._filterActions
test
static protected function _filterActions($action_to_priority, $only_do, $dont_do, $type) { $start = microtime(true); foreach ($action_to_priority as $action => $priority) { //print('stepping 1... [' . (microtime(true) - $start) . ']' . "\n"); $converted = QuickBooks_Utilities::actionToObject($action); /...
php
{ "resource": "" }
q256105
QuickBooks_Callbacks_SQL_Callbacks._requiredVersion
test
protected static function _requiredVersion($required, $current, $locale = QUICKBOOKS_LOCALE_US, $action = null) { if ($locale == QUICKBOOKS_LOCALE_US) { return $current >= $required; } return true; }
php
{ "resource": "" }
q256106
QuickBooks_Callbacks_SQL_Callbacks.ListDeletedQueryRequest
test
public static function ListDeletedQueryRequest($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale, $config = array()) { $xml = ''; if (!QuickBooks_Callbacks_SQL_Callbacks::_requiredVersion(2.0, $version, $locale, QUICKBOOKS_DEL_LIST)) { return QUICK...
php
{ "resource": "" }
q256107
QuickBooks_Callbacks_SQL_Callbacks.ListDeletedQueryResponse
test
public static function ListDeletedQueryResponse($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $xml, $idents, $config = array() ) { $Driver = QuickBooks_Driver_Singleton::getInstance(); $Parser = new QuickBooks_XML_Parser($xml); $errnum = 0; $errmsg = ''; $Do...
php
{ "resource": "" }
q256108
QuickBooks_Callbacks_SQL_Callbacks.TxnVoidRequest
test
public static function TxnVoidRequest($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale, $config = array()) { $Driver = QuickBooks_Driver_Singleton::getInstance(); if ($arr = $Driver->get(QUICKBOOKS_DRIVER_SQL_PREFIX_SQL . strtolower($extra['object']), ...
php
{ "resource": "" }
q256109
QuickBooks_Callbacks_SQL_Callbacks.TxnVoidResponse
test
public static function TxnVoidResponse($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $xml, $idents, $config = array()) { $Driver = QuickBooks_Driver_Singleton::getInstance(); // Figure out what SQL table this object came from $map = array(); $others = array(); ...
php
{ "resource": "" }
q256110
QuickBooks_Callbacks_SQL_Callbacks.SalesReceiptModRequest
test
public static function SalesReceiptModRequest($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale, $config = array()) { $Driver = QuickBooks_Driver_Singleton::getInstance(); if ($SalesReceipt = $Driver->get(QUICKBOOKS_DRIVER_SQL_PREFIX_SQL . 'salesreceipt', ...
php
{ "resource": "" }
q256111
QuickBooks_Callbacks_SQL_Callbacks.JobTypeAddRequest
test
public static function JobTypeAddRequest($requestID, $user, $action, $ID, $extra, &$err, $last_action_time, $last_actionident_time, $version, $locale, $config = array()) { $Driver = QuickBooks_Driver_Singleton::getInstance(); if ($JobType = $Driver->get(QUICKBOOKS_DRIVER_SQL_PREFIX_SQL . 'jobtype', array( QUICKBOO...
php
{ "resource": "" }
q256112
QuickBooks_Callbacks_SQL_Callbacks._buildFilter
test
protected static function _buildFilter($user, $action, $extra, $filter_wrap = false) { $Driver = QuickBooks_Driver_Singleton::getInstance(); $xml = ''; $type = ''; $key_prev = QuickBooks_Callbacks_SQL_Callbacks::_keySyncPrev($action); $key_curr = QuickBooks_Callbacks_SQL_Callbacks::_keySyncCurr($action);...
php
{ "resource": "" }
q256113
CacheService.flushGroups
test
public function flushGroups(array $groups) { $this->ensureCacheGroupsExist($groups); foreach ($groups as $group) { $this->cacheManager->flushCachesInGroup($group); } }
php
{ "resource": "" }
q256114
CacheService.flushByTagsAndGroups
test
public function flushByTagsAndGroups(array $tags, array $groups = null) { if ($groups === null) { $this->flushByTags($tags); } else { $this->ensureCacheGroupsExist($groups); foreach ($groups as $group) { $this->flushByTags($tags, $group); ...
php
{ "resource": "" }
q256115
CommandCollection.find
test
public function find(string $possibleName): string { $allCommands = $this->getNames(); $expr = preg_replace_callback('{([^:]+|)}', function ($matches) { return preg_quote($matches[1], '/') . '[^:]*'; }, $possibleName); $commands = preg_grep('{^' . $expr . '}', $allCommand...
php
{ "resource": "" }
q256116
PopulateCommandConfiguration.run
test
public function run(ScriptEvent $event): bool { $composer = $event->getComposer(); $composerConfig = $composer->getConfig(); $basePath = realpath(substr($composerConfig->get('vendor-dir'), 0, -strlen($composerConfig->get('vendor-dir', $composerConfig::RELATIVE_PATHS)))); $commandConf...
php
{ "resource": "" }
q256117
ExtensionCompatibilityCheck.canLoadExtLocalconfFile
test
private function canLoadExtLocalconfFile($extensionKey) { $activePackages = $this->packageManager->getActivePackages(); foreach ($activePackages as $package) { $this->loadExtLocalconfForExtension($package->getPackageKey()); if ($package->getPackageKey() === $extensionKey) { ...
php
{ "resource": "" }
q256118
ExtensionCompatibilityCheck.canLoadExtTablesFile
test
private function canLoadExtTablesFile($extensionKey) { $activePackages = $this->packageManager->getActivePackages(); foreach ($activePackages as $package) { // Load all ext_localconf files first $this->loadExtLocalconfForExtension($package->getPackageKey()); } ...
php
{ "resource": "" }
q256119
ExtensionCompatibilityCheck.loadExtLocalconfForExtension
test
private function loadExtLocalconfForExtension($extensionKey) { $extensionInfo = $GLOBALS['TYPO3_LOADED_EXT'][$extensionKey]; // This is the main array meant to be manipulated in the ext_localconf.php files // In general it is recommended to not rely on it to be globally defined in that ...
php
{ "resource": "" }
q256120
ExtensionCompatibilityCheck.loadExtTablesForExtension
test
private function loadExtTablesForExtension($extensionKey) { $extensionInfo = $GLOBALS['TYPO3_LOADED_EXT'][$extensionKey]; // In general it is recommended to not rely on it to be globally defined in that // scope, but we can not prohibit this without breaking backwards compatibility g...
php
{ "resource": "" }
q256121
PrepareInstallAction.ensureInstallationIsPossible
test
private function ensureInstallationIsPossible(array $options) { $integrityCheck = $options['integrityCheck'] ?? false; if (!$integrityCheck) { return; } $isInteractive = $options['interactive'] ?? $this->output->getSymfonyConsoleInput()->isInteractive(); $forceIn...
php
{ "resource": "" }
q256122
SchedulerCommandController.executeScheduledTasks
test
protected function executeScheduledTasks() { // Loop as long as there are tasks do { // Try getting the next task and execute it // If there are no more tasks to execute, an exception is thrown by \TYPO3\CMS\Scheduler\Scheduler::fetchTask() try { /...
php
{ "resource": "" }
q256123
SchedulerCommandController.executeSingleTask
test
protected function executeSingleTask($taskId, $forceExecution) { // Force the execution of the task even if it is disabled or no execution scheduled if ($forceExecution) { $task = $this->scheduler->fetchTask($taskId); } else { $whereClause = 'uid = ' . (int)$taskId . ...
php
{ "resource": "" }
q256124
SchemaUpdate.migrate
test
public function migrate(array $statements, array $selectedStatements) { return $this->schemaMigrator->migrate($this->sqlReader->getCreateTableStatementArray($this->sqlReader->getTablesDefinitionString()), $selectedStatements); }
php
{ "resource": "" }
q256125
BackendCommandController.lockForEditorsCommand
test
public function lockForEditorsCommand() { $this->ensureConfigValueModifiable(); $lockedForEditors = $this->configurationService->getLocal('BE/adminOnly') !== self::LOCK_TYPE_UNLOCKED; if (!$lockedForEditors) { $this->configurationService->setLocal('BE/adminOnly', self::LOCK_TYPE_...
php
{ "resource": "" }
q256126
BackendCommandController.unlockForEditorsCommand
test
public function unlockForEditorsCommand() { $this->ensureConfigValueModifiable(); $lockedForEditors = $this->configurationService->getLocal('BE/adminOnly') !== self::LOCK_TYPE_UNLOCKED; if ($lockedForEditors) { $this->configurationService->setLocal('BE/adminOnly', self::LOCK_TYPE...
php
{ "resource": "" }
q256127
BackendCommandController.createAdminCommand
test
public function createAdminCommand(string $username, string $password) { $givenUsername = $username; $username = strtolower(preg_replace('/\\s/i', '', $username)); if ($givenUsername !== $username) { $this->outputLine('<warning>Given username "%s" contains invalid characters. Us...
php
{ "resource": "" }
q256128
UpgradeWizardList.listWizards
test
public function listWizards($includeDone = false) { if (empty($this->listCache)) { $availableUpgradeWizards = []; foreach ($this->wizardRegistry as $identifier => $className) { $updateObject = $this->factory->create($identifier); $shortIdentifier = $th...
php
{ "resource": "" }
q256129
InstallCommandController.generatePackageStatesCommand
test
public function generatePackageStatesCommand(array $frameworkExtensions = [], array $excludedExtensions = [], $activateDefault = false) { if ($activateDefault && CompatibilityScripts::isComposerMode()) { // @deprecated for composer usage in 5.0 will be removed with 6.0 $this->outputL...
php
{ "resource": "" }
q256130
InstallCommandController.fixFolderStructureCommand
test
public function fixFolderStructureCommand() { $folderStructureFactory = new ExtensionFactory($this->packageManager); $fixedStatusObjects = $folderStructureFactory ->getStructure() ->fix(); if (empty($fixedStatusObjects)) { $this->outputLine('<info>No acti...
php
{ "resource": "" }
q256131
InstallCommandController.extensionSetupIfPossibleCommand
test
public function extensionSetupIfPossibleCommand() { $commandDispatcher = CommandDispatcher::createFromCommandRun(); try { $this->outputLine($commandDispatcher->executeCommand('database:updateschema')); $this->outputLine($commandDispatcher->executeCommand('cache:flush')); ...
php
{ "resource": "" }
q256132
InstallCommandController.executeActionWithArguments
test
private function executeActionWithArguments($actionName, array $arguments = [], $dryRun = false) { $this->outputLine(serialize($this->installStepActionExecutor->executeActionWithArguments($actionName, $arguments, $dryRun))); }
php
{ "resource": "" }
q256133
CommandDispatcher.createFromComposerRun
test
public static function createFromComposerRun(...$arguments): self { if (isset($arguments[0]) && $arguments[0] instanceof ScriptEvent) { // Calling createFromComposerRun with ScriptEvent as first argument is deprecated and will be removed with 6.0 array_shift($arguments); } ...
php
{ "resource": "" }
q256134
CommandDispatcher.createFromCommandRun
test
public static function createFromCommandRun(array $commandLine = [], array $environmentVars = [], PhpExecutableFinder $phpFinder = null): self { if (!isset($_SERVER['argv'][0]) && strpos($_SERVER['argv'][0], Application::COMMAND_NAME) === false) { throw new RuntimeException('Tried to create typo...
php
{ "resource": "" }
q256135
CommandDispatcher.create
test
public static function create($typo3CommandPath, array $commandLine = [], array $environmentVars = [], PhpExecutableFinder $phpFinder = null): self { $environmentVars['TYPO3_CONSOLE_SUB_PROCESS'] = true; $phpFinder = $phpFinder ?: new PhpExecutableFinder(); if (!($php = $phpFinder->find(fals...
php
{ "resource": "" }
q256136
CommandDispatcher.executeCommand
test
public function executeCommand($command, array $arguments = [], array $envVars = [], $input = null): string { $envVars = array_replace($this->environmentVars, $envVars); $commandLine = $this->commandLinePrefix; $commandLine[] = $command; foreach ($arguments as $argumentName => $argu...
php
{ "resource": "" }
q256137
ExceptionHandler.handleException
test
public function handleException(\Throwable $exception) { $this->exceptionRenderer->render($exception, $this->output->getErrorOutput()); echo PHP_EOL; exit(1); }
php
{ "resource": "" }
q256138
UpgradeWizardFactory.create
test
public function create(string $identifier) { /** @var AbstractUpdate|UpgradeWizardInterface $upgradeWizard */ $upgradeWizard = $this->objectManager->get($this->getClassNameFromIdentifier($identifier)); if ($upgradeWizard instanceof AbstractUpdate) { $upgradeWizard->setIdentifier(...
php
{ "resource": "" }
q256139
TextDescriptor.wordWrap
test
private function wordWrap(string $stringToWrap, int $indent, $maxWidth): string { $wrapped = $maxWidth === null ? $stringToWrap : wordwrap($stringToWrap, $maxWidth, "\n", true); return preg_replace('/\s*[\r\n]\s*/', "\n" . str_repeat(' ', $indent), $wrapped); }
php
{ "resource": "" }
q256140
FrontendCommandController.requestCommand
test
public function requestCommand($requestUrl) { // TODO: this needs heavy cleanup! $template = file_get_contents(__DIR__ . '/../../../Resources/Private/Templates/request.tpl'); $arguments = [ 'documentRoot' => getenv('TYPO3_PATH_WEB') ?: PATH_site, 'requestUrl' => $this...
php
{ "resource": "" }
q256141
FrontendCommandController.makeAbsolute
test
protected function makeAbsolute($url) { $parsedUrl = parse_url($url); $scheme = isset($parsedUrl['scheme']) ? $parsedUrl['scheme'] : 'http'; $host = isset($parsedUrl['host']) ? $parsedUrl['host'] : 'localhost'; $path = isset($parsedUrl['path']) ? $parsedUrl['path'] : '/'; $q...
php
{ "resource": "" }
q256142
UpgradeCommandController.checkExtensionConstraintsCommand
test
public function checkExtensionConstraintsCommand(array $extensionKeys = [], $typo3Version = TYPO3_version) { if (empty($extensionKeys)) { $failedPackageMessages = $this->upgradeHandling->matchAllExtensionConstraints($typo3Version); } else { $failedPackageMessages = []; ...
php
{ "resource": "" }
q256143
UpgradeCommandController.listCommand
test
public function listCommand($all = false) { $verbose = $this->output->getSymfonyConsoleOutput()->isVerbose(); $messages = []; $wizards = $this->upgradeHandling->executeInSubProcess('listWizards', [], $messages); $listRenderer = new UpgradeWizardListRenderer(); $this->outputL...
php
{ "resource": "" }
q256144
UpgradeCommandController.wizardCommand
test
public function wizardCommand($identifier, array $arguments = [], $force = false) { $messages = []; $result = $this->upgradeHandling->executeInSubProcess('executeWizard', [$identifier, $arguments, $force], $messages); (new UpgradeWizardResultRenderer())->render([$identifier => $result], $thi...
php
{ "resource": "" }
q256145
UpgradeCommandController.allCommand
test
public function allCommand(array $arguments = []) { $verbose = $this->output->getSymfonyConsoleOutput()->isVerbose(); $this->outputLine(PHP_EOL . '<i>Initiating TYPO3 upgrade</i>' . PHP_EOL); $messages = []; $results = $this->upgradeHandling->executeAll($arguments, $this->output, $m...
php
{ "resource": "" }
q256146
UpgradeCommandController.subProcessCommand
test
public function subProcessCommand($upgradeCommand, $arguments) { $arguments = unserialize($arguments, ['allowed_classes' => false]); $result = $this->upgradeHandling->$upgradeCommand(...$arguments); $this->output(serialize($result)); }
php
{ "resource": "" }
q256147
UpgradeCommandController.checkExtensionCompatibilityCommand
test
public function checkExtensionCompatibilityCommand($extensionKey, $configOnly = false) { $this->output(\json_encode($this->upgradeHandling->isCompatible($extensionKey, $configOnly))); }
php
{ "resource": "" }
q256148
ExtensionSetup.setupExtensions
test
public function setupExtensions(array $packages) { foreach ($packages as $package) { $this->extensionFactory->getExtensionStructure($package)->fix(); $this->callInstaller('importInitialFiles', [PathUtility::stripPathSitePrefix($package->getPackagePath()), $package->getPackageKey()]);...
php
{ "resource": "" }
q256149
ExtensionFactory.getStructure
test
public function getStructure() { $structure = $this->getDefaultStructureDefinition(); $structure['children'] = $this->appendStructureDefinition($structure['children'], $this->createExtensionStructureDefinition($this->packageManager->getActivePackages())); return new StructureFacade(new Root...
php
{ "resource": "" }
q256150
ExtensionFactory.getExtensionStructure
test
public function getExtensionStructure(PackageInterface $package) { $structure = [ 'name' => substr(PATH_site, 0, -1), 'targetPermission' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask'], 'children' => $this->appendStructureDefinition([], $this->createExtensionStr...
php
{ "resource": "" }
q256151
ExtensionFactory.createExtensionStructureDefinition
test
private function createExtensionStructureDefinition(array $packages) { $structureBase = []; foreach ($packages as $package) { $extensionConfiguration = $this->packageManager->getExtensionConfiguration($package); if (isset($extensionConfiguration['uploadfolder']) && (bool)$ex...
php
{ "resource": "" }
q256152
XsdGenerator.generateXmlForClassName
test
protected function generateXmlForClassName($className, \SimpleXMLElement $xmlRootNode) { $reflectionClass = new \ReflectionClass($className); $tagName = $this->getTagNameForClass($className); $xsdElement = $xmlRootNode->addChild('xsd:element'); $xsdElement['name'] = $tagName; ...
php
{ "resource": "" }
q256153
XsdGenerator.addAttributes
test
protected function addAttributes($className, \SimpleXMLElement $xsdElement) { /** @var AbstractViewHelper $viewHelper */ $viewHelper = $this->objectManager->get($className); $argumentDefinitions = $viewHelper->prepareArguments(); /** @var $argumentDefinition ArgumentDefinition */ ...
php
{ "resource": "" }
q256154
XsdGenerator.addDocumentation
test
protected function addDocumentation($documentation, \SimpleXMLElement $xsdParentNode) { $xsdAnnotation = $xsdParentNode->addChild('xsd:annotation'); $this->addChildWithCData($xsdAnnotation, 'xsd:documentation', $documentation); }
php
{ "resource": "" }
q256155
CommandController.resolveCommandMethodName
test
protected function resolveCommandMethodName() { $commandMethodName = $this->request->getControllerCommandName() . 'Command'; if (!is_callable([$this, $commandMethodName])) { throw new NoSuchCommandException(sprintf('A command method "%s()" does not exist in controller "%s".', $commandMet...
php
{ "resource": "" }
q256156
CommandController.mapRequestArgumentsToControllerArguments
test
protected function mapRequestArgumentsToControllerArguments() { /** @var Argument $argument */ foreach ($this->arguments as $argument) { $argumentName = $argument->getName(); if ($this->request->hasArgument($argumentName)) { $argument->setValue($this->request-...
php
{ "resource": "" }
q256157
CommandController.callCommandMethod
test
protected function callCommandMethod() { $preparedArguments = []; foreach ($this->arguments as $argument) { $preparedArguments[] = $argument->getValue(); } $commandResult = $this->{$this->commandMethodName}(...$preparedArguments); if ($commandResult !== null) { ...
php
{ "resource": "" }
q256158
CommandController.createDefaultLogger
test
protected function createDefaultLogger($minimumLevel = LogLevel::DEBUG, $options = []) { $options['output'] = $this->output->getSymfonyConsoleOutput(); $logger = new Logger(get_class($this)); $logger->addWriter($minimumLevel, new ConsoleWriter($options)); return $logger; }
php
{ "resource": "" }
q256159
Command.getShortDescription
test
public function getShortDescription(): string { $lines = explode(LF, $this->commandReflection->getDescription()); return !empty($lines) ? trim($lines[0]) : '<no description available>'; }
php
{ "resource": "" }
q256160
Command.parseDefinitions
test
private function parseDefinitions(): array { $definitions = []; $reader = new AnnotationReader(); $method = new \ReflectionMethod($this->controllerClassName, $this->controllerCommandMethod); foreach ($reader->getMethodAnnotations($method) as $annotation) { if ($annotation...
php
{ "resource": "" }
q256161
Command.getSynopsis
test
public function getSynopsis($short = false): string { $key = $short ? 'short' : 'long'; if (isset($this->synopsis[$key])) { return $this->synopsis[$key]; } $elements = []; if ($short && $this->hasOptions()) { $elements[] = '[options]'; } elsei...
php
{ "resource": "" }
q256162
Sequence.removeStep
test
public function removeStep($stepIdentifier) { $removedOccurrences = 0; foreach ($this->steps as $previousStepIdentifier => $steps) { foreach ($steps as $index => $step) { if ($step->getIdentifier() === $stepIdentifier) { unset($this->steps[$previousSte...
php
{ "resource": "" }
q256163
Sequence.invoke
test
public function invoke(Bootstrap $bootstrap) { if (isset($this->steps['start'])) { foreach ($this->steps['start'] as $step) { $this->invokeStep($step, $bootstrap); } } }
php
{ "resource": "" }
q256164
Sequence.invokeStep
test
protected function invokeStep(Step $step, Bootstrap $bootstrap) { $identifier = $step->getIdentifier(); try { $step($bootstrap); } catch (\Throwable $e) { throw new StepFailedException($step, $e); } if (isset($this->steps[$identifier])) { f...
php
{ "resource": "" }
q256165
ExtensionCommandController.setupExtensions
test
private function setupExtensions(array $packages, $verbose = false) { $extensionSetupResultRenderer = new ExtensionSetupResultRenderer($this->signalSlotDispatcher); $extensionSetup = new ExtensionSetup( new ExtensionFactory($this->packageManager), $this->getExtensionInstalle...
php
{ "resource": "" }
q256166
ExtensionCommandController.setupActiveCommand
test
public function setupActiveCommand() { $verbose = $this->output->getSymfonyConsoleOutput()->isVerbose(); $this->setupExtensions($this->packageManager->getActivePackages(), $verbose); }
php
{ "resource": "" }
q256167
ExtensionCommandController.removeInactiveCommand
test
public function removeInactiveCommand($force = false) { $this->outputLine('<warning>This command is deprecated and will be removed with TYPO3 Console 6.0</warning>'); if ($force) { $activePackages = $this->packageManager->getActivePackages(); $this->packageManager->scanAvaila...
php
{ "resource": "" }
q256168
ExtensionCommandController.listCommand
test
public function listCommand($active = false, $inactive = false, $raw = false) { $extensionInformation = []; if (!$active || $inactive) { $this->emitPackagesMayHaveChangedSignal(); $packages = $this->packageManager->getAvailablePackages(); } else { $package...
php
{ "resource": "" }
q256169
CacheLowLevelCleaner.forceFlushDatabaseCacheTables
test
public function forceFlushDatabaseCacheTables() { // Get all table names from Default connection starting with 'cf_' and truncate them $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); $connection = $connectionPool->getConnectionByName('Default'); $tableNames = $...
php
{ "resource": "" }
q256170
ErrorHandler.handleError
test
public function handleError($errorLevel, $errorMessage, $errorFile, $errorLine) { if (error_reporting() === 0) { return; } $errorLevels = [ E_WARNING => 'Warning', E_NOTICE => 'Notice', E_USER_ERROR => 'User Error', E_USER_WARNING ...
php
{ "resource": "" }
q256171
InstallerScripts.register
test
public static function register(Event $event, ScriptDispatcher $scriptDispatcher) { $scriptDispatcher->addInstallerScript(new PopulateCommandConfiguration(), 70); if (!class_exists(\TYPO3\CMS\Core\Composer\InstallerScripts::class) && !class_exists(\Helhum\Typo3ComposerSetup\Composer\Inst...
php
{ "resource": "" }
q256172
ConsoleOutput.select
test
public function select($question, $choices, $default = null, $multiSelect = false, $attempts = false) { $question = (new ChoiceQuestion($question, $choices, $default)) ->setMultiselect($multiSelect) ->setMaxAttempts($attempts) ->setErrorMessage('Value "%s" is invalid'); ...
php
{ "resource": "" }
q256173
ConsoleOutput.ask
test
public function ask($question, $default = null, array $autocomplete = null) { $question = (new Question($question, $default)) ->setAutocompleterValues($autocomplete); return $this->getQuestionHelper()->ask($this->getInput(), $this->output, $question); }
php
{ "resource": "" }
q256174
ConsoleOutput.askConfirmation
test
public function askConfirmation($question, $default = true) { $question = new ConfirmationQuestion($question, $default); return $this->getQuestionHelper()->ask($this->getInput(), $this->output, $question); }
php
{ "resource": "" }
q256175
ConsoleOutput.askHiddenResponse
test
public function askHiddenResponse($question, $fallback = true) { $question = (new Question($question)) ->setHidden(true) ->setHiddenFallback($fallback); return $this->getQuestionHelper()->ask($this->getInput(), $this->output, $question); }
php
{ "resource": "" }
q256176
ConsoleOutput.askAndValidate
test
public function askAndValidate($question, $validator, $attempts = false, $default = null, array $autocomplete = null) { $question = (new Question($question, $default)) ->setValidator($validator) ->setMaxAttempts($attempts) ->setAutocompleterValues($autocomplete); ...
php
{ "resource": "" }
q256177
ConsoleOutput.askHiddenResponseAndValidate
test
public function askHiddenResponseAndValidate($question, $validator, $attempts = false, $fallback = true) { $question = (new Question($question)) ->setValidator($validator) ->setMaxAttempts($attempts) ->setHidden(true) ->setHiddenFallback($fallback); r...
php
{ "resource": "" }
q256178
ListCommand.execute
test
protected function execute(InputInterface $input, OutputInterface $output) { $helper = new DescriptorHelper(); $helper->register('txt', new TextDescriptor()); $helper->describe($output, $this->getApplication(), [ 'format' => $input->getOption('format'), 'raw_text' => ...
php
{ "resource": "" }
q256179
ConsoleWriter.writeLog
test
public function writeLog(\TYPO3\CMS\Core\Log\LogRecord $record) { $this->output->write( $this->wrapMessage(vsprintf($record->getMessage(), $record->getData()), $record->getLevel()), true ); return $this; }
php
{ "resource": "" }
q256180
SchemaUpdateResult.getPerformedUpdateTypes
test
public function getPerformedUpdateTypes() { $typesCount = []; foreach ($this->performedUpdates as $type => $performedUpdates) { $typesCount[$type] = count($performedUpdates); } return $typesCount; }
php
{ "resource": "" }
q256181
SchemaUpdateResult.addPerformedUpdates
test
public function addPerformedUpdates(SchemaUpdateType $schemaUpdateType, array $updates) { $this->performedUpdates[(string)$schemaUpdateType] = array_merge((array)$this->performedUpdates[(string)$schemaUpdateType], $updates); }
php
{ "resource": "" }
q256182
SchemaUpdateResult.addErrors
test
public function addErrors(SchemaUpdateType $schemaUpdateType, array $errors, array $statements = []) { $collectedErrors = []; foreach ($errors as $id => $error) { $collectedErrors[] = [ 'message' => $error, 'statement' => $statements[$id], ]; ...
php
{ "resource": "" }
q256183
ConfigurationCommandController.removeCommand
test
public function removeCommand(array $paths, $force = false) { foreach ($paths as $path) { if (!$this->configurationService->localIsActive($path)) { $this->outputLine('<warning>It seems that configuration for path "%s" is overridden.</warning>', [$path]); $this->ou...
php
{ "resource": "" }
q256184
ConfigurationCommandController.showCommand
test
public function showCommand($path) { $hasActive = $this->configurationService->hasActive($path); $hasLocal = $this->configurationService->hasLocal($path); if (!$hasActive && !$hasLocal) { $this->outputLine('<error>No configuration found for path "%s"</error>', [$path]); ...
php
{ "resource": "" }
q256185
ConfigurationCommandController.showActiveCommand
test
public function showActiveCommand($path, $json = false) { if (!$this->configurationService->hasActive($path)) { $this->outputLine('<error>No configuration found for path "%s"</error>', [$path]); $this->quit(1); } $active = $this->configurationService->getActive($path)...
php
{ "resource": "" }
q256186
ConfigurationCommandController.showLocalCommand
test
public function showLocalCommand($path, $json = false) { if (!$this->configurationService->hasLocal($path)) { $this->outputLine('<error>No configuration found for path "%s"</error>', [$path]); $this->quit(1); } $active = $this->configurationService->getLocal($path); ...
php
{ "resource": "" }
q256187
ConfigurationCommandController.setCommand
test
public function setCommand($path, $value, $json = false) { if (!$this->configurationService->localIsActive($path)) { $this->outputLine('<warning>It seems that configuration for path "%s" is overridden.</warning>', [$path]); $this->outputLine('<warning>Writing the new value might have...
php
{ "resource": "" }
q256188
ExtensionInstallation.afterInstallation
test
public function afterInstallation($keyOfInstalledExtension) { if (self::EXTKEY !== $keyOfInstalledExtension) { return; } $scriptName = $this->isWindowsOs() ? 'Scripts/' . Application::COMMAND_NAME . '.bat' : Application::COMMAND_NAME; $success = $this->safeCopy(PATH_site ...
php
{ "resource": "" }
q256189
ExtensionInstallation.addFlashMessage
test
protected function addFlashMessage($messageBody, $messageTitle = '', $severity = AbstractMessage::OK, $storeInSession = true) { if (PHP_SAPI === 'cli') { return; } if (!is_string($messageBody)) { throw new \InvalidArgumentException('The message body must be of type st...
php
{ "resource": "" }
q256190
ExtensionInstallation.safeCopy
test
private function safeCopy($fullSourcePath, $fullTargetPath, $relativeWebDir = '') { if (file_exists($fullTargetPath)) { if (!is_file($fullTargetPath)) { // Seems to be a directory: ignore return false; } if (!self::isTypo3CmsBinary($fullTar...
php
{ "resource": "" }
q256191
DocumentationCommandController.generateXsdCommand
test
public function generateXsdCommand($phpNamespace, $xsdNamespace = null, $targetFile = null) { if ($xsdNamespace === null) { $phpNamespace = rtrim($phpNamespace, '_\\'); if (strpos($phpNamespace, '\\') === false) { $search = ['Tx_', '_']; $replace = [''...
php
{ "resource": "" }
q256192
Scripts.initializePackageManagement
test
private static function initializePackageManagement(Bootstrap $bootstrap) { $packageManager = CompatibilityScripts::createPackageManager(); $bootstrap->setEarlyInstance(PackageManager::class, $packageManager); GeneralUtility::setSingletonInstance(PackageManager::class, $packageManager); ...
php
{ "resource": "" }
q256193
Scripts.overrideImplementation
test
public static function overrideImplementation($originalClassName, $overrideClassName) { self::registerImplementation($originalClassName, $overrideClassName); $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][$originalClassName]['className'] = $overrideClassName; class_alias($overrideClassName, $...
php
{ "resource": "" }
q256194
Scripts.registerImplementation
test
private static function registerImplementation($className, $alternativeClassName) { /** @var $extbaseObjectContainer \TYPO3\CMS\Extbase\Object\Container\Container */ $extbaseObjectContainer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class); ...
php
{ "resource": "" }
q256195
ConfigurationService.setLocal
test
public function setLocal($path, $value, $targetType = '') { try { $value = $this->convertToTargetType($path, $value, $targetType); return $this->configurationManager->setLocalConfigurationValueByPath($path, $value); } catch (TypesAreNotConvertibleException $e) { ...
php
{ "resource": "" }
q256196
ConfigurationService.convertToTargetType
test
public function convertToTargetType($path, $value, $targetType = '') { $targetType = $targetType ?: $this->getType($path); $actualType = gettype($value); if ($actualType !== $targetType && $targetType !== 'NULL') { if ($this->isTypeConvertible($targetType, $actualType)) { ...
php
{ "resource": "" }
q256197
ConfigurationService.getType
test
private function getType($path) { $value = null; if ($this->hasActive($path)) { $value = $this->getActive($path); } if ($this->hasLocal($path)) { $value = $this->getLocal($path); } if ($this->hasDefault($path)) { $value = $this->get...
php
{ "resource": "" }
q256198
ConfigurationService.isTypeConvertible
test
private function isTypeConvertible($targetType, $actualType) { if (in_array($targetType, ['array', 'object', 'resource'], true)) { return false; } if (in_array($actualType, ['array', 'object', 'resource'], true)) { return false; } return true; }
php
{ "resource": "" }
q256199
Application.isCommandAvailable
test
public function isCommandAvailable(Command $command): bool { if (!$this->isFullyCapable() && in_array($command->getName(), [ // Although these commands are technically available // they call other hidden commands in sub processes // that need all c...
php
{ "resource": "" }