idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
58,600 | public function getArguments ( ) { if ( $ this -> arguments === null ) { $ this -> arguments = UriHelper :: parseQueryIntoArguments ( $ this ) ; } return $ this -> arguments ; } | Returns the arguments from the URI s query part |
58,601 | public function setFragment ( $ fragment ) { if ( preg_match ( self :: PATTERN_MATCH_FRAGMENT , $ fragment ) !== 1 ) { throw new \ InvalidArgumentException ( '"' . $ fragment . '" is not valid fragment as part of a URI.' , 1184071252 ) ; } $ this -> fragment = $ fragment ; } | Sets the fragment in the URI |
58,602 | protected function convertMediaType ( $ requestBody , $ mediaType ) { $ mediaTypeParts = MediaTypes :: parseMediaType ( $ mediaType ) ; if ( ! isset ( $ mediaTypeParts [ 'subtype' ] ) || $ mediaTypeParts [ 'subtype' ] === '' ) { return [ ] ; } $ result = [ ] ; switch ( $ mediaTypeParts [ 'subtype' ] ) { case 'json' : c... | Converts the given request body according to the specified media type Override this method in your custom TypeConverter to support additional media types |
58,603 | public function createAccountWithPassword ( $ identifier , $ password , $ roleIdentifiers = [ ] , $ authenticationProviderName = 'DefaultProvider' , $ passwordHashingStrategy = 'default' ) { $ account = new Account ( ) ; $ account -> setAccountIdentifier ( $ identifier ) ; $ account -> setCredentialsSource ( $ this -> ... | Creates a new account and sets the given password and roles |
58,604 | public static function getUsername ( UriInterface $ uri ) : string { $ userInfo = explode ( ':' , $ uri -> getUserInfo ( ) ) ; return ( isset ( $ userInfo [ 0 ] ) ? $ userInfo [ 0 ] : '' ) ; } | Get the username component of the given Uri |
58,605 | public static function getPassword ( UriInterface $ uri ) : string { $ userInfo = explode ( ':' , $ uri -> getUserInfo ( ) ) ; return ( isset ( $ userInfo [ 1 ] ) ? $ userInfo [ 1 ] : '' ) ; } | Get the password component of the given Uri |
58,606 | public static function uriWithArguments ( UriInterface $ uri , array $ arguments ) : UriInterface { $ query = http_build_query ( $ arguments , '' , '&' , PHP_QUERY_RFC3986 ) ; return $ uri -> withQuery ( $ query ) ; } | Returns an Uri object with the query string being generated from the array of arguments given |
58,607 | protected function initialize ( ) { if ( is_array ( $ this -> objectIdentifiers ) ) { foreach ( $ this -> objectIdentifiers as $ identifier ) { try { parent :: attach ( $ this -> persistenceManager -> getObjectByIdentifier ( $ identifier ) ) ; } catch ( Exception \ InvalidObjectDataException $ exception ) { } } $ this ... | Loads the objects this LazySplObjectStorage is supposed to hold . |
58,608 | public function matchRequest ( RequestInterface $ request ) { if ( ! $ request instanceof ActionRequest || SecurityHelper :: hasSafeMethod ( $ request -> getHttpRequest ( ) ) ) { $ this -> logger -> debug ( 'CSRF: No token required, safe request' ) ; return false ; } if ( $ this -> authenticationManager -> isAuthentica... | Matches a \ Neos \ Flow \ Mvc \ RequestInterface against the configured CSRF pattern rules and searches for invalid csrf tokens . If this returns true the request is invalid! |
58,609 | protected function transformValue ( $ value , array $ configuration ) { if ( is_array ( $ value ) || $ value instanceof \ ArrayAccess ) { $ array = [ ] ; foreach ( $ value as $ key => $ element ) { if ( isset ( $ configuration [ '_descendAll' ] ) && is_array ( $ configuration [ '_descendAll' ] ) ) { $ array [ $ key ] =... | Transforms a value depending on type recursively using the supplied configuration . |
58,610 | protected function buildMethodArgumentsArrayCode ( string $ className = null , string $ methodName = null , bool $ useArgumentsArray = false ) : string { if ( $ className === null || $ methodName === null ) { return '' ; } $ argumentsArrayCode = "\n \$methodArguments = [];\n" ; $ methodParameters = $ thi... | Builds the PHP code for the method arguments array which is passed to the constructor of a new join point . Used in the method interceptor functions . |
58,611 | protected function buildSavedConstructorParametersCode ( string $ className = null ) : string { if ( $ className === null ) { return '' ; } $ parametersCode = '' ; $ methodParameters = $ this -> reflectionService -> getMethodParameters ( $ className , '__construct' ) ; $ methodParametersCount = count ( $ methodParamete... | Generates the parameters code needed to call the constructor with the saved parameters . |
58,612 | private function passArgumentsToSubRequest ( ActionRequest $ subRequest ) { $ arguments = $ this -> controllerContext -> getRequest ( ) -> getPluginArguments ( ) ; $ widgetIdentifier = $ this -> widgetContext -> getWidgetIdentifier ( ) ; $ controllerActionName = 'index' ; if ( isset ( $ arguments [ $ widgetIdentifier ]... | Pass the arguments of the widget to the sub request . |
58,613 | private function initializeWidgetIdentifier ( ) { $ widgetIdentifier = ( $ this -> hasArgument ( 'widgetId' ) ? $ this -> arguments [ 'widgetId' ] : strtolower ( str_replace ( '\\' , '-' , get_class ( $ this ) ) ) ) ; $ this -> widgetContext -> setWidgetIdentifier ( $ widgetIdentifier ) ; } | The widget identifier is unique on the current page and is used in the URI as a namespace for the widget s arguments . |
58,614 | protected function getPluralForm ( $ quantity , Locale $ locale ) { if ( ! is_numeric ( $ quantity ) ) { return null ; } else { return $ this -> pluralsReader -> getPluralForm ( $ quantity , $ locale ) ; } } | Get the plural form to be used . |
58,615 | protected function redirectToUri ( $ uri , $ delay = 0 , $ statusCode = 303 ) { try { parent :: redirectToUri ( $ uri , $ delay , $ statusCode ) ; } catch ( StopActionException $ exception ) { if ( $ this -> request -> getFormat ( ) === 'json' ) { $ this -> response -> setContent ( '' ) ; } throw $ exception ; } } | Redirects the web request to another uri . |
58,616 | public static function create ( Uri $ uri , $ method = 'GET' , array $ arguments = [ ] , array $ files = [ ] , array $ server = [ ] ) { $ get = UriHelper :: parseQueryIntoArguments ( $ uri ) ; $ post = $ arguments ; $ isDefaultPort = $ uri -> getScheme ( ) === 'https' ? ( $ uri -> getPort ( ) === 443 ) : ( $ uri -> get... | Creates a new Request object from the given data . |
58,617 | public static function createFromEnvironment ( ) { $ request = new static ( $ _GET , $ _POST , $ _FILES , $ _SERVER ) ; $ request -> setContent ( null ) ; return $ request ; } | Considers the environment information found in PHP s superglobals and Flow s environment configuration and creates a new instance of this Request class matching that data . |
58,618 | public function withAttribute ( $ name , $ value ) { $ request = clone $ this ; $ request -> setAttribute ( $ name , $ value ) ; return $ request ; } | PSR - 7 |
58,619 | public function getNegotiatedMediaType ( array $ supportedMediaTypes , $ trim = true ) { return MediaTypeHelper :: negotiateMediaType ( MediaTypeHelper :: determineAcceptedMediaTypes ( $ this ) , $ supportedMediaTypes , $ trim ) ; } | Returns the best fitting IANA media type after applying the content negotiation rules on a possible Accept header . |
58,620 | public function handleRequest ( ) { $ sequence = $ this -> bootstrap -> buildRuntimeSequence ( ) ; $ sequence -> invoke ( $ this -> bootstrap ) ; $ objectManager = $ this -> bootstrap -> getObjectManager ( ) ; $ logger = $ objectManager -> get ( PsrLoggerFactoryInterface :: class ) -> get ( 'systemLogger' ) ; $ logger ... | Creates an event loop which takes orders from the parent process and executes them in runtime mode . |
58,621 | protected function handleException ( \ Exception $ exception ) { $ response = new Response ( ) ; $ exceptionMessage = '' ; $ exceptionReference = "\n<b>More Information</b>\n" ; $ exceptionReference .= " Exception code #" . $ exception -> getCode ( ) . "\n" ; $ exceptionReference .= " File " . $ e... | Displays a human readable partly beautified version of the given exception and stops the application return a non - zero exit code . |
58,622 | public function get ( $ path ) { if ( $ path instanceof Context ) { $ path = $ path -> unwrap ( ) ; } if ( $ path === null ) { return null ; } elseif ( is_string ( $ path ) || is_integer ( $ path ) ) { if ( is_array ( $ this -> value ) ) { return array_key_exists ( $ path , $ this -> value ) ? $ this -> value [ $ path ... | Get a value of the context |
58,623 | public function call ( $ method , array $ arguments = [ ] ) { if ( $ this -> value === null ) { return null ; } elseif ( is_object ( $ this -> value ) ) { $ callback = [ $ this -> value , $ method ] ; } elseif ( is_array ( $ this -> value ) ) { if ( ! array_key_exists ( $ method , $ this -> value ) ) { throw new Evalua... | Call a method on this context |
58,624 | public function unwrapValue ( $ value ) { if ( is_array ( $ value ) ) { $ self = $ this ; return array_map ( function ( $ item ) use ( $ self ) { if ( $ item instanceof Context ) { return $ item -> unwrap ( ) ; } else { return $ self -> unwrapValue ( $ item ) ; } } , $ value ) ; } else { return $ value ; } } | Unwrap a value by unwrapping nested context objects |
58,625 | public function push ( $ value , $ key = null ) { if ( ! is_array ( $ this -> value ) ) { throw new EvaluationException ( 'Array operation on non-array context' , 1344418485 ) ; } if ( $ key === null ) { $ this -> value [ ] = $ value ; } else { $ this -> value [ $ key ] = $ value ; } return $ this ; } | Push an entry to the context |
58,626 | public function render ( ) { $ value = $ this -> arguments [ 'value' ] ; if ( $ value === null ) { $ value = $ this -> renderChildren ( ) ; } return nl2br ( $ value ) ; } | Replaces newline characters by HTML line breaks . |
58,627 | protected function isValid ( $ value ) { if ( $ value instanceof \ Doctrine \ ORM \ PersistentCollection && ! $ value -> isInitialized ( ) ) { return ; } elseif ( ( is_object ( $ value ) && ! TypeHandling :: isCollectionType ( get_class ( $ value ) ) ) && ! is_array ( $ value ) ) { $ this -> addError ( 'The given subje... | Checks for a collection and if needed validates the items in the collection . This is done with the specified element validator or a validator based on the given element type and validation group . |
58,628 | public static function getComposerManifest ( string $ manifestPath , string $ configurationPath = null ) { $ composerManifest = static :: readComposerManifest ( $ manifestPath ) ; if ( $ composerManifest === null ) { return null ; } if ( $ configurationPath !== null ) { return ObjectAccess :: getPropertyPath ( $ compos... | Returns contents of Composer manifest - or part there of . |
58,629 | public static function readComposerLock ( ) : array { if ( self :: $ composerLockCache !== null ) { return self :: $ composerLockCache ; } if ( ! file_exists ( FLOW_PATH_ROOT . 'composer.lock' ) ) { return [ ] ; } $ json = file_get_contents ( FLOW_PATH_ROOT . 'composer.lock' ) ; $ composerLock = json_decode ( $ json , ... | Read the content of the composer . lock |
58,630 | protected static function readComposerManifest ( string $ manifestPath ) : array { $ manifestPathAndFilename = $ manifestPath . 'composer.json' ; if ( isset ( self :: $ composerManifestCache [ $ manifestPathAndFilename ] ) ) { return self :: $ composerManifestCache [ $ manifestPathAndFilename ] ; } if ( ! is_file ( $ m... | Read the content of composer . json in the given path |
58,631 | public static function writeComposerManifest ( string $ manifestPath , string $ packageKey , array $ composerManifestData = [ ] ) : array { $ manifest = [ 'description' => '' ] ; if ( $ composerManifestData !== null ) { $ manifest = array_merge ( $ manifest , $ composerManifestData ) ; } if ( ! isset ( $ manifest [ 'na... | Write a composer manifest for the package . |
58,632 | public static function getPackageVersion ( $ composerName ) { foreach ( self :: readComposerLock ( ) as $ composerLockData ) { if ( ! isset ( $ composerLockData [ 'name' ] ) ) { continue ; } if ( $ composerLockData [ 'name' ] === $ composerName ) { return preg_replace ( '/^v([0-9])/' , '$1' , $ composerLockData [ 'vers... | Get the package version of the given package Return normalized package version . |
58,633 | public function validate ( $ value ) { $ validators = $ this -> getValidators ( ) ; if ( $ validators -> count ( ) > 0 ) { $ result = null ; foreach ( $ validators as $ validator ) { $ validatorResult = $ validator -> validate ( $ value ) ; if ( $ validatorResult -> hasErrors ( ) ) { if ( $ result === null ) { $ result... | Checks if the given value is valid according to the validators of the disjunction . |
58,634 | public function offsetUnset ( $ offset ) { $ translatedOffset = $ this -> validateArgumentExistence ( $ offset ) ; parent :: offsetUnset ( $ translatedOffset ) ; unset ( $ this -> argumentNames [ $ translatedOffset ] ) ; if ( $ offset != $ translatedOffset ) { unset ( $ this -> argumentShortNames [ $ offset ] ) ; } } | Unsets an argument |
58,635 | public function offsetGet ( $ offset ) { $ translatedOffset = $ this -> validateArgumentExistence ( $ offset ) ; if ( $ translatedOffset === false ) { throw new \ Neos \ Flow \ Mvc \ Exception \ NoSuchArgumentException ( 'An argument "' . $ offset . '" does not exist.' , 1216909923 ) ; } return parent :: offsetGet ( $ ... | Returns the value at the specified index |
58,636 | public function addNewArgument ( $ name , $ dataType = 'string' , $ isRequired = true , $ defaultValue = null ) { $ argument = new Argument ( $ name , $ dataType ) ; $ argument -> setRequired ( $ isRequired ) ; $ argument -> setDefaultValue ( $ defaultValue ) ; $ this -> addArgument ( $ argument ) ; return $ argument ;... | Creates adds and returns a new controller argument to this composite object . If an argument with the same name exists already it will be replaced by the new argument object . |
58,637 | public function removeAll ( ) { foreach ( $ this -> argumentNames as $ argumentName => $ booleanValue ) { parent :: offsetUnset ( $ argumentName ) ; } $ this -> argumentNames = [ ] ; } | Remove all arguments and resets this object |
58,638 | public static function createFromRaw ( $ rawResponse , Response $ parentResponse = null ) { $ response = ResponseInformationHelper :: createFromRaw ( $ rawResponse , self :: class ) ; $ response -> parentResponse = $ parentResponse ; return $ response ; } | Purely internal implementation to support backwards compatibility . |
58,639 | public function hashPassword ( $ password , $ staticSalt = null ) { $ dynamicSalt = UtilityAlgorithms :: generateRandomString ( 22 , 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./' ) ; return crypt ( $ password , '$2a$' . $ this -> cost . '$' . $ dynamicSalt ) ; } | Creates a BCrypt hash |
58,640 | public function allowCreationForSubProperty ( $ propertyPath ) { $ this -> forProperty ( $ propertyPath ) -> setTypeConverterOption ( PersistentObjectConverter :: class , PersistentObjectConverter :: CONFIGURATION_CREATION_ALLOWED , true ) ; return $ this ; } | Allow creation of a certain sub property |
58,641 | public function allowModificationForSubProperty ( $ propertyPath ) { $ this -> forProperty ( $ propertyPath ) -> setTypeConverterOption ( PersistentObjectConverter :: class , PersistentObjectConverter :: CONFIGURATION_MODIFICATION_ALLOWED , true ) ; return $ this ; } | Allow modification for a given property path |
58,642 | public function setTargetTypeForSubProperty ( $ propertyPath , $ targetType ) { $ this -> forProperty ( $ propertyPath ) -> setTypeConverterOption ( PersistentObjectConverter :: class , PersistentObjectConverter :: CONFIGURATION_TARGET_TYPE , $ targetType ) ; return $ this ; } | Set the target type for a certain property . Especially useful if there is an object which has a nested object which is abstract and you want to instantiate a concrete object instead . |
58,643 | public function run ( ) { Scripts :: initializeClassLoader ( $ this ) ; Scripts :: initializeSignalSlot ( $ this ) ; Scripts :: initializePackageManagement ( $ this ) ; $ this -> activeRequestHandler = $ this -> resolveRequestHandler ( ) ; $ this -> activeRequestHandler -> handleRequest ( ) ; } | Bootstraps the minimal infrastructure resolves a fitting request handler and then passes control over to that request handler . |
58,644 | public function shutdown ( string $ runlevel ) { switch ( $ runlevel ) { case self :: RUNLEVEL_COMPILETIME : $ this -> emitFinishedCompiletimeRun ( ) ; break ; case self :: RUNLEVEL_RUNTIME : $ this -> emitFinishedRuntimeRun ( ) ; break ; } $ this -> emitBootstrapShuttingDown ( $ runlevel ) ; } | Initiates the shutdown procedure to safely close all connections save modified data and commit other tasks necessary to cleanly exit Flow . |
58,645 | public function isCompiletimeCommand ( string $ commandIdentifier ) : bool { $ commandIdentifierParts = explode ( ':' , $ commandIdentifier ) ; if ( count ( $ commandIdentifierParts ) !== 3 ) { return false ; } if ( isset ( $ this -> compiletimeCommands [ $ commandIdentifier ] ) ) { return true ; } unset ( $ commandIde... | Tells if the given command controller is registered for compiletime or not . |
58,646 | public function buildEssentialsSequence ( string $ identifier ) : Sequence { $ sequence = new Sequence ( $ identifier ) ; if ( $ this -> context -> isProduction ( ) ) { $ lockManager = new LockManager ( ) ; $ lockManager -> exitIfSiteLocked ( ) ; if ( $ identifier === 'compiletime' ) { $ lockManager -> lockSiteOrExit (... | Builds a boot sequence with the minimum modules necessary for both compiletime and runtime . |
58,647 | public function buildCompiletimeSequence ( ) : Sequence { $ sequence = $ this -> buildEssentialsSequence ( 'compiletime' ) ; $ sequence -> addStep ( new Step ( 'neos.flow:cachemanagement:forceflush' , [ Scripts :: class , 'forceFlushCachesIfNecessary' ] ) , 'neos.flow:systemlogger' ) ; $ sequence -> addStep ( new Step ... | Builds a boot sequence starting all modules necessary for the compiletime state . This includes all of the essentials sequence . |
58,648 | public function buildRuntimeSequence ( ) : Sequence { $ sequence = $ this -> buildEssentialsSequence ( 'runtime' ) ; $ sequence -> addStep ( new Step ( 'neos.flow:objectmanagement:proxyclasses' , [ Scripts :: class , 'initializeProxyClasses' ] ) , 'neos.flow:systemlogger' ) ; $ sequence -> addStep ( new Step ( 'neos.fl... | Builds a boot sequence starting all modules necessary for the runtime state . This includes all of the essentials sequence . |
58,649 | public function getObjectManager ( ) : ObjectManagerInterface { if ( ! isset ( $ this -> earlyInstances [ ObjectManagerInterface :: class ] ) ) { debug_print_backtrace ( ) ; throw new FlowException ( 'The Object Manager is not available at this stage of the bootstrap run.' , 1301120788 ) ; } return $ this -> earlyInsta... | Returns the object manager instance |
58,650 | protected function resolveRequestHandler ( ) : RequestHandlerInterface { if ( $ this -> preselectedRequestHandlerClassName !== null && isset ( $ this -> requestHandlers [ $ this -> preselectedRequestHandlerClassName ] ) ) { $ requestHandler = $ this -> requestHandlers [ $ this -> preselectedRequestHandlerClassName ] ; ... | Iterates over the registered request handlers and determines which one fits best . |
58,651 | protected function emitAdviceInvoked ( $ aspectObject , string $ methodName , JoinPointInterface $ joinPoint ) : void { if ( $ this -> dispatcher === null ) { $ this -> dispatcher = $ this -> objectManager -> get ( Dispatcher :: class ) ; } $ this -> dispatcher -> dispatch ( self :: class , 'adviceInvoked' , [ $ aspect... | Emits a signal when an Advice is invoked |
58,652 | public static function importSql ( \ PDO $ databaseHandle , string $ pdoDriver , string $ pathAndFilename ) { $ sql = file ( $ pathAndFilename , FILE_IGNORE_NEW_LINES & FILE_SKIP_EMPTY_LINES ) ; if ( $ pdoDriver !== 'mysql' ) { $ sql = preg_replace ( '/"\([0-9]+\)/' , '"' , $ sql ) ; } $ statement = '' ; foreach ( $ sq... | Pumps the SQL into the database . Use for DDL only . |
58,653 | public function initializeObject ( ) { $ this -> configuration = new Configuration ( $ this -> settings [ 'defaultLocale' ] ) ; $ this -> configuration -> setFallbackRule ( $ this -> settings [ 'fallbackRule' ] ) ; if ( $ this -> cache -> has ( 'availableLocales' ) ) { $ this -> localeCollection = $ this -> cache -> ge... | Initializes the locale service |
58,654 | public function getLocaleChain ( Locale $ locale ) { $ fallbackRule = $ this -> configuration -> getFallbackRule ( ) ; $ localeChain = [ ( string ) $ locale => $ locale ] ; if ( $ fallbackRule [ 'strict' ] === true ) { foreach ( $ fallbackRule [ 'order' ] as $ localeIdentifier ) { $ localeChain [ $ localeIdentifier ] =... | Build a chain of locale objects according to the fallback rule and the available locales . |
58,655 | protected function generateAvailableLocalesCollectionFromSettings ( ) { foreach ( $ this -> settings [ 'availableLocales' ] as $ localeIdentifier ) { $ this -> localeCollection -> addLocale ( new Locale ( $ localeIdentifier ) ) ; } } | Generates the available Locales Collection from the configuration setting Neos . Flow . i18n . availableLocales . |
58,656 | protected function getScanExcludePattern ( ) { $ pattern = implode ( '|' , array_keys ( array_filter ( ( array ) $ this -> settings [ 'scan' ] [ 'excludePatterns' ] ) ) ) ; if ( $ pattern !== '' ) { $ pattern = '#' . str_replace ( '#' , '\#' , $ pattern ) . '#' ; } return $ pattern ; } | Returns a regex pattern including enclosing characters that matches any of the configured exclude list configured inside Neos . Flow . i18n . scan . excludePatterns . |
58,657 | protected function generateAvailableLocalesCollectionByScanningFilesystem ( ) { $ includePaths = array_keys ( array_filter ( ( array ) $ this -> settings [ 'scan' ] [ 'includePaths' ] ) ) ; if ( $ includePaths === [ ] ) { return ; } $ excludePattern = $ this -> getScanExcludePattern ( ) ; foreach ( $ this -> packageMan... | Finds all Locale objects representing locales available in the Flow installation . This is done by scanning all Private and Public resource files of all active packages in order to find localized files . |
58,658 | public function render ( $ lowercase = false ) { $ content = $ this -> renderChildren ( ) ; return $ this -> inflector -> humanizeCamelCase ( $ content , $ lowercase ) ; } | Humanize a model name |
58,659 | protected function renderHiddenIdentityField ( $ object , $ name ) { if ( ! is_object ( $ object ) || $ this -> persistenceManager -> isNewObject ( $ object ) ) { return '' ; } $ identifier = $ this -> persistenceManager -> getIdentifierByObject ( $ object ) ; if ( $ identifier === null ) { return chr ( 10 ) . '<!-- Ob... | Renders a hidden form field containing the technical identity of the given object . |
58,660 | protected function setErrorClassAttribute ( ) { if ( $ this -> hasArgument ( 'class' ) ) { $ cssClass = $ this -> arguments [ 'class' ] . ' ' ; } else { $ cssClass = '' ; } $ mappingResultsForProperty = $ this -> getMappingResultsForProperty ( ) ; if ( $ mappingResultsForProperty -> hasErrors ( ) ) { if ( $ this -> has... | Add an CSS class if this view helper has errors |
58,661 | protected function getMappingResultsForProperty ( ) { $ validationResults = $ this -> getRequest ( ) -> getInternalArgument ( '__submittedArgumentValidationResults' ) ; if ( $ validationResults === null ) { return new Result ( ) ; } return $ validationResults -> forProperty ( $ this -> getPropertyPath ( ) ) ; } | Get errors for the property and form name of this view helper |
58,662 | public function parseFormatFromCldr ( Locale $ locale , $ formatType , $ formatLength ) { self :: validateFormatType ( $ formatType ) ; self :: validateFormatLength ( $ formatLength ) ; if ( isset ( $ this -> parsedFormatsIndices [ ( string ) $ locale ] [ $ formatType ] [ $ formatLength ] ) ) { return $ this -> parsedF... | Returns parsed date or time format basing on locale and desired format length . |
58,663 | public function getLocalizedLiteralsForLocale ( Locale $ locale ) { if ( isset ( $ this -> localizedLiterals [ ( string ) $ locale ] ) ) { return $ this -> localizedLiterals [ ( string ) $ locale ] ; } $ model = $ this -> cldrRepository -> getModelForLocale ( $ locale ) ; $ localizedLiterals [ 'months' ] = $ this -> pa... | Returns literals array for locale provided . |
58,664 | public static function validateFormatLength ( $ formatLength ) { if ( ! in_array ( $ formatLength , [ self :: FORMAT_LENGTH_DEFAULT , self :: FORMAT_LENGTH_FULL , self :: FORMAT_LENGTH_LONG , self :: FORMAT_LENGTH_MEDIUM , self :: FORMAT_LENGTH_SHORT ] ) ) { throw new Exception \ InvalidFormatLengthException ( 'Provide... | Validates provided format length and throws exception if value is not allowed . |
58,665 | protected function parseLocalizedLiterals ( CldrModel $ model , $ literalType ) { $ data = [ ] ; $ context = $ model -> getRawArray ( 'dates/calendars/calendar[@type="gregorian"]/' . $ literalType . 's' ) ; foreach ( $ context as $ contextNodeString => $ literalsWidths ) { $ contextType = $ model -> getAttributeValue (... | Parses one CLDR child of dates node and returns it s array representation . |
58,666 | protected function parseLocalizedEras ( CldrModel $ model ) { $ data = [ ] ; foreach ( $ model -> getRawArray ( 'dates/calendars/calendar[@type="gregorian"]/eras' ) as $ widthType => $ eras ) { foreach ( $ eras as $ eraNodeString => $ eraValue ) { $ eraName = $ model -> getAttributeValue ( $ eraNodeString , 'type' ) ; ... | Parses eras child of dates node and returns it s array representation . |
58,667 | protected function prepareDateAndTimeFormat ( $ format , Locale $ locale , $ formatLength ) { $ parsedFormatForDate = $ this -> parseFormatFromCldr ( $ locale , 'date' , $ formatLength ) ; $ parsedFormatForTime = $ this -> parseFormatFromCldr ( $ locale , 'time' , $ formatLength ) ; $ positionOfTimePlaceholder = strpos... | Creates one parsed datetime format from date and time formats merged together . |
58,668 | public function locale ( $ locale ) { try { $ this -> parameters [ 'locale' ] = new Locale ( $ locale ) ; } catch ( InvalidLocaleIdentifierException $ e ) { throw new FlowException ( sprintf ( '"%s" is not a valid locale identifier.' , $ locale ) , 1436784806 ) ; } return $ this ; } | Set the locale . The locale Identifier will be converted into a Locale |
58,669 | public function translate ( array $ overrides = [ ] ) { array_replace_recursive ( $ this -> parameters , $ overrides ) ; $ id = isset ( $ this -> parameters [ 'id' ] ) ? $ this -> parameters [ 'id' ] : null ; $ value = isset ( $ this -> parameters [ 'value' ] ) ? $ this -> parameters [ 'value' ] : null ; $ arguments = ... | Translate according to currently collected parameters |
58,670 | protected function initialize ( ) { if ( $ this -> initialized === true ) { return ; } $ this -> initializeStorages ( ) ; $ this -> initializeTargets ( ) ; $ this -> initializeCollections ( ) ; $ this -> initialized = true ; } | Initializes the ResourceManager by parsing the related configuration and registering the resource stream wrapper . |
58,671 | public function importResourceFromContent ( $ content , $ filename , $ collectionName = ResourceManager :: DEFAULT_PERSISTENT_COLLECTION_NAME , $ forcedPersistenceObjectIdentifier = null ) { if ( ! is_string ( $ content ) ) { throw new Exception ( sprintf ( 'Tried to import content into the resource collection "%s" but... | Imports the given content passed as a string as a new persistent resource . |
58,672 | public function deleteResource ( PersistentResource $ resource , $ unpublishResource = true ) { $ this -> initialize ( ) ; $ collectionName = $ resource -> getCollectionName ( ) ; $ result = $ this -> resourceRepository -> findBySha1AndCollectionName ( $ resource -> getSha1 ( ) , $ collectionName ) ; if ( count ( $ res... | Deletes the given PersistentResource from the ResourceRepository and if the storage data is no longer used in another PersistentResource object also deletes the data from the storage . |
58,673 | public function getPublicPersistentResourceUri ( PersistentResource $ resource ) { $ this -> initialize ( ) ; if ( ! isset ( $ this -> collections [ $ resource -> getCollectionName ( ) ] ) ) { return false ; } $ target = $ this -> collections [ $ resource -> getCollectionName ( ) ] -> getTarget ( ) ; return $ target ->... | Returns the web accessible URI for the given resource object |
58,674 | public function getPublicPersistentResourceUriByHash ( $ resourceHash , $ collectionName = self :: DEFAULT_PERSISTENT_COLLECTION_NAME ) { $ this -> initialize ( ) ; if ( ! isset ( $ this -> collections [ $ collectionName ] ) ) { throw new Exception ( sprintf ( 'Could not determine persistent resource URI for "%s" becau... | Returns the web accessible URI for the resource object specified by the given SHA1 hash . |
58,675 | public function getPublicPackageResourceUri ( $ packageKey , $ relativePathAndFilename ) { $ this -> initialize ( ) ; $ target = $ this -> collections [ self :: DEFAULT_STATIC_COLLECTION_NAME ] -> getTarget ( ) ; return $ target -> getPublicStaticResourceUri ( $ packageKey . '/' . $ relativePathAndFilename ) ; } | Returns the public URI for a static resource provided by the specified package and in the given path below the package s resources directory . |
58,676 | public function getPublicPackageResourceUriByPath ( $ path ) { $ this -> initialize ( ) ; list ( $ packageKey , $ relativePathAndFilename ) = $ this -> getPackageAndPathByPublicPath ( $ path ) ; return $ this -> getPublicPackageResourceUri ( $ packageKey , $ relativePathAndFilename ) ; } | Returns the public URI for a static resource provided by the public package |
58,677 | public function getPackageAndPathByPublicPath ( $ path ) { if ( preg_match ( self :: PUBLIC_RESSOURCE_REGEXP , $ path , $ matches ) !== 1 ) { throw new Exception ( sprintf ( 'The path "%s" which was given must point to a public resource.' , $ path ) , 1450358448 ) ; } return [ 0 => $ matches [ 'packageKey' ] , 1 => $ m... | Return the package key and the relative path and filename from the given resource path |
58,678 | public function getStorage ( $ storageName ) { $ this -> initialize ( ) ; return isset ( $ this -> storages [ $ storageName ] ) ? $ this -> storages [ $ storageName ] : null ; } | Returns a Storage instance by the given name |
58,679 | public function getCollection ( $ collectionName ) { $ this -> initialize ( ) ; return isset ( $ this -> collections [ $ collectionName ] ) ? $ this -> collections [ $ collectionName ] : null ; } | Returns a Collection instance by the given name |
58,680 | public function getCollectionsByStorage ( StorageInterface $ storage ) { $ this -> initialize ( ) ; $ collections = [ ] ; foreach ( $ this -> collections as $ collectionName => $ collection ) { if ( $ collection -> getStorage ( ) === $ storage ) { $ collections [ $ collectionName ] = $ collection ; } } return $ collect... | Returns an array of Collection instances which use the given storage |
58,681 | public function shutdownObject ( ) { foreach ( $ this -> resourceRepository -> getAddedResources ( ) as $ resource ) { if ( $ this -> persistenceManager -> isNewObject ( $ resource ) ) { $ this -> deleteResource ( $ resource , false ) ; } } } | Checks if recently imported resources really have been persisted - and if not removes its data from the respective storage . |
58,682 | protected function initializeStorages ( ) { foreach ( $ this -> settings [ 'storages' ] as $ storageName => $ storageDefinition ) { if ( ! isset ( $ storageDefinition [ 'storage' ] ) ) { throw new Exception ( sprintf ( 'The configuration for the resource storage "%s" defined in your settings has no valid "storage" opti... | Initializes the Storage objects according to the current settings |
58,683 | protected function initializeTargets ( ) { foreach ( $ this -> settings [ 'targets' ] as $ targetName => $ targetDefinition ) { if ( ! isset ( $ targetDefinition [ 'target' ] ) ) { throw new Exception ( sprintf ( 'The configuration for the resource target "%s" defined in your settings has no valid "target" option. Plea... | Initializes the Target objects according to the current settings |
58,684 | protected function initializeCollections ( ) { foreach ( $ this -> settings [ 'collections' ] as $ collectionName => $ collectionDefinition ) { if ( ! isset ( $ collectionDefinition [ 'storage' ] ) ) { throw new Exception ( sprintf ( 'The configuration for the resource collection "%s" defined in your settings has no va... | Initializes the Collection objects according to the current settings |
58,685 | protected function prepareUploadedFileForImport ( array $ uploadInfo ) { $ openBasedirEnabled = ( boolean ) ini_get ( 'open_basedir' ) ; $ temporaryTargetPathAndFilename = $ uploadInfo [ 'tmp_name' ] ; $ pathInfo = UnicodeFunctions :: pathinfo ( $ uploadInfo [ 'name' ] ) ; if ( ! is_uploaded_file ( $ temporaryTargetPat... | Prepare an uploaded file to be imported as resource object . Will check the validity of the file move it outside of upload folder if open_basedir is enabled and check the filename . |
58,686 | protected function initializeDependencies ( ) { if ( $ this -> persistenceManager === null ) { $ this -> persistenceManager = Bootstrap :: $ staticObjectManager -> get ( PersistenceManagerInterface :: class ) ; $ this -> reflectionService = Bootstrap :: $ staticObjectManager -> get ( ReflectionService :: class ) ; } } | Fetches dependencies from the static object manager . |
58,687 | public function getClassFiles ( ) { foreach ( $ this -> getFlattenedAutoloadConfiguration ( ) as $ configuration ) { $ normalizedAutoloadPath = $ this -> normalizeAutoloadPath ( $ configuration [ 'mappingType' ] , $ configuration [ 'namespace' ] , $ configuration [ 'classPath' ] ) ; if ( ! is_dir ( $ normalizedAutoload... | Returns the array of filenames of the class files |
58,688 | protected function explodeAutoloadConfiguration ( ) { $ this -> namespaces = [ ] ; $ this -> autoloadTypes = [ ] ; $ this -> flattenedAutoloadConfiguration = [ ] ; $ allAutoloadConfiguration = $ this -> autoloadConfiguration ; foreach ( $ allAutoloadConfiguration as $ autoloadType => $ autoloadConfiguration ) { $ this ... | Brings the composer autoload configuration into an easy to use format for various parts of Flow . |
58,689 | protected function unpublishFile ( $ relativeTargetPathAndFilename ) { $ targetPathAndFilename = $ this -> path . $ relativeTargetPathAndFilename ; if ( ! is_link ( $ targetPathAndFilename ) && ! file_exists ( $ targetPathAndFilename ) ) { $ message = sprintf ( 'Did not remove file %s because it did not exist.' , $ tar... | Removes the specified target file from the public directory |
58,690 | protected function publishDirectory ( $ sourcePath , $ relativeTargetPathAndFilename ) { $ targetPathAndFilename = $ this -> path . $ relativeTargetPathAndFilename ; if ( @ stat ( $ sourcePath ) === false ) { throw new TargetException ( sprintf ( 'Could not publish directory "%s" into resource publishing target "%s" be... | Publishes the specified directory to this target with the given relative path . |
58,691 | protected function evaluateResourcePath ( $ requestedPath , $ checkForExistence = true ) { $ requestPathParts = explode ( '://' , $ requestedPath , 2 ) ; if ( $ requestPathParts [ 0 ] !== self :: SCHEME ) { throw new \ InvalidArgumentException ( 'The ' . __CLASS__ . ' only supports the \'' . self :: SCHEME . '\' scheme... | Evaluates the absolute path and filename of the resource file specified by the given path . |
58,692 | public function setFileMonitor ( FileMonitor $ fileMonitor ) { $ this -> fileMonitor = $ fileMonitor ; $ this -> filesAndModificationTimes = json_decode ( $ this -> cache -> get ( $ this -> fileMonitor -> getIdentifier ( ) . '_filesAndModificationTimes' ) , true ) ; } | Initializes this strategy |
58,693 | public function getFileStatus ( $ pathAndFilename ) { $ actualModificationTime = @ filemtime ( $ pathAndFilename ) ; if ( isset ( $ this -> filesAndModificationTimes [ $ pathAndFilename ] ) ) { if ( $ actualModificationTime !== false ) { if ( $ this -> filesAndModificationTimes [ $ pathAndFilename ] === $ actualModific... | Checks if the specified file has changed |
58,694 | public function setFileDeleted ( $ pathAndFilename ) { if ( isset ( $ this -> filesAndModificationTimes [ $ pathAndFilename ] ) ) { unset ( $ this -> filesAndModificationTimes [ $ pathAndFilename ] ) ; $ this -> modificationTimesChanged = true ; } } | Notify the change strategy that this file was deleted and does not need to be tracked anymore . |
58,695 | public function shutdownObject ( ) { if ( $ this -> modificationTimesChanged === true ) { $ this -> cache -> set ( $ this -> fileMonitor -> getIdentifier ( ) . '_filesAndModificationTimes' , json_encode ( $ this -> filesAndModificationTimes ) ) ; } } | Caches the file modification times |
58,696 | protected function getLocale ( ) { if ( ! $ this -> hasArgument ( 'forceLocale' ) ) { return null ; } $ forceLocale = $ this -> arguments [ 'forceLocale' ] ; $ useLocale = null ; if ( $ forceLocale instanceof I18n \ Locale ) { $ useLocale = $ forceLocale ; } elseif ( is_string ( $ forceLocale ) ) { try { $ useLocale = ... | Get the locale to use for all locale specific functionality . |
58,697 | public function matches ( $ className , $ methodName , $ methodDeclaringClassName , $ pointcutQueryIdentifier ) : bool { if ( $ this -> isInterface === true ) { return ( array_search ( $ this -> interfaceOrClassName , class_implements ( $ className ) ) !== false ) ; } else { return ( $ className === $ this -> interface... | Checks if the specified class matches with the class type filter |
58,698 | public function listCommand ( ) { $ this -> outputLine ( 'Currently registered routes:' ) ; foreach ( $ this -> router -> getRoutes ( ) as $ index => $ route ) { $ uriPattern = $ route -> getUriPattern ( ) ; $ this -> outputLine ( str_pad ( ( $ index + 1 ) . '. ' . $ uriPattern , 80 ) . $ route -> getName ( ) ) ; } } | List the known routes |
58,699 | public function showCommand ( int $ index ) { $ routes = $ this -> router -> getRoutes ( ) ; if ( isset ( $ routes [ $ index - 1 ] ) ) { $ route = $ routes [ $ index - 1 ] ; $ this -> outputLine ( '<b>Information for route ' . $ index . ':</b>' ) ; $ this -> outputLine ( ' Name: ' . $ route -> getName ( ) ) ; $ this -... | Show information for a route |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.