idx
int64
0
241k
question
stringlengths
64
6.21k
target
stringlengths
5
803
235,900
public function filter ( ) { $ count = 0 ; $ tags = $ this -> getParameter ( 'Tags' ) ; if ( $ tags === null ) $ tags = $ this -> getLocal ( 'LinkTags' ) ; $ maxRows = $ this -> getParameter ( 'MaxRows' ) ; $ partial = $ this -> getParameter ( 'Partial' ) ; $ partials = array ( ) ; if ( ! empty ( $ partial ) ) { $ part...
Returns a subset of tags filtered according to the params passed .
235,901
protected function _replaceReferences ( $ input , ContainerInterface $ container , $ default = null , $ startDelimiter = '${' , $ endDelimiter = '}' ) { $ regexpDelimiter = '/' ; $ input = $ this -> _normalizeString ( $ input ) ; $ defaultValue = $ default === null ? '' : $ this -> _normalizeString ( $ default ) ; $ st...
Replaces all tokens wrapped with some delimiters in a string with corresponding values retrieved from a container .
235,902
public function data ( ) : string { $ code = $ this -> response -> getStatusCode ( ) ; if ( $ code >= 400 && $ code < 600 ) { throw new ErrorResponseException ( $ this -> response -> getReasonPhrase ( ) , $ code ) ; } return $ this -> payload ( ) ; }
parsed data with status checking
235,903
public function only ( $ keys ) { $ keys = is_array ( $ keys ) ? $ keys : func_get_args ( ) ; return array_only ( $ this -> parameters , $ keys ) ; }
Get only certain attributes .
235,904
public static function parseRgbString ( string $ string ) : array { if ( ! preg_match ( self :: REGEX_RGB , $ string , $ matches ) ) { throw InvalidArgumentException :: format ( 'Invalid rgb string passed to %s: expecting format "rgb(0-255, 0-255, 0-255)", "%s" given' , __METHOD__ , $ string ) ; } return [ ( int ) $ ma...
Parses the supplied rgb string into an array of channels .
235,905
public static function parseHexString ( string $ string ) : array { if ( ! preg_match ( self :: REGEX_HEX , $ string , $ matches ) ) { throw InvalidArgumentException :: format ( 'Invalid rgba string passed to %s: expecting format "#...", "%s" given' , __METHOD__ , $ string ) ; } $ string = str_replace ( '#' , '' , $ st...
Parses the supplied hex string into an array of channels .
235,906
public static function parseRgbaString ( string $ string ) : array { if ( ! preg_match ( self :: REGEX_RGBA , $ string , $ matches ) ) { throw InvalidArgumentException :: format ( 'Invalid rgba string passed to %s: expecting format "rgb(0-255, 0-255, 0-255, 0-1)", "%s" given' , __METHOD__ , $ string ) ; } return [ ( in...
Parses the supplied rgba string into an array of channels .
235,907
private function loadModules ( ) { $ repo = $ this -> getContainer ( ) -> get ( 'module_repository' ) ; foreach ( $ repo -> getAll ( ) as $ module ) { $ moduleClass = $ module -> getClass ( ) ; new $ moduleClass ( $ this ) ; } }
add modules to App
235,908
private function configureDI ( ) { $ container = $ this -> getContainer ( ) ; $ this -> add ( new NotificationMiddleware ( $ container ) ) ; $ this -> add ( new OldInputDataMiddleware ( $ container ) ) ; $ container -> set ( Generator :: class , function ( ) { $ randomNumberGeneratorFactory = new RandomNumberGeneratorF...
Configure the dependency injection container
235,909
public function renderLayoutSegments ( MvcEvent $ e ) { $ viewModel = $ e -> getViewModel ( ) ; if ( 'Zend\View\Model\ViewModel' != get_class ( $ viewModel ) ) { return ; } $ resolver = $ e -> getApplication ( ) -> getServiceManager ( ) -> get ( 'ViewResolver' ) ; foreach ( $ this -> layoutSegments as $ segment ) { if ...
Listen to the render event and render additional layout segments
235,910
public function coverAction ( $ id , Request $ request ) { $ body = $ this -> getAnime ( $ id ) ; $ response = $ this -> get ( 'cache_time_keeper' ) -> getResponse ( [ ] , self :: CACHE_LIFETIME ) -> setEtag ( sha1 ( $ body -> html ( ) ) ) ; $ response -> headers -> set ( 'Content-Type' , 'image/jpeg' ) ; if ( $ respon...
Get cover from anidb . net item id .
235,911
public function TopMost ( ) { $ sql = Access :: SqlBuilder ( ) ; $ tblArea = Area :: Schema ( ) -> Table ( ) ; $ where = $ sql -> Equals ( $ tblArea -> Field ( 'Layout' ) , $ sql -> Value ( $ this -> layout -> GetID ( ) ) ) -> And_ ( $ sql -> IsNull ( $ tblArea -> Field ( 'Previous' ) ) ) ; return Area :: Schema ( ) ->...
Returns the top most area
235,912
public function set ( $ key , $ val ) { parent :: set ( func_get_args ( ) , null ) ; $ this -> values [ '_changed' ] = true ; return $ this ; }
Set a value in the cache
235,913
public function clear ( ) { $ expiry = $ this -> values [ '_expiry' ] ?? null ; parent :: clear ( ) ; $ this -> set ( '_changed' , true ) ; $ this -> set ( '_timestamp' , time ( ) ) ; if ( $ expiry ) $ this -> setExpiry ( $ expiry ) ; return $ this ; }
Remove all contents from the cache
235,914
public function toSQL ( Parameters $ params , bool $ inner_clause ) { return "OFFSET " . $ params -> getDriver ( ) -> toSQL ( $ params , $ this -> getOffset ( ) ) ; }
Write a OFFSET clause to SQL query syntax
235,915
public static function getInstance ( $ configFile = null , $ mode = self :: APP_MODE_PROD ) { $ c = get_called_class ( ) ; if ( ! isset ( self :: $ _instances [ $ c ] ) ) { self :: $ _instances [ $ c ] = new $ c ( $ configFile , $ mode ) ; self :: $ _instances [ $ c ] -> setup ( ) ; } return self :: $ _instances [ $ c ...
Initialize and return App uniq instance
235,916
public function run ( ) { $ session = $ this -> get ( 'session' ) ; $ session -> start ( ) ; $ uri = '' ; if ( strcmp ( $ this -> mode , self :: APP_MODE_DEV ) == 0 ) { $ uri = $ _SERVER [ 'REQUEST_URI' ] ; } else { $ uri = $ _GET [ 'url' ] ; } if ( ! empty ( $ this -> baseUri ) && substr ( $ uri , 0 , strlen ( $ this ...
Run Bandama application
235,917
public function addService ( $ key , $ callable ) { $ instance = Container :: newInstance ( $ callable ) ; $ this -> container -> set ( $ key , function ( ) use ( $ instance ) { return $ instance ; } ) ; }
Add an instance of class in container with custom key
235,918
protected function registerConfig ( ) { $ config = new Configuration ( $ this -> configFile ) ; $ this -> container -> set ( 'config' , function ( ) use ( $ config ) { return $ config ; } ) ; }
Create and add config in container
235,919
protected function registerFlash ( ) { $ container = $ this -> container ; $ this -> container -> set ( 'flash' , function ( ) use ( $ container ) { return new Flash ( $ container -> get ( 'session' ) ) ; } ) ; }
Create and add session flash object to container
235,920
private function setCounts ( ) { foreach ( $ this -> routes as $ module ) { $ this -> counts [ 'module' ] ++ ; foreach ( $ module [ 'routes' ] as $ route ) { $ this -> counts [ 'route' ] ++ ; } } }
set module part route counts
235,921
protected function getMyModules ( ) { $ all = array_keys ( app ( ) -> getLoadedProviders ( ) ) ; $ modules = [ ] ; foreach ( $ all as $ provider ) { $ parts = explode ( '\\' , $ provider ) ; if ( $ parts [ 0 ] === 'ErenMustafaOzdal' && array_search ( $ parts [ 1 ] , $ modules ) === false ) { array_push ( $ modules , sn...
get ErenMustafaOzdal namespace provider
235,922
protected function loadFunctions ( ) : void { $ this -> extendForTranslator ( ) ; $ this -> extendForWidget ( ) ; $ this -> extendForSiteUrl ( ) ; $ this -> extendForGetUrl ( ) ; $ this -> extendForQueryParams ( ) ; $ this -> extendForPagination ( ) ; $ this -> extendForVarDump ( ) ; }
Load functions that will be used in the templates
235,923
public static function update ( Cacheable $ object ) { return wp_cache_set ( $ object -> get_pk ( ) , $ object -> get_data_to_cache ( ) , $ object :: get_cache_group ( ) ) ; }
Update an item in the cache .
235,924
public function logRequest ( $ request , $ extra = [ ] , $ includeHeader = true ) { $ extra = count ( $ extra ) ? ' ' . json_encode ( $ extra ) : '' ; $ trace = debug_backtrace ( false , 2 ) ; if ( isset ( $ trace [ 1 ] ) ) { $ caller = substr ( strrchr ( $ trace [ 1 ] [ 'class' ] , '\\' ) , 1 ) . '::' . $ trace [ 1 ] ...
Log server request
235,925
public static function create ( int $ amount , int $ avance , string $ b2bGroupId , CurrencyInterface $ currency , int $ specialOfferPrice , int $ unitPrice ) : PriceInterface { $ specialOfferPrice = new Money ( $ specialOfferPrice , new \ Money \ Currency ( $ currency -> getIsoCodeAlpha ( ) ) ) ; $ unitPrice = new Mon...
Creates a valid Price .
235,926
function composite ( $ label ) { $ args = func_get_args ( ) ; array_shift ( $ args ) ; $ composite = \ ran \ CompositeField :: instance ( $ this -> confs ) ; $ composite -> fieldlabel_is ( $ label ) ; if ( count ( $ args ) >= 1 ) { if ( is_array ( $ args [ 0 ] ) ) { $ array_shorthand = array_shift ( $ args ) ; foreach ...
Any additonal parameters are interpreted as Fields that are part of the composite . If an array is passed as second parameter the fields will be interpreted as text Field .
235,927
function autocomplete_array ( array & $ hints = null ) { if ( $ this -> autocomplete === null ) { $ this -> autocomplete = & $ hints ; } else if ( $ hints !== null ) { foreach ( $ hints as $ key => $ hint ) { $ this -> autocomplete [ $ key ] = $ hint ; } } return $ this ; }
The given values will be used to autofill the form . They may be however ignored depending on context .
235,928
function autovalue ( $ fieldname , $ default = null ) { if ( $ this -> autocomplete !== null ) { $ fieldname = rtrim ( $ fieldname , '[]' ) ; if ( isset ( $ this -> autocomplete [ $ fieldname ] ) ) { return $ this -> autocomplete [ $ fieldname ] ; } } return $ default ; }
Retrieve autocomplete value for given field or null .
235,929
function signature ( $ id = null ) { if ( ! $ this -> unsigned ) { if ( $ this -> get ( 'id' , null ) === null ) { $ formsignature = 'freiaform' . $ this -> formindex ; } else { $ formsignature = $ this -> get ( 'id' ) ; } if ( $ id !== null ) { return "{$formsignature}_field$id" ; } else { return $ formsignature ; } }...
Returns the form signature or creates signature using given id and form signature .
235,930
function render ( ) { if ( $ this -> show_metainfo ) { $ this -> appendtagbody ( $ this -> hidden ( 'form' ) -> value_is ( $ this -> signature ( ) ) ) ; } return parent :: render ( ) ; }
A form hidden field will be inserted into the form to identify the data submitted belonged to this form .
235,931
public function setupCredentials ( array $ credentials ) { if ( ! array_key_exists ( 'key' , $ credentials ) ) { throw new InvalidApplicationKeyException ( ) ; } if ( ! array_key_exists ( 'secret' , $ credentials ) ) { throw new InvalidApplicationSecretKeyException ( ) ; } if ( isset ( $ credentials [ 'redirect_uri' ] ...
Setups provider credentials
235,932
public function setAllScopes ( ) { $ scopes = array ( ) ; $ reflectionClass = new \ ReflectionClass ( __CLASS__ ) ; foreach ( $ reflectionClass -> getConstants ( ) as $ constantName => $ constantValue ) { if ( strpos ( $ constantName , 'SCOPE_' ) !== false ) { $ scopes = $ constantValue ; } } $ this -> setScopes ( $ sc...
Sets all permissions which user will be asked for during authentication process
235,933
public function addScope ( $ scope ) { if ( ! in_array ( $ scope , $ this -> scopes ) ) { $ this -> scopes [ ] = $ scope ; } return $ this ; }
Adds provider scope
235,934
public function isAuthenticated ( ) { try { $ session = $ this -> sessionStorage -> retrieveAccessToken ( $ this -> getServiceName ( ) ) ; if ( ! $ session ) { return false ; } return $ session -> getEndOfLife ( ) > time ( ) ; } catch ( TokenNotFoundException $ e ) { return false ; } }
Obtains authentication for current service
235,935
public function getErrorMessage ( bool $ appendPreviousByNewline = false ) : string { $ prev = $ this -> getPrevious ( ) ; if ( \ is_null ( $ prev ) ) { return \ sprintf ( '%s(%d): %s' , static :: GetCodeName ( $ this -> getCode ( ) ) , $ this -> getCode ( ) , $ this -> getMessage ( ) ) ; } $ separator = $ appendPrevio...
Extends the origin getMessage method so also previous messages are include if defined .
235,936
public static function GetCodeName ( $ code ) : string { switch ( $ code ) { case \ E_ERROR : case \ E_USER_ERROR : return 'ERROR' ; case \ E_WARNING : case \ E_USER_WARNING : return 'WARNING' ; case \ E_DEPRECATED : case \ E_USER_DEPRECATED : return 'DEPRECATED' ; case \ E_NOTICE : case \ E_USER_NOTICE : return 'NOTIC...
Returns a string representing the defined error code .
235,937
private function sendMail ( ) { if ( is_null ( $ this -> mailer ) && ! is_null ( Application :: getInstance ( ) -> getConfig ( ) -> mail -> mailer ) ) { $ mailer = Application :: getInstance ( ) -> getConfig ( ) -> mail -> mailer ; $ reflection = new \ ReflectionClass ( str_replace ( '/' , '\\' , $ mailer -> class ) ) ...
evaluate mailer class and send mail
235,938
private function buildHeaders ( ) { $ this -> headers = [ 'From' => $ this -> sender , 'Return-Path' => $ this -> sender , 'Reply-To' => $ this -> sender , 'Date' => ( new \ DateTime ( ) ) -> format ( 'r' ) , 'Message-ID' => '<' . sha1 ( microtime ( ) ) . '@' . substr ( $ this -> sender , strpos ( $ this -> sender , '@...
fill headers array
235,939
private function buildMsg ( ) { if ( isset ( $ this -> boundary ) ) { $ this -> msg = '--' . $ this -> boundary . self :: CRLF ; $ this -> msg .= 'Content-type: text/' . ( $ this -> htmlMail ? 'html' : 'plain' ) . '; charset=' . $ this -> encoding . self :: CRLF ; $ this -> msg .= 'Content-Transfer-Encoding: 8bit' . se...
build message body
235,940
public function init ( $ config = [ ] ) { $ handlers = array_values ( $ config [ 'handlers' ] ) ; foreach ( $ handlers as $ conf ) { $ class = $ conf [ 'class' ] ; $ handler = new $ class ( $ conf ) ; $ this -> addHandler ( $ handler ) ; } }
Initialises the log .
235,941
private function _logIt ( $ level , $ message , $ context = [ ] ) { foreach ( $ this -> _handlers as $ handler ) { $ args [ 'message' ] = $ message ; $ record = $ handler -> createRecord ( $ level , $ args , $ context ) ; $ handler -> handle ( $ record ) ; } }
Logs messages to the log .
235,942
public static function getLevelString ( $ level ) { $ name = '' ; switch ( $ level ) { case self :: LEVEL_DEBUG : $ name = 'DEBUG' ; break ; case self :: LEVEL_INFO : $ name = 'INFO' ; break ; case self :: LEVEL_NOTICE : $ name = 'NOTICE' ; break ; case self :: LEVEL_WARNING : $ name = 'WARNING' ; break ; case self :: ...
Returns the level as string .
235,943
public function setTokenValidity ( $ tokenValidity ) { $ tknVal = intval ( $ tokenValidity ) ; if ( empty ( $ tknVal ) ) { $ tknVal = self :: BASIC_VALIDITY ; } $ this -> tokenValidity = intval ( $ tknVal ) ; }
Sets token validity
235,944
public function hasReadableProperty ( string $ name , & $ getterName ) : bool { if ( \ in_array ( $ name , $ this -> ignoreGetProperties ) ) { return false ; } $ getterName = 'get' . \ ucfirst ( $ name ) ; return \ method_exists ( $ this , $ getterName ) ; }
Returns if a property with the defined name exists for read access .
235,945
private function checkUser ( ) { static $ enabled ; if ( ! isset ( $ enabled ) ) { $ token = $ this -> tokenStorage -> getToken ( ) ; if ( $ token ) { $ user = $ token -> getUser ( ) ; if ( $ user instanceof \ FOS \ UserBundle \ Model \ User ) { if ( $ user -> hasRole ( 'ROLE_USER' ) ) $ enabled = $ token -> isAuthenti...
checks if the current User is ROLE_USER
235,946
public function getHash ( ) { $ names = array_keys ( $ this -> modules ) ; sort ( $ names ) ; return md5 ( implode ( '|' , $ names ) ) ; }
Get an MD5 hash computed from the sorted type names of all modules .
235,947
public function getLastModified ( ) { $ mtime = 0 ; foreach ( $ this -> modules as $ module ) { $ mtime = max ( $ mtime , filemtime ( ( new \ ReflectionClass ( get_class ( $ module ) ) ) -> getFileName ( ) ) ) ; } return $ mtime ; }
Get the time of the most recent modification to any registered module .
235,948
private function getIntegerSQLDeclarationSnippet ( array $ options = array ( ) ) { $ length = isset ( $ options [ 'length' ] ) ? ( int ) $ options [ 'length' ] : null ; $ unsigned = isset ( $ options [ 'unsigned' ] ) && $ options [ 'unsigned' ] ? ' UNSIGNED' : null ; $ autoIncrement = isset ( $ options [ 'auto_incremen...
Gets the integer SQL declaration snippet .
235,949
private function getStringTypePrefix ( $ length = null ) { if ( $ length === null ) { return 'LONG' ; } if ( ! is_int ( $ length ) || ( $ length <= 0 ) ) { throw PlatformException :: invalidStringTypePrefixLength ( ) ; } $ prefixLimits = array ( 'TINY' => 255 , '' => 65535 , 'MEDIUM' => 16777215 , ) ; $ stringTypePrefi...
Gets the string type prefix for the given length .
235,950
public function clearByTag ( CachePoolInterface $ cache , $ tag ) { $ tagKey = $ this -> getTagKey ( $ tag ) ; $ tagItem = $ cache -> getItem ( $ tagKey ) ; if ( $ tagItem -> isHit ( ) ) { $ keyArray = $ tagItem -> get ( ) ; foreach ( array_keys ( $ keyArray ) as $ key ) { if ( $ cache -> deleteItem ( $ key ) ) { unset...
Clear by tags
235,951
public function getLoaderInstallPath ( PackageInterface $ package ) { $ config = $ this -> getInstallerConfig ( $ package ) ; $ installPath = 'wp-content/mu-plugins/' ; if ( ! $ this -> composer -> getPackage ( ) ) { return $ this -> parseTemplate ( $ installPath , $ config ) ; } $ extra = $ this -> composer -> getPack...
Gets the install path for the loader script of an MU plugin .
235,952
public function getLoaderFilePackagePath ( PackageInterface $ package ) { $ installPath = $ this -> getInstallPath ( $ package ) ; if ( $ installPath === false ) { return false ; } $ config = $ this -> getInstallerConfig ( $ package ) ; $ packagePath = $ installPath . $ config [ 'loader' ] ; return $ packagePath ; }
Gets the file path where a loader script is located .
235,953
public function getLoaderFileInstallPath ( PackageInterface $ package ) { $ installPath = $ this -> getLoaderInstallPath ( $ package ) ; if ( $ installPath === false ) { return false ; } $ config = $ this -> getInstallerConfig ( $ package ) ; $ installPath = $ installPath . basename ( $ config [ 'loader' ] ) ; return $...
Gets the file path where a loader script is installed .
235,954
protected function getInstallerConfig ( PackageInterface $ package ) { if ( $ this -> installerConfig !== null ) { return $ this -> installerConfig ; } $ type = $ package -> getType ( ) ; $ prettyName = $ package -> getPrettyName ( ) ; if ( strpos ( $ prettyName , '/' ) !== false ) { list ( $ vendor , $ name ) = explod...
Retrieves configuration values from a packages s composer . json .
235,955
protected function parseTemplate ( $ template , array $ vars = array ( ) ) { if ( strpos ( $ template , '{' ) === false ) { return $ template ; } if ( preg_match_all ( '@\{\$([A-Za-z0-9_]+)\}@i' , $ template , $ matches ) ) { foreach ( $ matches [ 1 ] as $ varName ) { $ template = str_replace ( '{$' . $ varName . '}' ,...
Parses a template string .
235,956
protected function resolveInstallPath ( array $ paths , $ name ) { foreach ( $ paths as $ path => $ names ) { if ( in_array ( $ name , $ names , true ) || in_array ( 'type:' . static :: TYPE , $ names , true ) ) { return $ path ; } } return false ; }
Searches the install path based on a package name and a paths array .
235,957
protected function installLoader ( PackageInterface $ package ) { $ source = $ this -> getLoaderFilePackagePath ( $ package ) ; $ target = $ this -> getLoaderFileInstallPath ( $ package ) ; copy ( $ source , $ target ) ; }
Installs the loader script of an MU plugin .
235,958
protected function removeLoader ( PackageInterface $ package ) { $ target = $ this -> getLoaderFileInstallPath ( $ package ) ; if ( ! $ this -> filesystem -> remove ( $ target ) ) { throw new \ RuntimeException ( 'Could not completely delete ' . $ target . ', aborting.' ) ; } }
Removes the loader script of an MU plugin .
235,959
protected function renderHelper ( $ name , ElementInterface $ element ) { $ helper = $ this -> getView ( ) -> plugin ( $ name ) ; return $ helper ( $ element ) ; }
Render element by helper name
235,960
public function getRoutes ( ) : Array { $ return = array ( ) ; foreach ( $ this -> routes as $ route ) { array_push ( $ return , [ $ route -> getPath ( ) , $ route -> getMethod ( ) ] ) ; } return $ return ; }
Return all defined routes with their method
235,961
public function get ( String $ path , Callable $ callback ) : Route { return $ this -> collectRoute ( 'GET' , $ path , $ callback ) ; }
Create and collect a new Route with GET request
235,962
public function post ( String $ path , Callable $ callback ) : Route { return $ this -> collectRoute ( 'POST' , $ path , $ callback ) ; }
Create and collect a new Route with POST request
235,963
public function put ( String $ path , Callable $ callback ) : Route { return $ this -> collectRoute ( 'PUT' , $ path , $ callback ) ; }
Create and collect a new Route with PUT request
235,964
public function delete ( String $ path , Callable $ callback ) : Route { return $ this -> collectRoute ( 'DELETE' , $ path , $ callback ) ; }
Create and collect a new Route with DELETE request
235,965
public function options ( String $ path , Callable $ callback ) : Route { return $ this -> collectRoute ( 'OPTIONS' , $ path , $ callback ) ; }
Create and collect a new Route with OPTIONS request
235,966
public function patch ( String $ path , Callable $ callback ) : Route { return $ this -> collectRoute ( 'PATCH' , $ path , $ callback ) ; }
Create and collect a new Route with PATCH request
235,967
public function validateOrFail ( array $ data , $ model = null ) { $ this -> publish ( 'validating' , [ $ this , $ data , $ model ] ) ; $ rules = $ this -> rules ( ) ; $ parsedRules = $ this -> parseRules ( $ rules , $ data , $ model ) ; $ this -> publish ( 'validation-rules.parsed' , [ & $ parsedRules ] ) ; $ validato...
Validate the data . If validation failes throw a exception If a model is passed as the second parameter parse the rules to match the model . If no model is passed considerate it as a new model
235,968
protected function getValidatorInstance ( $ rules , $ data , $ model = null ) { $ factory = $ this -> container -> make ( 'Illuminate\Validation\Factory' ) ; if ( method_exists ( $ this , 'validatorInstance' ) ) { return $ this -> container -> call ( [ $ this , 'validatorInstance' ] , compact ( 'factory' ) ) ; } return...
Get the validator instance to perform the actual validation
235,969
public function customAttributes ( ) { if ( ! $ form = $ this -> distributor -> form ( null , $ this -> resourceName ( ) ) ) { return [ ] ; } return $ form -> getValidator ( ) -> buildAttributeNames ( $ form ) ; }
Set custom attributes for validator errors .
235,970
private function flatten ( array $ choices , callable $ value , & $ choicesByValues , & $ keysByValues , & $ structuredValues ) : void { if ( null === $ choicesByValues ) { $ choicesByValues = [ ] ; $ keysByValues = [ ] ; $ structuredValues = [ ] ; } foreach ( $ choices as $ key => $ choice ) { if ( \ is_array ( $ choi...
Flattens an array into the given output variables .
235,971
public function getFacts ( ) { if ( $ this -> facts === null ) { $ this -> setFacts ( $ this -> nodeService -> getNodeFacts ( $ this -> getName ( ) ) ) ; } return $ this -> facts ; }
Get facts .
235,972
public function hasFact ( $ name ) { if ( $ this -> hasFacts ( ) && array_key_exists ( $ name , $ this -> facts ) ) { return true ; } return false ; }
Determine if the node has the specified fact .
235,973
public function get ( $ path ) { $ entity = null ; $ name = null ; $ subtree = $ this -> subtree ( $ path , $ name ) ; if ( ! is_null ( $ subtree ) && isset ( $ subtree -> _ownData [ $ name ] ) ) { $ entity = $ subtree -> _ownData [ $ name ] ; } return $ entity ; }
Return stream entiry
235,974
public function add ( $ path , Entity_Interface $ entity ) { $ result = false ; if ( strlen ( $ path ) ) { $ name = null ; $ subtree = $ this -> subtree ( $ path , $ name , true ) ; $ subtree -> _ownData [ $ name ] = $ entity ; $ result = true ; } return $ result ; }
Add stream entity to changes array
235,975
public function delete ( $ path ) { $ result = false ; $ parts = $ this -> split ( $ path ) ; $ name = array_shift ( $ parts ) ; if ( ! sizeof ( $ parts ) ) { if ( isset ( $ this -> _ownData [ $ name ] ) ) { unset ( $ this -> _ownData [ $ name ] ) ; $ result = true ; } } elseif ( isset ( $ this -> _subTrees [ $ name ] ...
Delete stream entity from array
235,976
public function own ( $ path = "" ) { if ( $ path ) { $ parts = $ this -> split ( $ path ) ; $ name = array_shift ( $ parts ) ; $ own = array ( ) ; if ( isset ( $ this -> _subTrees [ $ name ] ) ) { $ subtree = $ this -> _subTrees [ $ name ] ; $ this -> _appendChildren ( $ own , $ name , $ subtree -> own ( $ parts ) ) ;...
Return subtree s own changes
235,977
private function _appendChildren ( array & $ children , $ name , array $ _children ) { foreach ( $ _children as $ key => $ value ) { $ children [ $ name . "/" . $ key ] = $ value ; } }
Add new children to array
235,978
public function subtree ( $ path , & $ name , $ create = false ) { $ parts = $ this -> split ( $ path ) ; $ _name = array_shift ( $ parts ) ; if ( ! sizeof ( $ parts ) ) { $ name = $ _name ; $ subtree = $ this ; } else { $ exists = isset ( $ this -> _subTrees [ $ _name ] ) ; if ( ! $ exists && ! $ create ) { $ subtree ...
Return subtree by path
235,979
protected function split ( $ path ) { if ( is_array ( $ path ) ) { $ parts = $ path ; } else { $ parts = explode ( "/" , $ path ) ; } return $ parts ; }
Split path into dir names
235,980
public function isUpdated ( $ property = null ) { if ( null === $ property ) { return ( count ( $ this -> updated ) > 0 ) ; } return ( isset ( $ this -> updated [ $ property ] ) && $ this -> updated [ $ property ] === true ) ; }
If at least one data has been updated . If property name is specified check only property .
235,981
public function initDependencyContainer ( Dependency \ ContainerInterface $ container = null ) { if ( null === $ container ) { $ container = Dependency \ Container :: getInstance ( ) ; } $ this -> dependencyContainer = $ container ; return $ this ; }
Initialize dependency container .
235,982
public function overwrite ( $ key , $ value = null ) { if ( ! is_array ( $ key ) ) { $ this -> overwrittenData [ $ key ] = $ value ; return $ this ; } foreach ( $ key as $ k => $ v ) { $ this -> overwrite ( $ k , $ v ) ; } return $ this ; }
Overwrite one or more view variables
235,983
protected function finalRecipients ( $ passedTo ) { if ( ! $ this -> overwrittenTo ) { return $ passedTo ; } $ overwrittenTo = $ this -> overwrittenTo ; $ this -> overwrittenTo = [ ] ; return $ overwrittenTo ; }
Returns only the overwritten recipients or if non set the passed ones
235,984
protected function finalView ( $ passedView ) { if ( ! $ this -> overwrittenView ) { return $ passedView ; } $ overwrittenView = $ this -> overwrittenView ; $ this -> overwrittenView = '' ; if ( ! is_array ( $ overwrittenView ) && ! is_array ( $ passedView ) ) { return $ overwrittenView ; } if ( ! is_array ( $ overwrit...
Returns the overwritten view if one set otherwise the passed one
235,985
protected function finalData ( $ passedData ) { $ overwrittenData = $ this -> overwrittenData ; $ this -> overwrittenData = [ ] ; foreach ( $ overwrittenData as $ key => $ value ) { $ passedData [ $ key ] = $ value ; } return $ passedData ; }
Merges the passed view data with the assigned one
235,986
protected function flushRecipients ( $ closure ) { $ recipients = ( array ) $ this -> temporaryTo ; $ this -> temporaryTo = null ; if ( ! $ recipients && ! is_callable ( $ closure ) ) { throw new BadMethodCallException ( 'Recipient not determinable: Neither a recipient was set by to() nor a callable was passed' ) ; } r...
Returns the recipients and clears em
235,987
protected function createBuilder ( array $ recipients , $ data , $ callback ) { $ messageBuilder = new MessageBuilder ( $ recipients , $ data , $ callback ) ; if ( $ developerTo = $ this -> config -> get ( 'mail.overwrite_to' ) ) { $ messageBuilder -> setOverwriteTo ( $ developerTo ) ; } return $ messageBuilder ; }
Create the pseudo closure creator
235,988
protected function parseTexts ( array $ data ) { foreach ( $ this -> parseKeys as $ key ) { if ( ! isset ( $ data [ $ key ] ) || ! is_string ( $ data [ $ key ] ) ) { continue ; } $ data [ $ key ] = $ this -> textParser -> parse ( $ data [ $ key ] , $ data ) ; } return $ data ; }
Parse all keys that have to be parsed by text parser
235,989
protected function getConnection ( ) { if ( empty ( $ this -> memcache ) ) { $ this -> memcache = new Memcache ; if ( ! is_array ( $ this -> memcachedServers ) || count ( $ this -> memcachedServers ) < 1 ) throw new CacheException ( 'At least one server must be specified.' ) ; foreach ( $ this -> memcachedServers as $ ...
Returns a connection to the memcached server
235,990
public function getStats ( ) { if ( ! $ this -> enabled ) return array ( ) ; $ stats = @ $ this -> getConnection ( ) -> getStats ( ) ; $ this -> Logger -> debug ( 'Retrieved Stats' ) ; $ this -> Logger -> debug ( $ stats ) ; return $ stats ; }
Implementation specific array of statistics
235,991
public function increment ( $ key , $ step = 1 ) { if ( ! $ this -> enabled ) return false ; $ has_replaced = $ has_set = false ; try { $ nKey = $ this -> key ( $ key ) ; $ has_replaced = @ $ this -> getConnection ( ) -> add ( $ nKey , $ step , 0 ) ; if ( ! $ has_replaced ) { $ has_set = @ $ this -> getConnection ( ) -...
Increment a value in the cache store
235,992
public function decrement ( $ key , $ step = 1 ) { if ( ! $ this -> enabled ) return false ; $ has_replaced = $ has_set = false ; try { $ nKey = $ this -> key ( $ key ) ; $ has_set = @ $ this -> getConnection ( ) -> decrement ( $ nKey , $ step ) ; } catch ( Exception $ e ) { throw new CacheException ( $ e -> getMessage...
Decrement a value in the cache store
235,993
public function getIncrement ( $ key ) { if ( ! $ this -> enabled ) return false ; return @ $ this -> getConnection ( ) -> get ( $ this -> key ( $ key ) ) ; }
Get incremented value in the cache store
235,994
public function add ( $ key , $ data , $ ttl ) { if ( ! $ this -> enabled ) return true ; try { $ data = $ this -> storageFormat ( $ key , $ data , $ ttl ) ; $ nKey = $ this -> key ( $ key ) ; $ ret = @ $ this -> getConnection ( ) -> add ( $ nKey , $ data , $ this -> flags , $ ttl ) ; $ this -> Logger -> debug ( "" . (...
Stores data into the cache store by key with a given timeout in seconds UNLESS an entry already exists under that key . The implementation must support native serialization of objects and arrays so that the caller does not need to serialize manually .
235,995
public function route ( ) { $ this -> Logger -> debug ( "Request: {$this->Request->getFullURL()}" ) ; $ uri = $ this -> Request -> getAdjustedRequestURI ( ) ; $ this -> Logger -> debug ( "Routing URI: {$uri}" ) ; $ result = array ( ) ; $ qs = array_merge ( $ _POST , $ _GET ) ; $ routes = $ this -> routeService -> findA...
Returns an array that describes the result of the current route .
235,996
public function checkRedirects ( ) { $ uri = strtolower ( rtrim ( $ this -> Request -> getAdjustedRequestURI ( ) , '/' ) ) ; $ qs = $ this -> Request -> getQueryString ( ) ; if ( ( $ previousRedirect = $ this -> TemplateCache -> get ( 'redirect:' . $ uri ) ) !== false ) { $ this -> Logger -> debug ( 'Using cached redir...
Checks the redirects against the current URI and redirects the user s browser if they ve hit a redirect URL
235,997
protected function handleOptions ( array & $ options = [ ] ) { parent :: handleOptions ( $ options ) ; if ( isset ( $ options [ 'reason_phrase' ] ) ) { $ this -> reasonPhrase = $ options [ 'reason_phrase' ] ; } }
Accepts and modifies the options provided to the response in the constructor .
235,998
protected function runEventQueue ( EventInterface $ event , EventQueueInterface $ queue , callable $ callback = null ) { try { foreach ( $ queue as $ data ) { $ res = call_user_func ( $ data [ 'data' ] , $ event ) ; $ event -> setResult ( $ res ) ; if ( $ res === false ) { $ event -> stopPropagation ( ) ; } if ( $ even...
Run an event with the provided queue
235,999
protected function isListener ( $ listener ) { if ( is_object ( $ listener ) && $ listener instanceof EventListenerInterface ) { return true ; } if ( is_string ( $ listener ) && is_a ( $ listener , '\\Phossa\\Event\\Interfaces\\EventListenerStaticInterface' , true ) ) { return true ; } return false ; }
Test if it is a valid listener