idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
58,300 | public function buildPropertyMappingConfiguration ( $ type = PropertyMappingConfiguration :: class ) { $ configuration = new $ type ( ) ; $ configuration -> setTypeConverterOptions ( TypeConverter \ PersistentObjectConverter :: class , [ TypeConverter \ PersistentObjectConverter :: CONFIGURATION_CREATION_ALLOWED => tru... | Builds the default property mapping configuration . |
58,301 | public function canConvertFrom ( $ source , $ targetType ) { if ( ( $ this -> reflectionService -> isClassAnnotatedWith ( $ targetType , Flow \ Entity :: class ) || $ this -> reflectionService -> isClassAnnotatedWith ( $ targetType , Flow \ ValueObject :: class ) || $ this -> reflectionService -> isClassAnnotatedWith (... | Only convert if the given target class has a constructor with one argument being of type given type |
58,302 | protected function initializeCommandMethodArguments ( ) { $ this -> arguments -> removeAll ( ) ; $ methodParameters = $ this -> commandManager -> getCommandMethodParameters ( get_class ( $ this ) , $ this -> commandMethodName ) ; foreach ( $ methodParameters as $ parameterName => $ parameterInfo ) { $ dataType = null ;... | Initializes the arguments array of this controller by creating an empty argument object for each of the method arguments found in the designated command method . |
58,303 | protected function callCommandMethod ( ) { $ preparedArguments = [ ] ; foreach ( $ this -> arguments as $ argument ) { $ preparedArguments [ ] = $ argument -> getValue ( ) ; } $ command = new Command ( get_class ( $ this ) , $ this -> request -> getControllerCommandName ( ) ) ; if ( $ command -> isDeprecated ( ) ) { $ ... | Calls the specified command method and passes the arguments . |
58,304 | public function formatNumberWithCustomPattern ( $ number , $ format , Locale $ locale ) { return $ this -> doFormattingWithParsedFormat ( $ number , $ this -> numbersReader -> parseCustomFormat ( $ format ) , $ this -> numbersReader -> getLocalizedSymbolsForLocale ( $ locale ) ) ; } | Returns number formatted by custom format string provided in parameter . |
58,305 | public function formatDecimalNumber ( $ number , Locale $ locale , $ formatLength = NumbersReader :: FORMAT_LENGTH_DEFAULT ) { NumbersReader :: validateFormatLength ( $ formatLength ) ; return $ this -> doFormattingWithParsedFormat ( $ number , $ this -> numbersReader -> parseFormatFromCldr ( $ locale , NumbersReader :... | Formats number with format string for decimal numbers defined in CLDR for particular locale . |
58,306 | public function formatPercentNumber ( $ number , Locale $ locale , $ formatLength = NumbersReader :: FORMAT_LENGTH_DEFAULT ) { NumbersReader :: validateFormatLength ( $ formatLength ) ; return $ this -> doFormattingWithParsedFormat ( $ number , $ this -> numbersReader -> parseFormatFromCldr ( $ locale , NumbersReader :... | Formats number with format string for percentage defined in CLDR for particular locale . |
58,307 | public function formatCurrencyNumber ( $ number , Locale $ locale , $ currency , $ formatLength = NumbersReader :: FORMAT_LENGTH_DEFAULT , $ currencyCode = null ) { NumbersReader :: validateFormatLength ( $ formatLength ) ; $ parsedFormat = $ this -> numbersReader -> parseFormatFromCldr ( $ locale , NumbersReader :: FO... | Formats number with format string for currency defined in CLDR for particular locale . |
58,308 | public static function renderRequestHeaders ( RequestInterface $ request ) : string { $ renderedHeaders = '' ; $ headers = $ request -> getHeaders ( ) ; if ( $ headers instanceof Headers ) { $ renderedHeaders .= $ headers -> __toString ( ) ; } else { foreach ( array_keys ( $ headers ) as $ name ) { $ renderedHeaders .=... | Renders the HTTP headers - EXCLUDING the status header - of the given request |
58,309 | public static function getContentCharset ( RequestInterface $ request ) : string { $ contentType = $ request -> getHeaderLine ( 'Content-Type' ) ; if ( preg_match ( '/[^;]+; ?charset=(?P<charset>[^;]+);?.*/' , $ contentType , $ matches ) ) { return $ matches [ 'charset' ] ; } return '' ; } | Extract the charset from the content type header if available |
58,310 | public static function generateRandomString ( $ count , $ characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' ) { $ characterCount = \ Neos \ Utility \ Unicode \ Functions :: strlen ( $ characters ) ; $ string = '' ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { $ string .= \ Neos \ Utility \ Uni... | Returns a random string with alpha - numeric characters . |
58,311 | protected function doParsingFromRoot ( \ SimpleXMLElement $ root ) : array { $ parsedData = [ ] ; foreach ( $ root -> children ( ) as $ file ) { $ parsedData [ ] = $ this -> getFileData ( $ file ) ; } return $ parsedData ; } | Returns array representation of XLIFF data starting from a root node . |
58,312 | protected function configureLockDirectory ( string $ lockDirectory ) { Utility \ Files :: createDirectoryRecursively ( $ lockDirectory ) ; $ this -> temporaryDirectory = $ lockDirectory ; } | Sets the temporaryDirectory as static variable for the lock class . |
58,313 | protected function tryToAcquireLock ( bool $ exclusiveLock ) : bool { $ this -> filePointer = @ fopen ( $ this -> lockFileName , 'w' ) ; if ( $ this -> filePointer === false ) { throw new LockNotAcquiredException ( sprintf ( 'Lock file "%s" could not be opened' , $ this -> lockFileName ) , 1386520596 ) ; } $ this -> ap... | Tries to open a lock file and apply the lock to it . |
58,314 | protected function applyFlock ( bool $ exclusiveLock ) { $ lockOption = $ exclusiveLock === true ? LOCK_EX : LOCK_SH ; if ( flock ( $ this -> filePointer , $ lockOption ) !== true ) { throw new LockNotAcquiredException ( sprintf ( 'Could not lock file "%s"' , $ this -> lockFileName ) , 1386520597 ) ; } } | apply flock to the opened lock file . |
58,315 | public function release ( ) : bool { $ success = true ; if ( is_resource ( $ this -> filePointer ) ) { if ( flock ( $ this -> filePointer , LOCK_UN ) === false ) { $ success = false ; } fclose ( $ this -> filePointer ) ; } return $ success ; } | Releases the lock |
58,316 | protected function isValid ( $ value ) { if ( ! isset ( $ this -> options [ 'locale' ] ) ) { $ locale = $ this -> localizationService -> getConfiguration ( ) -> getDefaultLocale ( ) ; } elseif ( is_string ( $ this -> options [ 'locale' ] ) ) { $ locale = new I18n \ Locale ( $ this -> options [ 'locale' ] ) ; } elseif (... | Checks if the given value is a valid number . |
58,317 | protected function prepareCookie ( string $ name , string $ value ) { return new Cookie ( $ name , $ value , 0 , $ this -> sessionSettings [ 'cookie' ] [ 'lifetime' ] , $ this -> sessionSettings [ 'cookie' ] [ 'domain' ] , $ this -> sessionSettings [ 'cookie' ] [ 'path' ] , $ this -> sessionSettings [ 'cookie' ] [ 'sec... | Prepares a cookie object for the session . |
58,318 | public function handle ( ComponentContext $ componentContext ) { $ componentContext = $ this -> prepareActionRequest ( $ componentContext ) ; $ actionRequest = $ componentContext -> getParameter ( DispatchComponent :: class , 'actionRequest' ) ; $ this -> setDefaultControllerAndActionNameIfNoneSpecified ( $ actionReque... | Create an action request from stored route match values and dispatch to that |
58,319 | protected function prepareActionRequest ( ComponentContext $ componentContext ) { $ httpRequest = $ componentContext -> getHttpRequest ( ) ; $ arguments = $ httpRequest -> getArguments ( ) ; $ parsedBody = $ this -> parseRequestBody ( $ httpRequest ) ; if ( $ parsedBody !== [ ] ) { $ arguments = Arrays :: arrayMergeRec... | Create ActionRequest with arguments from body and routing merged and add it to the component context . |
58,320 | protected function parseRequestBody ( HttpRequest $ httpRequest ) { $ requestBody = $ httpRequest -> getContent ( ) ; if ( $ requestBody === null || $ requestBody === '' ) { return [ ] ; } $ mediaTypeConverter = $ this -> objectManager -> get ( MediaTypeConverterInterface :: class ) ; $ propertyMappingConfiguration = n... | Parses the request body according to the media type . |
58,321 | protected function setDefaultControllerAndActionNameIfNoneSpecified ( ActionRequest $ actionRequest ) { if ( $ actionRequest -> getControllerName ( ) === null ) { $ actionRequest -> setControllerName ( 'Standard' ) ; } if ( $ actionRequest -> getControllerActionName ( ) === null ) { $ actionRequest -> setControllerActi... | Set the default controller and action names if none has been specified . |
58,322 | protected function prepareActionResponse ( \ Psr \ Http \ Message \ ResponseInterface $ httpResponse ) : ActionResponse { $ rawResponse = implode ( "\r\n" , ResponseInformationHelper :: prepareHeaders ( $ httpResponse ) ) ; $ rawResponse .= "\r\n\r\n" ; $ rawResponse .= $ httpResponse -> getBody ( ) -> getContents ( ) ... | Prepares the ActionResponse to be dispatched |
58,323 | public static function initializeClassLoader ( Bootstrap $ bootstrap ) { $ proxyClassLoader = new ProxyClassLoader ( $ bootstrap -> getContext ( ) ) ; spl_autoload_register ( [ $ proxyClassLoader , 'loadClass' ] , true , true ) ; $ bootstrap -> setEarlyInstance ( ProxyClassLoader :: class , $ proxyClassLoader ) ; if ( ... | Initializes the Class Loader |
58,324 | public static function registerClassLoaderInAnnotationRegistry ( Bootstrap $ bootstrap ) { AnnotationRegistry :: registerLoader ( [ $ bootstrap -> getEarlyInstance ( \ Composer \ Autoload \ ClassLoader :: class ) , 'loadClass' ] ) ; if ( self :: useClassLoader ( $ bootstrap ) ) { AnnotationRegistry :: registerLoader ( ... | Register the class loader into the Doctrine AnnotationRegistry so the DocParser is able to load annation classes from packages . |
58,325 | public static function initializeClassLoaderClassesCache ( Bootstrap $ bootstrap ) { $ classesCache = $ bootstrap -> getEarlyInstance ( CacheManager :: class ) -> getCache ( 'Flow_Object_Classes' ) ; $ bootstrap -> getEarlyInstance ( ProxyClassLoader :: class ) -> injectClassesCache ( $ classesCache ) ; } | Injects the classes cache to the already initialized class loader |
58,326 | public static function forceFlushCachesIfNecessary ( Bootstrap $ bootstrap ) { if ( ! isset ( $ _SERVER [ 'argv' ] ) || ! isset ( $ _SERVER [ 'argv' ] [ 1 ] ) || ! isset ( $ _SERVER [ 'argv' ] [ 2 ] ) || ! in_array ( $ _SERVER [ 'argv' ] [ 1 ] , [ 'neos.flow:cache:flush' , 'flow:cache:flush' ] ) || ! in_array ( $ _SERV... | Does some emergency forced low level flush caches if the user told to do so through the command line . |
58,327 | public static function initializePackageManagement ( Bootstrap $ bootstrap ) { $ packageManager = new PackageManager ( PackageManager :: DEFAULT_PACKAGE_INFORMATION_CACHE_FILEPATH , FLOW_PATH_PACKAGES ) ; $ bootstrap -> setEarlyInstance ( PackageManagerInterface :: class , $ packageManager ) ; $ bootstrap -> setEarlyIn... | Initializes the package system and loads the package configuration and settings provided by the packages . |
58,328 | public static function initializeConfiguration ( Bootstrap $ bootstrap ) { $ context = $ bootstrap -> getContext ( ) ; $ environment = new Environment ( $ context ) ; $ environment -> setTemporaryDirectoryBase ( FLOW_PATH_TEMPORARY_BASE ) ; $ bootstrap -> setEarlyInstance ( Environment :: class , $ environment ) ; $ pa... | Initializes the Configuration Manager the Flow settings and the Environment service |
58,329 | public static function initializeSystemLogger ( Bootstrap $ bootstrap ) { $ configurationManager = $ bootstrap -> getEarlyInstance ( ConfigurationManager :: class ) ; $ settings = $ configurationManager -> getConfiguration ( ConfigurationManager :: CONFIGURATION_TYPE_SETTINGS , 'Neos.Flow' ) ; $ throwableStorage = self... | Initializes the System Logger |
58,330 | protected static function initializeExceptionStorage ( Bootstrap $ bootstrap ) : ThrowableStorageInterface { $ configurationManager = $ bootstrap -> getEarlyInstance ( ConfigurationManager :: class ) ; $ settings = $ configurationManager -> getConfiguration ( ConfigurationManager :: CONFIGURATION_TYPE_SETTINGS , 'Neos.... | Initialize the exception storage |
58,331 | public static function initializeErrorHandling ( Bootstrap $ bootstrap ) { $ configurationManager = $ bootstrap -> getEarlyInstance ( ConfigurationManager :: class ) ; $ settings = $ configurationManager -> getConfiguration ( ConfigurationManager :: CONFIGURATION_TYPE_SETTINGS , 'Neos.Flow' ) ; $ errorHandler = new Err... | Initializes the error handling |
58,332 | public static function initializeCacheManagement ( Bootstrap $ bootstrap ) { $ configurationManager = $ bootstrap -> getEarlyInstance ( ConfigurationManager :: class ) ; $ environment = $ bootstrap -> getEarlyInstance ( Environment :: class ) ; $ cacheFactoryObjectConfiguration = $ configurationManager -> getConfigurat... | Initializes the cache framework |
58,333 | public static function initializeProxyClasses ( Bootstrap $ bootstrap ) { $ objectConfigurationCache = $ bootstrap -> getEarlyInstance ( CacheManager :: class ) -> getCache ( 'Flow_Object_Configuration' ) ; if ( $ objectConfigurationCache -> has ( 'allCompiledCodeUpToDate' ) === true ) { return ; } $ configurationManag... | Runs the compile step if necessary |
58,334 | public static function initializeObjectManager ( Bootstrap $ bootstrap ) { $ configurationManager = $ bootstrap -> getEarlyInstance ( ConfigurationManager :: class ) ; $ objectConfigurationCache = $ bootstrap -> getEarlyInstance ( CacheManager :: class ) -> getCache ( 'Flow_Object_Configuration' ) ; $ objectManager = n... | Initializes the runtime Object Manager |
58,335 | public static function initializeReflectionServiceFactory ( Bootstrap $ bootstrap ) { $ reflectionServiceFactory = new ReflectionServiceFactory ( $ bootstrap ) ; $ bootstrap -> setEarlyInstance ( ReflectionServiceFactory :: class , $ reflectionServiceFactory ) ; $ bootstrap -> getObjectManager ( ) -> setInstance ( Refl... | Initializes the Reflection Service Factory |
58,336 | public static function initializeReflectionService ( Bootstrap $ bootstrap ) { $ reflectionService = $ bootstrap -> getEarlyInstance ( ReflectionServiceFactory :: class ) -> create ( ) ; $ bootstrap -> setEarlyInstance ( ReflectionService :: class , $ reflectionService ) ; $ bootstrap -> getObjectManager ( ) -> setInst... | Initializes the Reflection Service |
58,337 | protected static function monitorDirectoryIfItExists ( FileMonitor $ fileMonitor , string $ path , string $ filenamePattern = null ) { if ( is_dir ( $ path ) ) { $ fileMonitor -> monitorDirectory ( $ path , $ filenamePattern ) ; } } | Let the given file monitor track changes of the specified directory if it exists . |
58,338 | protected static function compileDoctrineProxies ( Bootstrap $ bootstrap ) { $ cacheManager = $ bootstrap -> getEarlyInstance ( CacheManager :: class ) ; $ objectConfigurationCache = $ cacheManager -> getCache ( 'Flow_Object_Configuration' ) ; $ coreCache = $ cacheManager -> getCache ( 'Flow_Core' ) ; $ configurationMa... | Update Doctrine 2 proxy classes |
58,339 | public static function executeCommand ( string $ commandIdentifier , array $ settings , bool $ outputResults = true , array $ commandArguments = [ ] ) : bool { $ command = self :: buildSubprocessCommand ( $ commandIdentifier , $ settings , $ commandArguments ) ; $ output = [ ] ; $ command .= ' 2>&1' ; exec ( $ command ... | Executes the given command as a sub - request to the Flow CLI system . |
58,340 | public static function executeCommandAsync ( string $ commandIdentifier , array $ settings , array $ commandArguments = [ ] ) { $ command = self :: buildSubprocessCommand ( $ commandIdentifier , $ settings , $ commandArguments ) ; if ( DIRECTORY_SEPARATOR === '/' ) { exec ( $ command . ' > /dev/null 2>/dev/null &' ) ; ... | Executes the given command as a sub - request to the Flow CLI system without waiting for the output . |
58,341 | public function render ( ) { $ date = $ this -> arguments [ 'date' ] ; $ cldrFormat = $ this -> arguments [ 'cldrFormat' ] ; if ( $ date === null ) { $ date = $ this -> renderChildren ( ) ; if ( $ date === null ) { return '' ; } } if ( ! $ date instanceof \ DateTimeInterface ) { try { $ date = new \ DateTime ( $ date )... | Render the supplied DateTime object as a formatted date . |
58,342 | public function render ( ) { $ methodDocumentation = $ this -> buildMethodDocumentation ( $ this -> fullOriginalClassName , $ this -> methodName ) ; $ methodParametersCode = ( $ this -> methodParametersCode !== '' ? $ this -> methodParametersCode : $ this -> buildMethodParametersCode ( $ this -> fullOriginalClassName ,... | Renders the PHP code for this Proxy Method |
58,343 | protected function buildMethodDocumentation ( $ className , $ methodName ) { $ methodDocumentation = " /**\n * Autogenerated Proxy Method\n" ; if ( $ this -> reflectionService -> hasMethod ( $ className , $ methodName ) ) { $ methodTags = $ this -> reflectionService -> getMethodTagsValues ( $ className , $ metho... | Builds the method documentation block for the specified method keeping the vital annotations |
58,344 | public function buildMethodParametersCode ( $ fullClassName , $ methodName , $ addTypeAndDefaultValue = true ) { $ methodParametersCode = '' ; $ methodParameterTypeName = '' ; $ nullableSign = '' ; $ defaultValue = '' ; $ byReferenceSign = '' ; if ( $ fullClassName === null || $ methodName === null ) { return '' ; } $ ... | Builds the PHP code for the parameters of the specified method to be used in a method interceptor in the proxy class |
58,345 | protected function buildArraySetupCode ( array $ array ) { $ code = 'array(' ; foreach ( $ array as $ key => $ value ) { $ code .= ( is_string ( $ key ) ) ? "'" . $ key . "'" : $ key ; $ code .= ' => ' ; if ( $ value === null ) { $ code .= 'NULL' ; } elseif ( is_bool ( $ value ) ) { $ code .= ( $ value ? 'true' : 'fals... | Builds a string containing PHP code to build the array given as input . |
58,346 | public function matchRequest ( RequestInterface $ request ) { if ( ! $ request instanceof ActionRequest ) { return false ; } if ( ! isset ( $ this -> options [ 'uriPattern' ] ) ) { throw new InvalidRequestPatternException ( 'Missing option "uriPattern" in the Uri request pattern configuration' , 1446224530 ) ; } return... | Matches a \ Neos \ Flow \ Mvc \ RequestInterface against its set URL pattern rules |
58,347 | public function handle ( ComponentContext $ componentContext ) { $ response = $ componentContext -> getHttpResponse ( ) ; $ response = ResponseInformationHelper :: makeStandardsCompliant ( $ response , $ componentContext -> getHttpRequest ( ) ) ; $ componentContext -> replaceHttpResponse ( $ response ) ; } | Just call makeStandardsCompliant on the Response for now |
58,348 | protected function echoExceptionWeb ( $ exception ) { $ statusCode = ( $ exception instanceof WithHttpStatusInterface ) ? $ exception -> getStatusCode ( ) : 500 ; $ statusMessage = ResponseInformationHelper :: getStatusMessageByCode ( $ statusCode ) ; $ referenceCode = ( $ exception instanceof WithReferenceCodeInterfac... | Echoes an exception for the web . |
58,349 | public function setContentType ( string $ contentType ) : void { $ this -> contentType = $ contentType ; $ this -> headers -> set ( 'Content-Type' , $ contentType , true ) ; } | Set content mime type for this response . |
58,350 | public function setRedirectUri ( UriInterface $ uri , int $ statusCode = 303 ) : void { $ this -> redirectUri = $ uri ; $ this -> statusCode = $ statusCode ; $ this -> headers -> set ( 'Location' , ( string ) $ uri , true ) ; $ this -> setStatusCode ( $ statusCode ) ; } | Set a redirect URI and according status for this response . |
58,351 | public function postUp ( Schema $ schema ) { if ( ! $ this -> sm -> tablesExist ( [ 'typo3_flow_resource_resource' ] ) ) { return ; } $ resourcesResult = $ this -> connection -> executeQuery ( 'SELECT persistence_object_identifier, sha1, filename FROM typo3_flow_resource_resource' ) ; while ( $ resourceInfo = $ resourc... | Move resource files to the new locations and adjust records . |
58,352 | public function postDown ( Schema $ schema ) { if ( ! $ this -> sm -> tablesExist ( [ 'typo3_flow_resource_resource' ] ) ) { return ; } $ resourcesResult = $ this -> connection -> executeQuery ( 'SELECT DISTINCT resourcepointer FROM typo3_flow_resource_resource' ) ; while ( $ resourceInfo = $ resourcesResult -> fetch (... | Move resource files back to the old locations and adjust records . |
58,353 | public function initialize ( ) { if ( $ this -> initialized === true ) { return ; } if ( $ this -> canBeInitialized ( ) === false ) { throw new Exception ( 'The security Context cannot be initialized yet. Please check if it can be initialized with $securityContext->canBeInitialized() before trying to do so.' , 13585138... | Initializes the security context for the given request . |
58,354 | public function getRoles ( ) { if ( $ this -> initialized === false ) { $ this -> initialize ( ) ; } if ( $ this -> roles !== null ) { return $ this -> roles ; } $ this -> roles = [ 'Neos.Flow:Everybody' => $ this -> policyService -> getRole ( 'Neos.Flow:Everybody' ) ] ; $ authenticatedTokens = array_filter ( $ this ->... | Returns the roles of all authenticated accounts including inherited roles . |
58,355 | public function getAccountByAuthenticationProviderName ( $ authenticationProviderName ) { if ( $ this -> initialized === false ) { $ this -> initialize ( ) ; } if ( isset ( $ this -> activeTokens [ $ authenticationProviderName ] ) && $ this -> activeTokens [ $ authenticationProviderName ] -> isAuthenticated ( ) === tru... | Returns an authenticated account for the given provider or NULL if no account was authenticated or no token was registered for the given authentication provider name . |
58,356 | public function getCsrfProtectionToken ( ) { $ sessionDataContainer = $ this -> objectManager -> get ( SessionDataContainer :: class ) ; $ csrfProtectionTokens = $ sessionDataContainer -> getCsrfProtectionTokens ( ) ; if ( $ this -> csrfProtectionStrategy === self :: CSRF_ONE_PER_SESSION && count ( $ csrfProtectionToke... | Returns the current CSRF protection token . A new one is created when needed depending on the configured CSRF protection strategy . |
58,357 | public function hasCsrfProtectionTokens ( ) { $ sessionDataContainer = $ this -> objectManager -> get ( SessionDataContainer :: class ) ; $ csrfProtectionTokens = $ sessionDataContainer -> getCsrfProtectionTokens ( ) ; return count ( $ csrfProtectionTokens ) > 0 ; } | Returns true if the context has CSRF protection tokens . |
58,358 | public function isCsrfProtectionTokenValid ( $ csrfToken ) { $ sessionDataContainer = $ this -> objectManager -> get ( SessionDataContainer :: class ) ; $ csrfProtectionTokens = $ sessionDataContainer -> getCsrfProtectionTokens ( ) ; if ( ! isset ( $ csrfProtectionTokens [ $ csrfToken ] ) && ! isset ( $ this -> csrfTok... | Returns true if the given string is a valid CSRF protection token . The token will be removed if the configured csrf strategy is onePerUri . |
58,359 | public function setInterceptedRequest ( ActionRequest $ interceptedRequest = null ) { if ( $ this -> initialized === false ) { $ this -> initialize ( ) ; } $ sessionDataContainer = $ this -> objectManager -> get ( SessionDataContainer :: class ) ; $ sessionDataContainer -> setInterceptedRequest ( $ interceptedRequest )... | Sets an action request to be stored for later resuming after it has been intercepted by a security exception . |
58,360 | public function getInterceptedRequest ( ) { if ( $ this -> initialized === false ) { $ this -> initialize ( ) ; } $ sessionDataContainer = $ this -> objectManager -> get ( SessionDataContainer :: class ) ; return $ sessionDataContainer -> getInterceptedRequest ( ) ; } | Returns the request that has been stored for later resuming after it has been intercepted by a security exception NULL if there is none . |
58,361 | protected function isTokenActive ( TokenInterface $ token ) { if ( ! $ token -> hasRequestPatterns ( ) ) { return true ; } $ requestPatternsByType = [ ] ; foreach ( $ token -> getRequestPatterns ( ) as $ requestPattern ) { $ patternType = TypeHandling :: getTypeForValue ( $ requestPattern ) ; if ( isset ( $ requestPatt... | Evaluates any RequestPatterns of the given token to determine whether it is active for the current request - If no RequestPattern is configured for this token it is active - Otherwise it is active only if at least one configured RequestPattern per type matches the request |
58,362 | protected function findBestMatchingToken ( TokenInterface $ managerToken , array $ sessionTokens ) : TokenInterface { $ matchingSessionTokens = array_filter ( $ sessionTokens , function ( TokenInterface $ sessionToken ) use ( $ managerToken ) { return ( $ sessionToken -> getAuthenticationProviderName ( ) === $ managerT... | Tries to find a token matchting the given manager token in the session tokens will return that or the manager token . |
58,363 | protected function updateTokens ( array $ tokens ) { $ this -> roles = null ; $ this -> contextHash = null ; if ( $ this -> request === null ) { return ; } foreach ( $ tokens as $ token ) { $ token -> updateCredentials ( $ this -> request ) ; } $ sessionDataContainer = $ this -> objectManager -> get ( SessionDataContai... | Updates the token credentials for all tokens in the given array . |
58,364 | public function refreshTokens ( ) { if ( $ this -> initialized === false ) { $ this -> initialize ( ) ; } $ this -> updateTokens ( $ this -> activeTokens ) ; } | Refreshes all active tokens by updating the credentials . This is useful when doing an explicit authentication inside a request . |
58,365 | public function handleAdditionalArguments ( array $ arguments ) { $ unassigned = [ ] ; foreach ( $ arguments as $ argumentName => $ argumentValue ) { if ( strpos ( $ argumentName , 'data-' ) === 0 ) { $ this -> tag -> addAttribute ( $ argumentName , $ argumentValue ) ; } else { $ unassigned [ $ argumentName ] = $ argum... | Handles additional arguments sorting out any data - prefixed tag attributes and assigning them . Then passes the unassigned arguments to the parent class method which in the default implementation will throw an error about undeclared argument used . |
58,366 | protected function migrateAccountRolesUp ( ) { if ( ! $ this -> sm -> tablesExist ( [ 'typo3_flow_security_account' ] ) ) { return ; } $ rolesSql = array ( ) ; $ accountRolesSql = array ( ) ; $ rolesToMigrate = array ( ) ; $ accountsResult = $ this -> connection -> executeQuery ( 'SELECT DISTINCT(roles) FROM typo3_flow... | Generate SQL statements to migrate accounts up to referenced roles . |
58,367 | protected function getRoleIdentifierMap ( array $ map ) { $ rolesFromPolicy = $ this -> loadRolesFromPolicyFiles ( ) ; foreach ( $ rolesFromPolicy as $ newRoleIdentifier ) { $ map [ substr ( $ newRoleIdentifier , strrpos ( $ newRoleIdentifier , ':' ) + 1 ) ] = $ newRoleIdentifier ; } $ map [ 'Anonymous' ] = 'Anonymous'... | Returns the given array indexed by old role identifiers with the new identifiers added as values to their matching index . |
58,368 | protected function loadRolesFromPolicyFiles ( ) { $ roles = array ( ) ; $ yamlPathsAndFilenames = Files :: readDirectoryRecursively ( __DIR__ . '/../../../../../Packages' , 'yaml' , true ) ; $ configurationPathsAndFilenames = array_filter ( $ yamlPathsAndFilenames , function ( $ pathAndFileName ) { if ( basename ( $ pa... | Reads all Policy . yaml files below Packages extracts the roles and prepends them with the package key guessed from the path . |
58,369 | public function remove ( string $ entryIdentifier ) : bool { if ( ! isset ( $ this -> entries [ $ entryIdentifier ] ) ) { return false ; } unset ( $ this -> entries [ $ entryIdentifier ] ) ; foreach ( array_keys ( $ this -> tagsAndEntries ) as $ tag ) { if ( isset ( $ this -> tagsAndEntries [ $ tag ] [ $ entryIdentifie... | Removes all cache entries matching the specified identifier . |
58,370 | public static function determineAcceptedMediaTypes ( RequestInterface $ request ) : array { $ rawValues = $ request -> getHeader ( 'Accept' ) ; if ( empty ( $ rawValues ) || ! is_string ( $ rawValues ) ) { return [ '*/*' ] ; } $ acceptedMediaTypes = self :: parseContentNegotiationQualityValues ( $ rawValues ) ; return ... | Get accepted media types for the given request . If no Accept header was found all media types are acceptable . |
58,371 | public static function negotiateMediaType ( array $ acceptedMediaTypes , array $ supportedMediaTypes , bool $ trim = true ) : ? string { $ negotiatedMediaType = null ; foreach ( $ acceptedMediaTypes as $ acceptedMediaType ) { foreach ( $ supportedMediaTypes as $ supportedMediaType ) { if ( MediaTypes :: mediaRangeMatch... | Returns the best fitting IANA media type after applying the content negotiation rules on the accepted media types . |
58,372 | public static function parseContentNegotiationQualityValues ( string $ rawValues ) : array { $ acceptedTypes = array_map ( function ( $ acceptType ) { $ typeAndQuality = preg_split ( '/;\s*q=/' , $ acceptType ) ; return [ $ typeAndQuality [ 0 ] , ( isset ( $ typeAndQuality [ 1 ] ) ? ( float ) $ typeAndQuality [ 1 ] : '... | Parses a RFC 2616 content negotiation header field by evaluating the Quality Values and splitting the options into an array list ordered by user preference . |
58,373 | public function initializeArguments ( ) { $ this -> registerArgument ( 'path' , 'string' , 'Location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI' , false , null ) ; $ this -> registerArgument ( 'package' , 'string' , 'Target package key. If not ... | Initialize and register all arguments . |
58,374 | public function registerCache ( FrontendInterface $ cache , bool $ persistent = false ) : void { $ identifier = $ cache -> getIdentifier ( ) ; if ( isset ( $ this -> caches [ $ identifier ] ) ) { throw new DuplicateIdentifierException ( 'A cache with identifier "' . $ identifier . '" has already been registered.' , 120... | Registers a cache so it can be retrieved at a later point . |
58,375 | public function hasCache ( string $ identifier ) : bool { return isset ( $ this -> caches [ $ identifier ] ) || isset ( $ this -> cacheConfigurations [ $ identifier ] ) ; } | Checks if the specified cache has been registered . |
58,376 | public function flushCaches ( bool $ flushPersistentCaches = false ) : void { $ this -> createAllCaches ( ) ; foreach ( $ this -> caches as $ identifier => $ cache ) { if ( ! $ flushPersistentCaches && $ this -> isCachePersistent ( $ identifier ) ) { continue ; } $ cache -> flush ( ) ; } $ this -> configurationManager ... | Flushes all registered caches |
58,377 | public function flushCachesByTag ( string $ tag , bool $ flushPersistentCaches = false ) : void { $ this -> createAllCaches ( ) ; foreach ( $ this -> caches as $ identifier => $ cache ) { if ( ! $ flushPersistentCaches && $ this -> isCachePersistent ( $ identifier ) ) { continue ; } $ cache -> flushByTag ( $ tag ) ; } ... | Flushes entries tagged by the specified tag of all registered caches . |
58,378 | public function flushSystemCachesByChangedFiles ( string $ fileMonitorIdentifier , array $ changedFiles ) : void { switch ( $ fileMonitorIdentifier ) { case 'Flow_ClassFiles' : $ this -> flushClassCachesByChangedFiles ( $ changedFiles ) ; break ; case 'Flow_ConfigurationFiles' : $ this -> flushConfigurationCachesByChan... | Flushes entries tagged with class names if their class source files have changed . Also flushes AOP proxy caches if a policy was modified . |
58,379 | protected function flushClassCachesByChangedFiles ( array $ changedFiles ) : void { $ objectClassesCache = $ this -> getCache ( 'Flow_Object_Classes' ) ; $ objectConfigurationCache = $ this -> getCache ( 'Flow_Object_Configuration' ) ; $ modifiedAspectClassNamesWithUnderscores = [ ] ; $ modifiedClassNamesWithUnderscore... | Flushes entries tagged with class names if their class source files have changed . |
58,380 | protected function flushConfigurationCachesByChangedFiles ( array $ changedFiles ) : void { $ aopProxyClassRebuildIsNeeded = false ; $ aopProxyClassInfluencers = '/(?:Policy|Objects|Settings)(?:\..*)*\.yaml/' ; $ objectClassesCache = $ this -> getCache ( 'Flow_Object_Classes' ) ; $ objectConfigurationCache = $ this -> ... | Flushes caches as needed if settings routes or policies have changed |
58,381 | protected function flushTranslationCachesByChangedFiles ( array $ changedFiles ) : void { foreach ( $ changedFiles as $ pathAndFilename => $ status ) { if ( preg_match ( '/\/Translations\/.+\.xlf/' , $ pathAndFilename ) === 1 ) { $ this -> logger -> info ( 'The localization files have changed, thus flushing the I18n XM... | Flushes I18n caches if translation files have changed |
58,382 | protected function createAllCaches ( ) : void { foreach ( array_keys ( $ this -> cacheConfigurations ) as $ identifier ) { if ( $ identifier !== 'Default' && ! isset ( $ this -> caches [ $ identifier ] ) ) { $ this -> createCache ( $ identifier ) ; } } } | Instantiates all registered caches . |
58,383 | public function onFlush ( OnFlushEventArgs $ eventArgs ) { $ this -> entityManager = $ eventArgs -> getEntityManager ( ) ; $ validatedInstancesContainer = new \ SplObjectStorage ( ) ; $ this -> deduplicateValueObjectInsertions ( ) ; $ unitOfWork = $ this -> entityManager -> getUnitOfWork ( ) ; foreach ( $ unitOfWork ->... | An onFlush event listener used to act upon persistence . |
58,384 | private function deduplicateValueObjectInsertions ( ) { $ unitOfWork = $ this -> entityManager -> getUnitOfWork ( ) ; $ entityInsertions = $ unitOfWork -> getScheduledEntityInsertions ( ) ; $ knownValueObjects = [ ] ; foreach ( $ entityInsertions as $ entity ) { $ className = TypeHandling :: getTypeForValue ( $ entity ... | Loops over scheduled insertions and checks for duplicate value objects . Any duplicates are unset from the list of scheduled insertions . |
58,385 | public function setContent ( $ content ) { if ( is_resource ( $ content ) && get_resource_type ( $ content ) === 'stream' && stream_is_local ( $ content ) ) { $ streamMetaData = stream_get_meta_data ( $ content ) ; $ this -> headers -> set ( 'Content-Length' , filesize ( $ streamMetaData [ 'uri' ] ) ) ; $ this -> heade... | Explicitly sets the content of the request body |
58,386 | public function getContent ( $ asResource = false ) { if ( $ asResource === true ) { if ( $ this -> content !== null ) { throw new Exception ( 'Cannot return request content as resource because it has already been retrieved.' , 1332942478 ) ; } $ this -> content = '' ; return fopen ( $ this -> inputStreamUri , 'rb' ) ;... | Returns the content of the request body |
58,387 | public function renderHeaders ( ) { $ headers = RequestInformationHelper :: generateRequestLine ( $ this ) ; $ headers .= RequestInformationHelper :: renderRequestHeaders ( $ this ) ; return $ headers ; } | Renders the HTTP headers - including the status header - of this request |
58,388 | private function updateHostFromUri ( ) { $ host = $ this -> uri -> getHost ( ) ; if ( $ host == '' ) { return ; } if ( ( $ port = $ this -> uri -> getPort ( ) ) !== null ) { $ host .= ':' . $ port ; } $ this -> setHeader ( 'Host' , $ host ) ; } | Update the current Host header based on the current Uri |
58,389 | public function getReferenceCode ( ) { if ( ! isset ( $ this -> referenceCode ) ) { $ this -> referenceCode = date ( 'YmdHis' , $ _SERVER [ 'REQUEST_TIME' ] ) . substr ( md5 ( rand ( ) ) , 0 , 6 ) ; } return $ this -> referenceCode ; } | Returns a code which can be communicated publicly so that whoever experiences the exception can refer to it and a developer can find more information about it in the system log . |
58,390 | public function handle ( ComponentContext $ componentContext ) { $ parameters = $ componentContext -> getParameter ( RoutingComponent :: class , 'parameters' ) ; if ( $ parameters === null ) { $ parameters = RouteParameters :: createEmpty ( ) ; } $ routeContext = new RouteContext ( $ componentContext -> getHttpRequest ... | Resolve a route for the request |
58,391 | public function importResourceFromContent ( $ content ) { if ( ! $ this -> storage instanceof WritableStorageInterface ) { throw new ResourceException ( sprintf ( 'Could not import resource into collection "%s" because its storage "%s" is a read-only storage.' , $ this -> name , $ this -> storage -> getName ( ) ) , 138... | Imports a resource from the given string content into this collection . |
58,392 | public function getObjects ( callable $ callback = null ) { $ objects = [ ] ; if ( $ this -> storage instanceof PackageStorage && $ this -> pathPatterns !== [ ] ) { $ objects = new \ AppendIterator ( ) ; foreach ( $ this -> pathPatterns as $ pathPattern ) { $ objects -> append ( $ this -> storage -> getObjectsByPathPat... | Returns all internal data objects of the storage attached to this collection . |
58,393 | protected function rotateLogFile ( ) { if ( file_exists ( $ this -> logFileUrl . '.lock' ) ) { return ; } else { touch ( $ this -> logFileUrl . '.lock' ) ; } if ( $ this -> logFilesToKeep === 0 ) { unlink ( $ this -> logFileUrl ) ; } else { for ( $ logFileCount = $ this -> logFilesToKeep ; $ logFileCount > 0 ; -- $ log... | Rotate the log file and make sure the configured number of files is kept . |
58,394 | public function get ( $ name ) { if ( $ this -> flowCache -> has ( $ name ) ) { $ this -> flowCache -> requireOnce ( $ name ) ; } return $ this -> flowCache -> getWrapped ( $ name ) ; } | Gets an entry from the cache or NULL if the entry does not exist . |
58,395 | public function flush ( $ name = null ) { if ( $ name !== null ) { return $ this -> flowCache -> remove ( $ name ) ; } else { return $ this -> flowCache -> flush ( ) ; } } | Flushes the cache either by entry or flushes the entire cache if no entry is provided . |
58,396 | public function hashPassword ( $ password , $ strategyIdentifier = 'default' ) { list ( $ passwordHashingStrategy , $ strategyIdentifier ) = $ this -> getPasswordHashingStrategyAndIdentifier ( $ strategyIdentifier ) ; $ hashedPasswordAndSalt = $ passwordHashingStrategy -> hashPassword ( $ password , $ this -> getEncryp... | Hash a password using the configured password hashing strategy |
58,397 | public function validatePassword ( $ password , $ hashedPasswordAndSalt ) { $ strategyIdentifier = 'default' ; if ( strpos ( $ hashedPasswordAndSalt , '=>' ) !== false ) { list ( $ strategyIdentifier , $ hashedPasswordAndSalt ) = explode ( '=>' , $ hashedPasswordAndSalt , 2 ) ; } list ( $ passwordHashingStrategy , ) = ... | Validate a hashed password using the configured password hashing strategy |
58,398 | protected function getPasswordHashingStrategyAndIdentifier ( $ strategyIdentifier = 'default' ) { if ( isset ( $ this -> passwordHashingStrategies [ $ strategyIdentifier ] ) ) { return [ $ this -> passwordHashingStrategies [ $ strategyIdentifier ] , $ strategyIdentifier ] ; } if ( $ strategyIdentifier === 'default' ) {... | Get a password hashing strategy |
58,399 | public function handleException ( $ exception ) { if ( error_reporting ( ) === 0 ) { return ; } $ this -> renderingOptions = $ this -> resolveCustomRenderingOptions ( $ exception ) ; if ( $ this -> throwableStorage instanceof ThrowableStorageInterface && isset ( $ this -> renderingOptions [ 'logException' ] ) && $ this... | Handles the given exception |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.