idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
58,900 | public function injectSettings ( array $ settings ) { if ( isset ( $ settings [ 'security' ] [ 'cryptography' ] [ 'RSAWalletServicePHP' ] [ 'openSSLConfiguration' ] ) && is_array ( $ settings [ 'security' ] [ 'cryptography' ] [ 'RSAWalletServicePHP' ] [ 'openSSLConfiguration' ] ) ) { $ this -> openSSLConfiguration = $ ... | Injects the OpenSSL configuration to be used |
58,901 | public function initializeObject ( ) { if ( file_exists ( $ this -> keystorePathAndFilename ) ) { $ this -> keys = unserialize ( file_get_contents ( $ this -> keystorePathAndFilename ) ) ; } $ this -> saveKeysOnShutdown = false ; } | Initializes the rsa wallet service by fetching the keys from the keystore file |
58,902 | public function generateNewKeypair ( $ usedForPasswords = false ) { $ keyResource = openssl_pkey_new ( $ this -> openSSLConfiguration ) ; if ( $ keyResource === false ) { throw new SecurityException ( 'OpenSSL private key generation failed.' , 1254838154 ) ; } $ modulus = $ this -> getModulus ( $ keyResource ) ; $ priv... | Generates a new keypair and returns a fingerprint to refer to it |
58,903 | public function registerKeyPairFromPrivateKeyString ( $ privateKeyString , $ usedForPasswords = false ) { $ keyResource = openssl_pkey_get_private ( $ privateKeyString ) ; $ modulus = $ this -> getModulus ( $ keyResource ) ; $ publicKeyString = $ this -> getPublicKeyString ( $ keyResource ) ; $ privateKey = new OpenSsl... | Adds the specified keypair to the local store and returns a fingerprint to refer to it . |
58,904 | public function registerPublicKeyFromString ( $ publicKeyString ) { $ keyResource = openssl_pkey_get_public ( $ publicKeyString ) ; $ modulus = $ this -> getModulus ( $ keyResource ) ; $ publicKey = new OpenSslRsaKey ( $ modulus , $ publicKeyString ) ; return $ this -> storeKeyPair ( $ publicKey , null , false ) ; } | Adds the specified public key to the wallet and returns a fingerprint to refer to it . This is helpful if you have not private key and want to use this key only to verify incoming data . |
58,905 | public function getPublicKey ( $ fingerprint ) { if ( $ fingerprint === null || ! isset ( $ this -> keys [ $ fingerprint ] ) ) { throw new InvalidKeyPairIdException ( 'Invalid keypair fingerprint given' , 1231438860 ) ; } return $ this -> keys [ $ fingerprint ] [ 'publicKey' ] ; } | Returns the public key for the given fingerprint |
58,906 | public function encryptWithPublicKey ( $ plaintext , $ fingerprint ) { $ cipher = '' ; if ( openssl_public_encrypt ( $ plaintext , $ cipher , $ this -> getPublicKey ( $ fingerprint ) -> getKeyString ( ) , $ this -> paddingAlgorithm ) === false ) { $ openSslErrors = [ ] ; while ( ( $ errorMessage = openssl_error_string ... | Encrypts the given plaintext with the public key identified by the given fingerprint |
58,907 | public function sign ( $ plaintext , $ fingerprint ) { if ( $ fingerprint === null || ! isset ( $ this -> keys [ $ fingerprint ] ) ) { throw new InvalidKeyPairIdException ( 'Invalid keypair fingerprint given' , 1299095799 ) ; } $ signature = '' ; openssl_sign ( $ plaintext , $ signature , $ this -> keys [ $ fingerprint... | Signs the given plaintext with the private key identified by the given fingerprint |
58,908 | public function verifySignature ( $ plaintext , $ signature , $ fingerprint ) { if ( $ fingerprint === null || ! isset ( $ this -> keys [ $ fingerprint ] ) ) { throw new InvalidKeyPairIdException ( 'Invalid keypair fingerprint given' , 1304959763 ) ; } $ verifyResult = openssl_verify ( $ plaintext , $ signature , $ thi... | Checks whether the given signature is valid for the given plaintext with the public key identified by the given fingerprint |
58,909 | public function checkRSAEncryptedPassword ( $ encryptedPassword , $ passwordHash , $ salt , $ fingerprint ) { if ( $ fingerprint === null || ! isset ( $ this -> keys [ $ fingerprint ] ) ) { throw new InvalidKeyPairIdException ( 'Invalid keypair fingerprint given' , 1233655216 ) ; } $ decryptedPassword = $ this -> decry... | Checks if the given encrypted password is correct by comparing it s md5 hash . The salt is appended to the decrypted password string before hashing . |
58,910 | public function destroyKeypair ( $ fingerprint ) { if ( $ fingerprint === null || ! isset ( $ this -> keys [ $ fingerprint ] ) ) { throw new InvalidKeyPairIdException ( 'Invalid keypair fingerprint given' , 1231438863 ) ; } unset ( $ this -> keys [ $ fingerprint ] ) ; $ this -> saveKeysOnShutdown = true ; } | Destroys the keypair identified by the given fingerprint |
58,911 | private function decryptWithPrivateKey ( $ cipher , OpenSslRsaKey $ privateKey ) { $ decrypted = '' ; $ key = openssl_pkey_get_private ( $ privateKey -> getKeyString ( ) ) ; if ( openssl_private_decrypt ( $ cipher , $ decrypted , $ key , $ this -> paddingAlgorithm ) === false ) { if ( $ this -> paddingAlgorithm !== OPE... | Decrypts the given ciphertext with the given private key |
58,912 | private function storeKeyPair ( $ publicKey , $ privateKey , $ usedForPasswords ) { $ publicKeyFingerprint = $ this -> getFingerprintByPublicKey ( $ publicKey -> getKeyString ( ) ) ; $ keyPair = [ ] ; $ keyPair [ 'publicKey' ] = $ publicKey ; $ keyPair [ 'privateKey' ] = $ privateKey ; $ keyPair [ 'usedForPasswords' ] ... | Stores the given keypair and returns its fingerprint . |
58,913 | public function shutdownObject ( ) { if ( $ this -> saveKeysOnShutdown === false ) { return ; } $ temporaryKeystorePathAndFilename = $ this -> keystorePathAndFilename . Utility \ Algorithms :: generateRandomString ( 13 ) . '.temp' ; $ result = file_put_contents ( $ temporaryKeystorePathAndFilename , serialize ( $ this ... | Stores the keys array in the keystore file |
58,914 | public function getFingerprintByPublicKey ( $ publicKeyString ) { $ keyResource = openssl_pkey_get_public ( $ publicKeyString ) ; $ keyDetails = openssl_pkey_get_details ( $ keyResource ) ; $ modulus = $ this -> sshConvertMpint ( $ keyDetails [ 'rsa' ] [ 'n' ] ) ; $ publicExponent = $ this -> sshConvertMpint ( $ keyDet... | Generate an OpenSSH fingerprint for a RSA public key |
58,915 | public function filterRequest ( RequestInterface $ request ) { if ( $ this -> pattern -> matchRequest ( $ request ) ) { $ this -> securityInterceptor -> invoke ( ) ; return true ; } return false ; } | Tries to match the given request against this filter and calls the set security interceptor on success . |
58,916 | protected function getFormActionUri ( ) { if ( $ this -> formActionUri !== null ) { return $ this -> formActionUri ; } if ( $ this -> hasArgument ( 'actionUri' ) ) { $ this -> formActionUri = $ this -> arguments [ 'actionUri' ] ; } else { $ uriBuilder = $ this -> controllerContext -> getUriBuilder ( ) ; if ( $ this -> ... | Returns the action URI of the form tag . If the argument actionUri is specified this will be returned Otherwise this creates the action URI using the UriBuilder |
58,917 | protected function renderHiddenActionUriQueryParameters ( ) { $ result = '' ; $ actionUri = $ this -> getFormActionUri ( ) ; $ query = parse_url ( $ actionUri , PHP_URL_QUERY ) ; if ( is_string ( $ query ) ) { $ queryParts = explode ( '&' , $ query ) ; foreach ( $ queryParts as $ queryPart ) { if ( strpos ( $ queryPart... | Render hidden form fields for query parameters from action URI . This is only needed if the form method is GET . |
58,918 | protected function getFormObjectName ( ) { $ formObjectName = null ; if ( $ this -> hasArgument ( 'objectName' ) ) { $ formObjectName = $ this -> arguments [ 'objectName' ] ; } elseif ( $ this -> hasArgument ( 'name' ) ) { $ formObjectName = $ this -> arguments [ 'name' ] ; } return $ formObjectName ; } | Returns the name of the object that is bound to this form . If the objectName argument has been specified this is returned . Otherwise the name attribute of this form . If neither objectName nor name arguments have been set NULL is returned . |
58,919 | protected function getDefaultFieldNamePrefix ( ) { $ request = $ this -> controllerContext -> getRequest ( ) ; if ( ! $ request -> isMainRequest ( ) ) { if ( $ this -> arguments [ 'useParentRequest' ] === true ) { return $ request -> getParentRequest ( ) -> getArgumentNamespace ( ) ; } else { return $ request -> getArg... | Retrieves the default field name prefix for this form |
58,920 | protected function renderCsrfTokenField ( ) { if ( strtolower ( $ this -> arguments [ 'method' ] ) === 'get' ) { return '' ; } if ( ! $ this -> securityContext -> isInitialized ( ) || ! $ this -> authenticationManager -> isAuthenticated ( ) ) { return '' ; } $ csrfToken = $ this -> securityContext -> getCsrfProtectionT... | Render the a hidden field with a CSRF token |
58,921 | public function updateCredentials ( ActionRequest $ actionRequest ) { $ this -> credentials = [ 'username' => null , 'password' => null ] ; $ this -> authenticationStatus = self :: NO_CREDENTIALS_GIVEN ; $ authorizationHeader = $ actionRequest -> getHttpRequest ( ) -> getHeaders ( ) -> get ( 'Authorization' ) ; if ( st... | Updates the username and password credentials from the HTTP authorization header . Sets the authentication status to AUTHENTICATION_NEEDED if the header has been sent to NO_CREDENTIALS_GIVEN if no authorization header was there . |
58,922 | public function create ( string $ cacheIdentifier , string $ cacheObjectName , string $ backendObjectName , array $ backendOptions = [ ] ) : FrontendInterface { $ backend = $ this -> instantiateBackend ( $ backendObjectName , $ backendOptions , $ this -> environmentConfiguration ) ; $ cache = $ this -> instantiateCache... | Factory method which creates the specified cache along with the specified kind of backend . After creating the cache it will be registered at the cache manager . |
58,923 | protected function isValid ( $ object ) { if ( ! is_object ( $ object ) ) { $ this -> addError ( 'Object expected, %1$s given.' , 1241099149 , [ gettype ( $ object ) ] ) ; return ; } elseif ( $ this -> isValidatedAlready ( $ object ) === true ) { return ; } foreach ( $ this -> propertyValidators as $ propertyName => $ ... | Checks if the given value is valid according to the property validators . |
58,924 | protected function getPropertyValue ( $ object , $ propertyName ) { if ( $ object instanceof \ Doctrine \ ORM \ Proxy \ Proxy ) { $ object -> __load ( ) ; } return ObjectAccess :: getProperty ( $ object , $ propertyName , ! ObjectAccess :: isPropertyGettable ( $ object , $ propertyName ) ) ; } | Load the property value to be used for validation . |
58,925 | public function addPropertyValidator ( $ propertyName , ValidatorInterface $ validator ) { if ( ! isset ( $ this -> propertyValidators [ $ propertyName ] ) ) { $ this -> propertyValidators [ $ propertyName ] = new \ SplObjectStorage ( ) ; } $ this -> propertyValidators [ $ propertyName ] -> attach ( $ validator ) ; } | Adds the given validator for validation of the specified property . |
58,926 | public function getPropertyValidators ( $ propertyName = null ) { if ( $ propertyName !== null ) { return $ this -> propertyValidators [ $ propertyName ] ?? [ ] ; } return $ this -> propertyValidators ; } | Returns all property validators - or only validators of the specified property |
58,927 | public function registerReconstitutedEntity ( $ entity , array $ entityData ) { $ this -> reconstitutedEntities -> attach ( $ entity ) ; $ this -> reconstitutedEntitiesData [ $ entityData [ 'identifier' ] ] = $ entityData ; } | Registers data for a reconstituted object . |
58,928 | public function replaceReconstitutedEntity ( $ oldEntity , $ newEntity ) { $ this -> reconstitutedEntities -> detach ( $ oldEntity ) ; $ this -> reconstitutedEntities -> attach ( $ newEntity ) ; } | Replace a reconstituted object leaves the clean data unchanged . |
58,929 | public function unregisterReconstitutedEntity ( $ entity ) { if ( $ this -> reconstitutedEntities -> contains ( $ entity ) ) { $ this -> reconstitutedEntities -> detach ( $ entity ) ; unset ( $ this -> reconstitutedEntitiesData [ $ this -> getIdentifierByObject ( $ entity ) ] ) ; } } | Unregisters data for a reconstituted object |
58,930 | public function isDirty ( $ object , $ propertyName ) { if ( $ this -> isReconstitutedEntity ( $ object ) === false ) { return true ; } if ( property_exists ( $ object , 'Flow_Persistence_LazyLoadingObject_thawProperties' ) ) { return false ; } $ currentValue = ObjectAccess :: getProperty ( $ object , $ propertyName , ... | Checks whether the given property was changed in the object since it was reconstituted . Returns true for unknown objects in all cases! |
58,931 | public function getIdentifierByObject ( $ object ) { if ( $ this -> hasObject ( $ object ) ) { return $ this -> objectMap [ $ object ] ; } $ idPropertyNames = $ this -> reflectionService -> getPropertyNamesByTag ( get_class ( $ object ) , 'id' ) ; if ( count ( $ idPropertyNames ) === 1 ) { $ idPropertyName = $ idProper... | Returns the identifier for the given object either from the session if the object was registered or from the object itself using a special uuid property or the internal properties set by AOP . |
58,932 | public function registerObject ( $ object , $ identifier ) { $ this -> objectMap [ $ object ] = $ identifier ; $ this -> identifierMap [ $ identifier ] = $ object ; } | Register an identifier for an object |
58,933 | public function unregisterObject ( $ object ) { unset ( $ this -> identifierMap [ $ this -> objectMap [ $ object ] ] ) ; $ this -> objectMap -> detach ( $ object ) ; } | Unregister an object |
58,934 | public function destroy ( ) { $ this -> identifierMap = [ ] ; $ this -> objectMap = new \ SplObjectStorage ( ) ; $ this -> reconstitutedEntities = new \ SplObjectStorage ( ) ; $ this -> reconstitutedEntitiesData = [ ] ; } | Destroy the state of the persistence session and reset all internal data . |
58,935 | public function getCommand ( ) : Command { if ( $ this -> command === null ) { $ this -> command = new Command ( $ this -> controllerObjectName , $ this -> controllerCommandName ) ; } return $ this -> command ; } | Returns the command object for this request |
58,936 | public function getModel ( $ filename ) { $ filename = Files :: concatenatePaths ( [ $ this -> cldrBasePath , $ filename . '.xml' ] ) ; if ( isset ( $ this -> models [ $ filename ] ) ) { return $ this -> models [ $ filename ] ; } if ( ! is_file ( $ filename ) ) { return false ; } return $ this -> models [ $ filename ] ... | Returns an instance of CldrModel which represents CLDR file found under specified path . |
58,937 | public function getModelForLocale ( I18n \ Locale $ locale , $ directoryPath = 'main' ) { $ directoryPath = Files :: concatenatePaths ( [ $ this -> cldrBasePath , $ directoryPath ] ) ; if ( isset ( $ this -> models [ $ directoryPath ] [ ( string ) $ locale ] ) ) { return $ this -> models [ $ directoryPath ] [ ( string ... | Returns an instance of CldrModel which represents group of CLDR files which are related in hierarchy . |
58,938 | protected function findLocaleChain ( I18n \ Locale $ locale , $ directoryPath ) { $ filesInHierarchy = [ Files :: concatenatePaths ( [ $ directoryPath , ( string ) $ locale . '.xml' ] ) ] ; $ localeIdentifier = ( string ) $ locale ; while ( $ localeIdentifier = substr ( $ localeIdentifier , 0 , ( int ) strrpos ( $ loca... | Returns absolute paths to CLDR files connected in hierarchy |
58,939 | public function generate ( $ value ) : array { $ schema = [ ] ; switch ( gettype ( $ value ) ) { case 'NULL' : $ schema [ 'type' ] = 'null' ; break ; case 'boolean' : $ schema [ 'type' ] = 'boolean' ; break ; case 'integer' : $ schema [ 'type' ] = 'integer' ; break ; case 'double' : $ schema [ 'type' ] = 'number' ; bre... | Generate a schema for the given value |
58,940 | protected function generateDictionarySchema ( array $ dictionaryValue ) : array { $ schema = [ 'type' => 'dictionary' , 'properties' => [ ] ] ; ksort ( $ dictionaryValue ) ; foreach ( $ dictionaryValue as $ name => $ subvalue ) { $ schema [ 'properties' ] [ $ name ] = $ this -> generate ( $ subvalue ) ; } return $ sche... | Create a schema for a dictionary |
58,941 | protected function generateArraySchema ( array $ arrayValue ) : array { $ schema = [ 'type' => 'array' ] ; $ subSchemas = [ ] ; foreach ( $ arrayValue as $ subValue ) { $ subSchemas [ ] = $ this -> generate ( $ subValue ) ; } $ schema [ 'items' ] = $ this -> filterDuplicatesFromArray ( $ subSchemas ) ; return $ schema ... | Create a schema for an array structure |
58,942 | protected function generateStringSchema ( string $ stringValue ) : array { $ schema = [ 'type' => 'string' ] ; $ schemaValidator = new SchemaValidator ( ) ; $ detectedFormat = null ; $ detectableFormats = [ 'uri' , 'email' , 'ip-address' , 'class-name' , 'interface-name' ] ; foreach ( $ detectableFormats as $ testForma... | Create a schema for a given string |
58,943 | protected function filterDuplicatesFromArray ( array $ values ) { $ uniqueItems = [ ] ; foreach ( $ values as $ value ) { $ uniqueItems [ md5 ( serialize ( $ value ) ) ] = $ value ; } $ result = array_values ( $ uniqueItems ) ; if ( count ( $ result ) === 1 ) { return $ result [ 0 ] ; } return $ result ; } | Compact an array of items to avoid adding the same value more than once . If the result contains only one item that item is returned directly . |
58,944 | public function injectConfigurationManager ( ConfigurationManager $ configurationManager ) : void { $ this -> configurationManager = $ configurationManager ; $ this -> parseConfigurationOptionPath ( $ this -> settingComparisonExpression ) ; } | Injects the configuration manager |
58,945 | public function matches ( $ className , $ methodName , $ methodDeclaringClassName , $ pointcutQueryIdentifier ) : bool { if ( $ this -> cachedResult === null ) { $ this -> cachedResult = ( is_bool ( $ this -> actualSettingValue ) ) ? $ this -> actualSettingValue : ( $ this -> condition === $ this -> actualSettingValue ... | Checks if the specified configuration option is set to true or false or if it matches the specified condition |
58,946 | public function setCache ( FrontendInterface $ cache ) { $ this -> cache = $ cache ; $ this -> cacheIdentifier = $ this -> cache -> getIdentifier ( ) ; } | Sets a reference to the cache frontend which uses this backend |
58,947 | protected function calculateExpiryTime ( int $ lifetime = null ) : \ DateTime { if ( $ lifetime === self :: UNLIMITED_LIFETIME || ( $ lifetime === null && $ this -> defaultLifetime === self :: UNLIMITED_LIFETIME ) ) { return new \ DateTime ( self :: DATETIME_EXPIRYTIME_UNLIMITED , new \ DateTimeZone ( 'UTC' ) ) ; } if ... | Calculates the expiry time by the given lifetime . If no lifetime is specified the default lifetime is used . |
58,948 | public function getDashedName ( ) : string { $ dashedName = ucfirst ( $ this -> name ) ; $ dashedName = preg_replace ( '/([A-Z][a-z0-9]+)/' , '$1-' , $ dashedName ) ; return '--' . strtolower ( substr ( $ dashedName , 0 , - 1 ) ) ; } | Returns the lowercased name with dashes as word separator |
58,949 | public function packageCommand ( $ packageKey , $ packageType = PackageInterface :: DEFAULT_COMPOSER_TYPE ) { $ this -> validatePackageKey ( $ packageKey ) ; if ( $ this -> packageManager -> isPackageAvailable ( $ packageKey ) ) { $ this -> outputLine ( 'Package "%s" already exists.' , [ $ packageKey ] ) ; exit ( 2 ) ;... | Kickstart a new package |
58,950 | public function commandControllerCommand ( $ packageKey , $ controllerName , $ force = false ) { $ this -> validatePackageKey ( $ packageKey ) ; if ( ! $ this -> packageManager -> isPackageAvailable ( $ packageKey ) ) { $ this -> outputLine ( 'Package "%s" is not available.' , [ $ packageKey ] ) ; exit ( 2 ) ; } $ gene... | Kickstart a new command controller |
58,951 | public function modelCommand ( $ packageKey , $ modelName , $ force = false ) { $ this -> validatePackageKey ( $ packageKey ) ; if ( ! $ this -> packageManager -> isPackageAvailable ( $ packageKey ) ) { $ this -> outputLine ( 'Package "%s" is not available.' , [ $ packageKey ] ) ; exit ( 2 ) ; } $ this -> validateModel... | Kickstart a new domain model |
58,952 | public function repositoryCommand ( $ packageKey , $ modelName , $ force = false ) { $ this -> validatePackageKey ( $ packageKey ) ; if ( ! $ this -> packageManager -> isPackageAvailable ( $ packageKey ) ) { $ this -> outputLine ( 'Package "%s" is not available.' , [ $ packageKey ] ) ; exit ( 2 ) ; } $ generatedFiles =... | Kickstart a new domain repository |
58,953 | protected function validateModelName ( $ modelName ) { if ( Validation :: isReservedKeyword ( $ modelName ) ) { $ this -> outputLine ( 'The name of the model cannot be one of the reserved words of PHP!' ) ; $ this -> outputLine ( 'Have a look at: http://www.php.net/manual/en/reserved.keywords.php' ) ; exit ( 3 ) ; } } | Check the given model name to be not one of the reserved words of PHP . |
58,954 | public function getDescription ( ) { $ reflectionClass = new \ ReflectionClass ( $ this ) ; $ lines = explode ( chr ( 10 ) , $ reflectionClass -> getDocComment ( ) ) ; foreach ( $ lines as $ line ) { $ line = trim ( $ line ) ; if ( $ line === '' || $ line === '/**' || $ line === '*' || $ line === '*/' || strpos ( $ lin... | Returns the first line of the migration class doc comment |
58,955 | protected function moveSettingsPaths ( $ sourcePath , $ destinationPath ) { $ this -> processConfiguration ( ConfigurationManager :: CONFIGURATION_TYPE_SETTINGS , function ( array & $ configuration ) use ( $ sourcePath , $ destinationPath ) { $ sourceConfigurationValue = Arrays :: getValueByPath ( $ configuration , $ s... | Move a settings path from source to destination ; best to be used when package names change . |
58,956 | protected function applySearchAndReplaceOperations ( ) { foreach ( Files :: getRecursiveDirectoryGenerator ( $ this -> targetPackageData [ 'path' ] , null , true ) as $ pathAndFilename ) { $ pathInfo = pathinfo ( $ pathAndFilename ) ; if ( ! isset ( $ pathInfo [ 'filename' ] ) ) { continue ; } if ( strpos ( $ pathAndFi... | Applies all registered searchAndReplace operations . |
58,957 | protected function applyFileOperations ( ) { foreach ( $ this -> operations [ 'moveFile' ] as $ operation ) { $ oldPath = Files :: concatenatePaths ( array ( $ this -> targetPackageData [ 'path' ] . '/' . $ operation [ 0 ] ) ) ; $ newPath = Files :: concatenatePaths ( array ( $ this -> targetPackageData [ 'path' ] . '/... | Applies all registered moveFile operations . |
58,958 | public function getPathToTemporaryDirectory ( ) { if ( $ this -> temporaryDirectory !== null ) { return $ this -> temporaryDirectory ; } $ this -> temporaryDirectory = $ this -> createTemporaryDirectory ( $ this -> temporaryDirectoryBase ) ; return $ this -> temporaryDirectory ; } | Returns the full path to Flow s temporary directory . |
58,959 | protected function createTemporaryDirectory ( $ temporaryDirectoryBase ) { $ temporaryDirectoryBase = Files :: getUnixStylePath ( $ temporaryDirectoryBase ) ; if ( substr ( $ temporaryDirectoryBase , - 1 , 1 ) !== '/' ) { $ temporaryDirectoryBase .= '/' ; } $ temporaryDirectory = $ temporaryDirectoryBase . str_replace ... | Creates Flow s temporary directory - or at least asserts that it exists and is writable . |
58,960 | public function convertFrom ( $ source , $ targetType , array $ convertedChildProperties = [ ] , PropertyMappingConfigurationInterface $ configuration = null ) { try { return new Uri ( $ source ) ; } catch ( \ InvalidArgumentException $ exception ) { return new Error ( 'The given URI "%s" could not be converted' , 1351... | Converts the given string to a Uri object . |
58,961 | public function _activateDependency ( ) { $ realDependency = $ this -> builder -> __invoke ( ) ; foreach ( $ this -> propertyVariables as & $ propertyVariable ) { $ propertyVariable = $ realDependency ; } return $ realDependency ; } | Activate the dependency and set it in the object . |
58,962 | protected function isValid ( $ value ) { $ result = preg_match ( $ this -> options [ 'regularExpression' ] , $ value ) ; if ( $ result === 0 ) { $ this -> addError ( 'The given subject did not match the pattern. Got: %1$s' , 1221565130 , [ $ value ] ) ; } if ( $ result === false ) { throw new InvalidValidationOptionsEx... | Checks if the given value matches the specified regular expression . |
58,963 | public function importPublicKeyCommand ( ) { $ keyData = '' ; $ fp = fopen ( 'php://stdin' , 'rb' ) ; while ( ! feof ( $ fp ) ) { $ keyData .= fgets ( $ fp , 4096 ) ; } fclose ( $ fp ) ; $ fingerprint = $ this -> rsaWalletService -> registerPublicKeyFromString ( $ keyData ) ; $ this -> outputLine ( 'The public key has ... | Import a public key |
58,964 | public function importPrivateKeyCommand ( bool $ usedForPasswords = false ) { $ keyData = '' ; $ fp = fopen ( 'php://stdin' , 'rb' ) ; while ( ! feof ( $ fp ) ) { $ keyData .= fgets ( $ fp , 4096 ) ; } fclose ( $ fp ) ; $ fingerprint = $ this -> rsaWalletService -> registerKeyPairFromPrivateKeyString ( $ keyData , $ us... | Import a private key |
58,965 | public function showUnprotectedActionsCommand ( ) { $ methodPrivileges = [ ] ; foreach ( $ this -> policyService -> getRoles ( true ) as $ role ) { $ methodPrivileges = array_merge ( $ methodPrivileges , $ role -> getPrivilegesByType ( MethodPrivilegeInterface :: class ) ) ; } $ controllerClassNames = $ this -> reflect... | Lists all public controller actions not covered by the active security policy |
58,966 | public function showMethodsForPrivilegeTargetCommand ( string $ privilegeTarget ) { $ privilegeTargetInstance = $ this -> policyService -> getPrivilegeTargetByIdentifier ( $ privilegeTarget ) ; if ( $ privilegeTargetInstance === null ) { $ this -> outputLine ( 'The privilegeTarget "%s" is not defined' , [ $ privilegeTa... | Shows the methods represented by the given security privilege target |
58,967 | public static function untangleFilesArray ( array $ convolutedFiles ) : array { $ untangledFiles = [ ] ; $ fieldPaths = [ ] ; foreach ( $ convolutedFiles as $ firstLevelFieldName => $ fieldInformation ) { if ( ! is_array ( $ fieldInformation [ 'error' ] ) ) { $ fieldPaths [ ] = [ $ firstLevelFieldName ] ; } else { $ ne... | Transforms the convoluted _FILES superglobal into a manageable form . |
58,968 | protected function initialize ( ) { if ( ! is_array ( $ this -> queryResult ) ) { $ this -> queryResult = $ this -> dataMapper -> mapToObjects ( $ this -> persistenceManager -> getObjectDataByQuery ( $ this -> query ) ) ; } } | Loads the objects this QueryResult is supposed to hold |
58,969 | public function getFirst ( ) { if ( is_array ( $ this -> queryResult ) ) { $ queryResult = & $ this -> queryResult ; } else { $ query = clone $ this -> query ; $ query -> setLimit ( 1 ) ; $ queryResult = $ this -> dataMapper -> mapToObjects ( $ this -> persistenceManager -> getObjectDataByQuery ( $ query ) ) ; } return... | Returns the first object in the result set if any . |
58,970 | protected function isValid ( $ value ) { if ( $ value instanceof \ DateTimeInterface ) { return ; } if ( ! isset ( $ this -> options [ 'locale' ] ) ) { $ locale = $ this -> localizationService -> getConfiguration ( ) -> getDefaultLocale ( ) ; } elseif ( is_string ( $ this -> options [ 'locale' ] ) ) { $ locale = new I1... | Checks if the given value is a valid DateTime object . |
58,971 | public function getViewConfiguration ( ActionRequest $ request ) { $ cacheIdentifier = $ this -> createCacheIdentifier ( $ request ) ; $ viewConfiguration = $ this -> cache -> get ( $ cacheIdentifier ) ; if ( $ viewConfiguration === false ) { $ configurations = $ this -> configurationManager -> getConfiguration ( 'View... | This method walks through the view configuration and applies matching configurations in the order of their specifity score . Possible options are currently the viewObjectName to specify a different class that will be used to create the view and an array of options that will be set on the view object . |
58,972 | protected function createCacheIdentifier ( $ request ) { $ cacheIdentifiersParts = [ ] ; do { $ cacheIdentifiersParts [ ] = $ request -> getControllerPackageKey ( ) ; $ cacheIdentifiersParts [ ] = $ request -> getControllerSubpackageKey ( ) ; $ cacheIdentifiersParts [ ] = $ request -> getControllerName ( ) ; $ cacheIde... | Create a complete cache identifier for the given request that conforms to cache identifier syntax |
58,973 | protected function evaluateMatcher ( ) { if ( $ this -> isEvaluated ) { return ; } $ context = new EelContext ( $ this -> getConditionGenerator ( ) ) ; $ evaluator = $ this -> objectManager -> get ( EntityPrivilegeExpressionEvaluator :: class ) ; $ result = $ evaluator -> evaluate ( $ this -> getParsedMatcher ( ) , $ c... | parses the matcher of this privilege using Eel and extracts entityType and conditionGenerator |
58,974 | public function create ( $ cacheIdentifier , $ backendObjectName , array $ backendOptions = [ ] ) : CacheItemPoolInterface { $ backend = $ this -> instantiateBackend ( $ backendObjectName , $ backendOptions , $ this -> environmentConfiguration ) ; $ cache = $ this -> instantiateCache ( $ cacheIdentifier , $ backend ) ;... | Factory method which creates the specified cache along with the specified kind of backend . The identifier uniquely identifiers the specific cache so that entries inside are unique . |
58,975 | public function runCommand ( string $ host = '127.0.0.1' , int $ port = 8081 ) { $ command = Scripts :: buildPhpCommand ( $ this -> settings ) ; $ address = sprintf ( '%s:%s' , $ host , $ port ) ; $ command .= ' -S ' . escapeshellarg ( $ address ) . ' -t ' . escapeshellarg ( FLOW_PATH_WEB ) . ' ' . escapeshellarg ( FLO... | Run a standalone development server |
58,976 | public function setParent ( Result $ parent ) { if ( $ this -> parent !== $ parent ) { $ this -> parent = $ parent ; if ( $ this -> hasErrors ( ) ) { $ parent -> setErrorsExist ( ) ; } if ( $ this -> hasWarnings ( ) ) { $ parent -> setWarningsExist ( ) ; } if ( $ this -> hasNotices ( ) ) { $ parent -> setNoticesExist (... | Injects the parent result and propagates the cached error states upwards |
58,977 | public function recurseThroughResult ( array $ pathSegments ) : Result { if ( count ( $ pathSegments ) === 0 ) { return $ this ; } $ propertyName = array_shift ( $ pathSegments ) ; if ( ! isset ( $ this -> propertyResults [ $ propertyName ] ) ) { $ newResult = new Result ( ) ; $ newResult -> setParent ( $ this ) ; $ th... | Internal use only! |
58,978 | protected function setErrorsExist ( ) { $ this -> errorsExist = true ; if ( $ this -> parent !== null ) { $ this -> parent -> setErrorsExist ( ) ; } } | Sets the error cache to true and propagates the information upwards the Result - Object Tree |
58,979 | protected function setWarningsExist ( ) { $ this -> warningsExist = true ; if ( $ this -> parent !== null ) { $ this -> parent -> setWarningsExist ( ) ; } } | Sets the warning cache to true and propagates the information upwards the Result - Object Tree |
58,980 | protected function setNoticesExist ( ) { $ this -> noticesExist = true ; if ( $ this -> parent !== null ) { $ this -> parent -> setNoticesExist ( ) ; } } | Sets the notices cache to true and propagates the information upwards the Result - Object Tree |
58,981 | public function flattenTree ( string $ propertyName , array & $ result , array $ level = [ ] , string $ messageTypeFilter = null ) { if ( count ( $ this -> $ propertyName ) > 0 ) { $ propertyPath = implode ( '.' , $ level ) ; $ result [ $ propertyPath ] = $ this -> filterMessages ( $ this -> $ propertyName , $ messageT... | Flatten a tree of Result objects based on a certain property . |
58,982 | public function merge ( Result $ otherResult ) { if ( $ otherResult -> errorsExist ) { $ this -> mergeProperty ( $ otherResult , 'getErrors' , 'addError' ) ; } if ( $ otherResult -> warningsExist ) { $ this -> mergeProperty ( $ otherResult , 'getWarnings' , 'addWarning' ) ; } if ( $ otherResult -> noticesExist ) { $ th... | Merge the given Result object into this one . |
58,983 | protected function mergeProperty ( Result $ otherResult , string $ getterName , string $ adderName ) { foreach ( $ otherResult -> $ getterName ( ) as $ messageInOtherResult ) { $ this -> $ adderName ( $ messageInOtherResult ) ; } } | Merge a single property from the other result object . |
58,984 | public function clear ( ) { $ this -> errors = [ ] ; $ this -> notices = [ ] ; $ this -> warnings = [ ] ; $ this -> warningsExist = false ; $ this -> noticesExist = false ; $ this -> errorsExist = false ; $ this -> propertyResults = [ ] ; } | Clears the result |
58,985 | public function matchesMethod ( $ className , $ methodName ) : bool { $ this -> initialize ( ) ; $ methodIdentifier = strtolower ( $ className . '->' . $ methodName ) ; if ( isset ( static :: $ methodPermissions [ $ methodIdentifier ] [ $ this -> getCacheEntryIdentifier ( ) ] ) ) { return true ; } return false ; } | Returns true if this privilege covers the given method |
58,986 | public function getPointcutFilterComposite ( ) : PointcutFilterComposite { if ( $ this -> pointcutFilter === null ) { $ methodTargetExpressionParser = $ this -> objectManager -> get ( MethodTargetExpressionParser :: class ) ; $ this -> pointcutFilter = $ methodTargetExpressionParser -> parse ( $ this -> getParsedMatche... | Returns the pointcut filter composite matching all methods covered by this privilege |
58,987 | public function blockIllegalRequests ( ActionRequest $ request ) { $ filterMatched = array_reduce ( $ this -> filters , function ( bool $ filterMatched , RequestFilter $ filter ) use ( $ request ) { return ( $ filter -> filterRequest ( $ request ) ? true : $ filterMatched ) ; } , false ) ; if ( $ this -> rejectAll && !... | Analyzes a request against the configured firewall rules and blocks any illegal request . |
58,988 | public static function postUpdateAndInstall ( Event $ event ) { if ( ! defined ( 'FLOW_PATH_ROOT' ) ) { define ( 'FLOW_PATH_ROOT' , Files :: getUnixStylePath ( getcwd ( ) ) . '/' ) ; } if ( ! defined ( 'FLOW_PATH_PACKAGES' ) ) { define ( 'FLOW_PATH_PACKAGES' , Files :: getUnixStylePath ( getcwd ( ) ) . '/Packages/' ) ;... | Make sure required paths and files are available outside of Package Run on every Composer install or update - must be configured in root manifest |
58,989 | public static function postPackageUpdateAndInstall ( PackageEvent $ event ) { $ operation = $ event -> getOperation ( ) ; if ( ! $ operation instanceof InstallOperation && ! $ operation instanceof UpdateOperation ) { throw new Exception \ UnexpectedOperationException ( 'Handling of operation with type "' . $ operation ... | Calls actions and install scripts provided by installed packages . |
58,990 | protected static function copyDistributionFiles ( string $ installerResourcesDirectory ) { $ essentialsPath = $ installerResourcesDirectory . 'Distribution/Essentials' ; if ( is_dir ( $ essentialsPath ) ) { Files :: copyDirectoryRecursively ( $ essentialsPath , Files :: getUnixStylePath ( getcwd ( ) ) . '/' , false , t... | Copies any distribution files to their place if needed . |
58,991 | protected static function runPackageScripts ( string $ staticMethodReference ) { $ className = substr ( $ staticMethodReference , 0 , strpos ( $ staticMethodReference , '::' ) ) ; $ methodName = substr ( $ staticMethodReference , strpos ( $ staticMethodReference , '::' ) + 2 ) ; if ( ! class_exists ( $ className ) ) { ... | Calls a static method from it s string representation |
58,992 | protected static function renderArrayDump ( array $ array , int $ level , bool $ plaintext = false , bool $ ansiColors = false ) : string { if ( is_array ( $ array ) ) { $ dump = 'array' . ( count ( $ array ) ? '(' . count ( $ array ) . ')' : '(empty)' ) ; } elseif ( $ array instanceof \ Countable ) { $ dump = get_clas... | Renders a dump of the given array |
58,993 | public static function getCodeSnippet ( string $ filePathAndName , int $ lineNumber , bool $ plaintext = false ) : string { if ( $ plaintext ) { return static :: getCodeSnippetPlaintext ( $ filePathAndName , $ lineNumber ) ; } $ codeSnippet = '<br />' ; if ( @ file_exists ( $ filePathAndName ) ) { $ phpFile = @ file ( ... | Returns a code snippet from the specified file . |
58,994 | protected static function ansiEscapeWrap ( string $ string , string $ ansiColors , bool $ enable = true ) : string { if ( $ enable ) { return "\x1B[" . $ ansiColors . 'm' . $ string . "\x1B[0m" ; } else { return $ string ; } } | Wrap a string with the ANSI escape sequence for colorful output |
58,995 | protected function getClassName ( JoinPointInterface $ joinPoint ) { $ className = $ joinPoint -> getClassName ( ) ; $ sessionNamespace = substr ( SessionInterface :: class , 0 , - strrpos ( SessionInterface :: class , '\\' ) + 1 ) ; if ( strpos ( $ className , $ sessionNamespace ) === 0 ) { $ className = substr ( $ cl... | Determines the short or full class name of the session implementation |
58,996 | protected function isDistinguishingAttribute ( $ attributeName ) { $ distinguishingAttributes = [ 'key' , 'request' , 'id' , '_q' , 'registry' , 'alt' , 'iso4217' , 'iso3166' , 'mzone' , 'from' , 'to' , 'type' ] ; $ distinguishingAttributes [ ] = 'source' ; $ distinguishingAttributes [ ] = 'path' ; $ distinguishingAttr... | Checks if given attribute belongs to the group of distinguishing attributes |
58,997 | public function build ( ) : void { $ allAvailableClassNamesByPackage = $ this -> objectManager -> getRegisteredClassNames ( ) ; $ possibleTargetClassNames = $ this -> getProxyableClasses ( $ allAvailableClassNamesByPackage ) ; $ actualAspectClassNames = $ this -> reflectionService -> getClassNamesByAnnotation ( Flow \ ... | Builds proxy class code which weaves advices into the respective target classes . |
58,998 | public function findPointcut ( string $ aspectClassName , string $ pointcutMethodName ) { if ( ! isset ( $ this -> aspectContainers [ $ aspectClassName ] ) ) { return false ; } foreach ( $ this -> aspectContainers [ $ aspectClassName ] -> getPointcuts ( ) as $ pointcut ) { if ( $ pointcut -> getPointcutMethodName ( ) =... | Traverses the aspect containers to find a pointcut from the aspect class name and pointcut method name |
58,999 | protected function getProxyableClasses ( array $ classNamesByPackage ) : array { $ proxyableClasses = [ ] ; foreach ( $ classNamesByPackage as $ classNames ) { foreach ( $ classNames as $ className ) { if ( in_array ( substr ( $ className , 0 , 15 ) , $ this -> blacklistedSubPackages ) ) { continue ; } if ( $ this -> r... | Determines which of the given classes are potentially proxyable and returns their names in an array . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.