idx
int64
0
60.3k
question
stringlengths
64
4.24k
target
stringlengths
5
618
19,100
public function getItems ( ) { uasort ( $ this -> items , function ( AdminMenuItem $ first , AdminMenuItem $ second ) { if ( $ first -> getPriority ( ) <= $ second -> getPriority ( ) ) { return 1 ; } return - 1 ; } ) ; return $ this -> items ; }
Get admin menu items .
19,101
public function setMenuAttributes ( $ type , ItemInterface $ menu ) { if ( isset ( $ this -> getBag ( ) -> get ( 'config' ) -> nav -> attributes -> { $ type } ) ) { $ attributes = ( array ) $ this -> getBag ( ) -> get ( 'config' ) -> nav -> attributes -> { $ type } ; switch ( $ type ) { case 'root' : $ menu -> setChild...
Responsible for adding attributes to menu item groups
19,102
public function exists ( ) : bool { if ( $ this -> caching == false ) { return file_exists ( $ this -> getAbsoluteFilePath ( ) ) ; } if ( $ this -> exists == null ) { $ this -> exists = file_exists ( $ this -> getAbsoluteFilePath ( ) ) ; } return $ this -> exists ; }
Returns true if the file exists ; otherwise returns false .
19,103
public function getGroup ( ) : string { if ( $ this -> caching == false ) { $ groupId = $ this -> getGroupId ( ) ; if ( $ groupId == - 2 ) { return "" ; } $ group = posix_getgrgid ( $ groupId ) ; return $ group [ "name" ] ; } if ( $ this -> group == null ) { $ groupId = $ this -> getOwnerId ( ) ; if ( $ groupId == - 2 ...
Returns the group of the file . On Windows on systems where files do not have groups or if an error occurs an empty string is returned .
19,104
public function isDir ( ) : bool { if ( $ this -> caching == false ) { return is_dir ( $ this -> getAbsoluteFilePath ( ) ) ; } if ( $ this -> isDir == null ) { $ this -> isDir = is_dir ( $ this -> getAbsoluteFilePath ( ) ) ; } return $ this -> isDir ; }
Returns true if this object points to a directory or to a symbolic link to a directory ; otherwise returns false .
19,105
public function isFile ( ) : bool { if ( $ this -> caching == false ) { return is_file ( $ this -> getAbsoluteFilePath ( ) ) ; } if ( $ this -> isFile == null ) { $ this -> isFile = is_file ( $ this -> getAbsoluteFilePath ( ) ) ; } return $ this -> isFile ; }
Returns true if this object points to a file or to a symbolic link to a file . Returns false if the object points to something which isn t a file such as a directory .
19,106
public function isReadable ( ) : bool { if ( $ this -> caching == false ) { return is_readable ( $ this -> getAbsoluteFilePath ( ) ) ; } if ( $ this -> isReadable == null ) { $ this -> isReadable = is_readable ( $ this -> getAbsoluteFilePath ( ) ) ; } return $ this -> isReadable ; }
Returns true if the user can read the file ; otherwise returns false .
19,107
public function isWritable ( ) : bool { if ( $ this -> caching == false ) { return is_writable ( $ this -> getAbsoluteFilePath ( ) ) ; } if ( $ this -> isWritable == null ) { $ this -> isWritable = is_writable ( $ this -> getAbsoluteFilePath ( ) ) ; } return $ this -> isWritable ; }
Returns true if the user can write to the file ; otherwise returns false .
19,108
public function getLastModified ( ) : \ DateTime { if ( $ this -> caching == false ) { return \ DateTime :: createFromFormat ( "F d Y H:i:s." , date ( "F d Y H:i:s." , filemtime ( $ this -> getAbsoluteFilePath ( ) ) ) ) ; } if ( $ this -> lastModified == null ) { $ this -> lastModified = \ DateTime :: createFromFormat ...
Returns the date and time when the file was last modified .
19,109
public function getOwner ( ) : string { if ( $ this -> caching == false ) { $ ownerId = $ this -> getOwnerId ( ) ; if ( $ ownerId == - 2 ) { return "" ; } $ owner = posix_getpwuid ( $ ownerId ) ; return $ owner [ "name" ] ; } if ( $ this -> owner == null ) { $ ownerId = $ this -> getOwnerId ( ) ; if ( $ ownerId == - 2 ...
Returns the owner of the file . On systems where files do not have owners or if an error occurs an empty string is returned .
19,110
public function refresh ( ) : void { $ this -> size = null ; $ this -> lastModified = null ; $ this -> isReadable = null ; $ this -> isWritable = null ; $ this -> exists = null ; $ this -> created = null ; $ this -> isSymLink = null ; $ this -> isDir = null ; $ this -> isFile = null ; $ this -> isExecutable = null ; $ ...
Refreshes the information about the file i . e . reads in information from the file system the next time a cached property is fetched .
19,111
public function getSize ( ) : int { if ( $ this -> caching == false ) { return filesize ( $ this -> getAbsoluteFilePath ( ) ) ; } if ( $ this -> size == null ) { $ this -> size = filesize ( $ this -> getAbsoluteFilePath ( ) ) ; } return $ this -> size ; }
Returns the file size in bytes . If the file does not exist or cannot be fetched 0 is returned .
19,112
public function augmentNewSiteTreeItem ( & $ item ) { if ( isset ( $ _POST [ 'PageTypeFake' ] ) ) { $ item -> PageTypeFake = $ _POST [ 'PageTypeFake' ] ; } if ( isset ( $ _POST [ 'PageTypeID' ] ) ) { $ item -> PageTypeID = $ _POST [ 'PageTypeID' ] ; } }
Assigns new placeable pages to a page type
19,113
public static function firstSpace ( $ string ) { $ firstSpace = strpos ( $ string , " " ) ; return ( $ firstSpace === false ) ? strlen ( $ string ) : $ firstSpace ; }
First occurance of a space character
19,114
public static function calculate ( $ numSlots = 1 , $ numCores = 1 , $ ht = 'N' ) { $ totalCpu = ( $ ht == 'S' ) ? ( ( $ numSlots * $ numCores ) * 2 ) : ( $ numSlots * $ numCores ) ; $ aReturn = Array ( ) ; $ aReturn [ 'warning' ] = Array ( ) ; $ aReturn [ 'critical' ] = Array ( ) ; $ aReturn [ 'warning' ] [ 'load1min'...
Return calculation Threshoud alert CPU
19,115
public function getLastBuild ( ) { if ( $ this -> lastBuild == null ) { $ build = new self ( $ this -> getEngine ( ) , $ this -> getProject ( ) ) ; return $ build ; } return $ this -> lastBuild ; }
Returns the last build .
19,116
public function serialize ( ) { Xinc_Logger :: getInstance ( ) -> flush ( ) ; $ this -> setLastBuild ( ) ; if ( ! in_array ( $ this -> getStatus ( ) , array ( self :: PASSED , self :: FAILED , self :: STOPPED ) ) ) { throw new Xinc_Build_Exception_NotRun ( ) ; } elseif ( $ this -> getBuildTime ( ) == null ) { throw new...
stores the build information .
19,117
public static function unserialize ( Project $ project , $ buildTimestamp = null , $ statusDir = null ) { if ( $ statusDir == null ) { $ statusDir = Xinc :: getInstance ( ) -> getStatusDir ( ) ; } if ( $ buildTimestamp == null ) { $ fileName = Xinc_Build_History :: getLastBuildFile ( $ project ) ; } else { $ fileName =...
Unserialize a build by its project and buildtimestamp .
19,118
public function setNumber ( $ no ) { $ this -> info ( 'Setting Buildnumber to:' . $ no ) ; $ this -> setProperty ( 'build.number' , $ no ) ; $ this -> no = $ no ; }
Sets the sequence number for this build .
19,119
public function process ( $ slot ) { $ tasks = $ this -> getTasksForSlot ( $ slot ) ; while ( $ tasks -> valid ( ) ) { $ task = $ tasks -> current ( ) ; $ this -> log -> info ( 'Processing task: ' . $ task -> getName ( ) ) ; try { $ task -> process ( $ this ) ; } catch ( Exception $ e ) { var_dump ( $ e ) ; } $ tasks -...
processes the tasks that are registered for the slot .
19,120
public function getStatusMessage ( $ status = null ) { if ( ! $ status ) $ status = $ this -> getStatus ( ) ; if ( ! $ status || ! isset ( $ this -> status_messages [ $ status ] ) ) throw new \ LogicException ( "No such status. -> {$status}" ) ; return $ this -> status_messages [ $ status ] ; }
get status message .
19,121
private function sendStatus ( ) { if ( headers_sent ( ) ) return ; if ( isset ( $ this -> status_messages [ $ this -> status ] ) ) { header ( sprintf ( 'HTTP/%s %d %s' , $ this -> request -> getHttpVersion ( ) , $ this -> status , $ this -> status_messages [ $ this -> status ] ) ) ; } else { header ( 'Status: ' . $ thi...
send status code .
19,122
private function sendHeaders ( ) { foreach ( $ this -> body -> getHeaders ( ) as $ key => $ value ) { $ key = join ( '-' , array_map ( 'ucfirst' , explode ( '-' , $ key ) ) ) ; header ( sprintf ( '%s: %s' , $ key , $ value ) ) ; } }
send headers .
19,123
protected function getFields ( ) : array { if ( ! $ this -> fields ) { preg_match_all ( "~(?<!\\\\)(?:\\\\{2})*\(\?(?|P?<([_A-Za-z]\w{0,31})>|'([_A-Za-z]\w{0,31})')~" , $ this -> getPattern ( ) , $ matches ) ; $ this -> fields = $ matches [ 1 ] ; if ( ! $ this -> fields ) { throw new \ RuntimeException ( 'Pattern must ...
Gets names of fields to insert into .
19,124
protected function validate ( $ config , $ name , $ path ) { if ( ! is_array ( $ config ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The definition of "%s" in "%s" must be a YAML array.' , $ name , $ path ) ) ; } if ( $ extraKeys = array_diff ( array_keys ( $ config ) , self :: $ availableKeys ) ) { throw ne...
Validates the metadata configuration .
19,125
public function doLogin ( Request $ request ) { $ userdata = array ( 'email' => $ request -> email , 'password' => $ request -> password ) ; if ( \ Auth :: attempt ( $ userdata , true , true ) ) { if ( config ( 'entrance.activated' ) ) { if ( \ Auth :: user ( ) -> status != 1 ) { \ Auth :: logout ( ) ; $ request -> ses...
Logs user in after checking inserted data .
19,126
public function doLogout ( Request $ request ) { \ Auth :: logout ( ) ; $ request -> session ( ) -> flash ( 'message' , 'Succesvol uitgelogd' ) ; return redirect ( ) -> route ( 'login.index' ) ; }
Logs user out .
19,127
public function sendReset ( Request $ request ) { $ user = User :: where ( 'email' , '=' , $ request -> email ) -> first ( ) ; if ( $ user !== null ) { $ existingReset = Password_reset :: where ( 'email' , $ request -> email ) -> first ( ) ; if ( $ existingReset !== null ) { $ existingReset -> created_at = Carbon :: no...
Sends a password reset e - mail to the user .
19,128
public function doReset ( Request $ request ) { $ existingReset = Password_reset :: where ( 'email' , $ request -> email ) -> where ( 'token' , $ request -> token ) -> first ( ) ; if ( $ existingReset !== null ) { if ( $ request -> password === $ request -> input ( 'repeat-password' ) ) { $ user = User :: where ( 'emai...
Resets the users password .
19,129
public function doRegister ( RegisterRequest $ request ) { $ request [ 'password' ] = bcrypt ( $ request -> password ) ; $ userModel = config ( 'entrance.classes.user_model' ) ; $ user = $ userModel :: create ( $ request -> all ( ) ) ; if ( config ( 'intothesource' ) ) { $ roleModel = config ( 'intothesource.usermanage...
Register the given input
19,130
protected function aggregate ( ) : array { $ ret = [ ] ; if ( $ this -> flags & Benchmark :: BENCHMARK_TIME === Benchmark :: BENCHMARK_TIME ) { $ ret [ 'time' ] = TimeBenchmark :: score ( $ this -> h_time ) ; } if ( $ this -> flags & Benchmark :: BENCHMARK_MEMORY === Benchmark :: BENCHMARK_MEMORY ) { $ ret [ 'memory' ]...
Aggregate benchmark result
19,131
public function edit ( $ name , $ slug , $ locale , $ alias , $ icon ) : void { $ this -> name = $ name ; $ this -> slug = $ slug ; $ this -> locale = $ locale ; $ this -> alias = $ alias ; $ this -> icon = $ icon ; $ this -> updated_by = Yii :: $ app -> user -> identity -> id ; }
Edit a language .
19,132
public function checkRateLimits ( array $ response , array $ original_arguments ) { if ( is_array ( $ response ) && isset ( $ response [ 'errors' ] , $ response [ 'tts' ] ) ) { if ( $ this -> sleep_on_rate_limit ) { if ( $ response [ 'tts' ] == 0 ) { $ this -> api -> debug ( 'An error occured: ' . print_r ( $ response ...
Check whether the response from Twitter s API is rate limiting the calls or not .
19,133
public function getInitOptionsResolver ( ) { if ( null === $ this -> initOptionsResolver ) { if ( null !== $ this -> parent ) { $ this -> initOptionsResolver = clone $ this -> parent -> getInitOptionsResolver ( ) ; } else { $ this -> initOptionsResolver = new OptionsResolver ( ) ; } $ this -> innerType -> setInitOption...
Init options with innerType requirements
19,134
public function getExecOptionsResolver ( ) { if ( null === $ this -> execOptionsResolver ) { if ( null !== $ this -> parent ) { $ this -> execOptionsResolver = clone $ this -> parent -> getExecOptionsResolver ( ) ; } else { $ this -> execOptionsResolver = new OptionsResolver ( ) ; } $ this -> innerType -> setExecOption...
Exec options with innerType requirements
19,135
protected function newBuilder ( $ name , JobFactory $ factory , array $ initOptions , array $ execOptions ) { return new JobBuilder ( $ name , $ factory , new EventDispatcher ( ) , $ initOptions , $ execOptions ) ; }
Create new JobBuilder for the innerType
19,136
public function createCollection ( $ name , $ capped = false , $ size = 0 , $ max = 0 ) { $ this -> native -> createCollection ( $ name , $ capped , $ size , $ max ) ; return $ this -> selectCollection ( $ name ) ; }
Create a new Collection
19,137
protected function decideOnFailure ( $ error ) { if ( ! isset ( $ this -> errors [ $ error ] ) ) { throw new UnexpectedValueException ( sprintf ( 'Unexpected error "%s" received. All error must be specified ' . 'in errors array of this instance.' , $ error ) ) ; } $ this -> state = static :: STATE_FAILURE | static :: S...
Decides on failure .
19,138
protected function decideOnSuccess ( ) { $ this -> state = static :: STATE_SUCCESS ; $ this -> operationError = null ; $ this -> operationErrorDescription = null ; }
Decides on success .
19,139
public static function Gd2gc ( iauRefEllips $ n , $ elong , $ phi , $ height , array & $ xyz ) { $ j ; $ a ; $ f ; $ j = IAU :: Eform ( $ n , $ a , $ f ) ; if ( $ j == 0 ) { $ j = IAU :: Gd2gce ( $ a , $ f , $ elong , $ phi , $ height , $ xyz ) ; if ( $ j != 0 ) $ j = - 2 ; } if ( $ j != 0 ) IAU :: Zp ( $ xyz ) ; retur...
- - - - - - - - - i a u G d 2 g c - - - - - - - - -
19,140
public function load ( $ resource , $ type = null ) { $ collection = $ this -> loader -> load ( $ resource , $ type ) ; foreach ( $ collection -> all ( ) as $ route ) { if ( 'https' === $ route -> getRequirement ( '_scheme' ) ) { $ requirements = $ route -> getRequirements ( ) ; unset ( $ requirements [ '_scheme' ] ) ;...
Loads a RouteCollection but removes HTTPS scheme requirements from its routes before returning the collection .
19,141
protected function getEvent ( ) { if ( $ this -> event ) { return $ this -> event ; } $ controller = $ this -> getController ( ) ; if ( ! $ controller instanceof InjectApplicationEventInterface ) { throw new Exception \ DomainException ( 'getParam plugin requires a controller that implements InjectApplicationEventInter...
Get the event
19,142
public function setType ( $ type ) { $ this -> type = in_array ( $ type = strtolower ( $ type ) , [ 'button' , 'submit' , 'reset' ] ) ? $ type : 'button' ; return $ this ; }
Set the button type .
19,143
public static function make ( $ action , $ type = 'button' , array $ attributes = [ ] , $ disabled = false ) { return new static ( $ action , $ type , $ attributes , $ disabled ) ; }
Make a button instance .
19,144
protected function renderAttributes ( ) { $ attributes = collect ( ) ; $ attributes -> put ( 'type' , $ this -> type ) ; $ attributes -> put ( 'class' , $ this -> getStyleClass ( ) ) ; if ( $ this -> withTooltip ) { $ attributes -> put ( 'data-toggle' , 'tooltip' ) ; $ attributes -> put ( 'data-original-title' , $ this...
Render the attributes .
19,145
public function query ( $ sql , $ ERROR_LOG_OUTPUT = true ) { if ( $ ERROR_LOG_OUTPUT ) { $ this -> BackyardError -> log ( 5 , "Start of query {$sql}" , array ( 11 ) ) ; } if ( empty ( $ sql ) || ! is_string ( $ sql ) ) { if ( $ ERROR_LOG_OUTPUT ) { $ this -> BackyardError -> log ( 1 , "No mysql_query_string set. End o...
Query method if everything is OK return the mysqli_result object that is returned from parent query method
19,146
public static function addHook ( $ point , $ handler ) { if ( ! $ handler instanceof \ Closure and ! in_array ( Hook :: class , class_implements ( $ handler ) , false ) ) { throw new \ InvalidArgumentException ( "Failed adding hook. Provided handler for [{$point}] is not valid. Either provider a \\Closure or classpath ...
Register a hook instance .
19,147
public static function runHook ( $ name , array $ params = [ ] ) { static :: ensureHookPoint ( $ name ) ; foreach ( static :: $ hooks [ $ name ] as $ handler ) { if ( $ handler instanceof \ Closure ) { call_user_func_array ( $ handler , $ params ) ; } elseif ( class_exists ( $ handler ) ) { $ instance = app ( ) -> make...
Run the given hook .
19,148
public static function filter ( $ name , $ handler ) { if ( ! $ handler instanceof \ Closure and ! in_array ( Filter :: class , class_implements ( $ handler ) , false ) ) { throw new \ InvalidArgumentException ( "Failed adding Filter. Provided handler for [{$name}] is not valid. Must either provide a \\Closure or class...
Add a new filter to the registered filters list .
19,149
public static function getFilters ( $ filterNames = null ) { if ( ! is_null ( $ filterNames ) ) { if ( ! is_array ( $ filterNames ) ) { $ filterNames = [ $ filterNames ] ; } return array_only ( static :: $ filters , $ filterNames ) ; } else { return static :: $ filters ; } }
get filters value
19,150
public function transform ( array $ element ) { $ isArgument = $ this -> isArgument ( $ element [ 0 ] ) ; $ class = 'Symfony\Component\Console\Input\Input' . ( $ isArgument ? 'Argument' : 'Option' ) ; $ reflector = new \ ReflectionClass ( $ class ) ; if ( $ isArgument ) { $ element [ 1 ] = $ this -> transformMode ( $ e...
Transform the element to an instance of InputArgument or InputOption .
19,151
function getTotalSpace ( ) : float { $ directory = $ this -> isDirectory ( ) ? $ this -> fileName : $ this -> getParent ( ) ; return disk_total_space ( $ directory ) ; }
Returns the size of the partition named by this path .
19,152
function getFreeSpace ( ) { $ directory = $ this -> isDirectory ( ) ? $ this -> fileName : $ this -> getParent ( ) ; return disk_free_space ( $ directory ) ; }
Returns the number of unallocated bytes in the partition named by this path .
19,153
public static function factory ( $ config = array ( ) ) { $ default = array ( 'Accept' => 'application/json' , 'environment' => 'prod' , 'service-description-name' => Client :: NAME_SERVICE_AUTH , 'ssl' => false ) ; $ required = array ( 'base_url' , 'Accept' , 'environment' , 'client_id' , 'secret' , 'ssl' ) ; $ config...
Build new class ChateaOAuth2Client this provides user authentication for ApiChateaClient
19,154
public function withClientCredentials ( ) { $ command = $ this -> getCommand ( 'withClientCredentials' , array ( 'client_id' => $ this -> getClientId ( ) , 'client_secret' => $ this -> getSecret ( ) ) ) ; try { return $ command -> execute ( ) ; } catch ( ServerErrorResponseException $ ex ) { throw new AuthenticationExc...
Enables the apps to get service credentials as well as service credential authentication settings for use on the apps side of communication .
19,155
public function withRefreshToken ( $ refresh_token ) { if ( ! is_string ( $ refresh_token ) || 0 >= strlen ( $ refresh_token ) ) { throw new InvalidArgumentException ( "refresh_token must be a non-empty string" ) ; } $ command = $ this -> getCommand ( 'withRefreshToken' , array ( 'client_id' => $ this -> getClientId ( ...
After the client has been authorized for access they can use a refresh token to get a new access token .
19,156
public function applyPatch ( Patch $ patch , $ baseDirectory ) { $ error = null ; foreach ( $ patch -> getLevels ( ) as $ patchLevel ) { try { $ this -> applyPatchLevel ( $ patch , $ baseDirectory , $ patchLevel ) ; return ; } catch ( Exception \ PatchAlreadyApplied $ x ) { throw $ x ; } catch ( Exception \ PatchNotApp...
Apply a patch to a base directory .
19,157
protected function run ( $ command , $ standardInput = null ) { $ stdOut = '' ; $ stdErr = '' ; $ stdOut = array ( ) ; $ rc = $ this -> processExecutor -> execute ( $ command , $ stdOut ) ; $ stdOut = ( string ) $ stdOut ; $ stdErr = ( string ) $ this -> processExecutor -> getErrorOutput ( ) ; return array ( $ rc , $ s...
Run a command and return the exit code .
19,158
protected function checkCommandExists ( $ commandName , $ argument = '--version' ) { $ command = $ commandName ; $ argument = ( string ) $ argument ; if ( $ argument !== '' ) { $ command .= ' ' . $ argument ; } list ( $ rc , , $ stdErr ) = $ this -> run ( $ command ) ; if ( $ rc !== 0 ) { throw new Exception \ CommandN...
Check if a command exists .
19,159
private function read ( ) { flock ( $ this -> file , LOCK_SH ) ; rewind ( $ this -> file ) ; $ content = fgets ( $ this -> file ) ; flock ( $ this -> file , LOCK_UN ) ; $ this -> records = unserialize ( $ content ) ; }
Read cache from disk .
19,160
private function write ( ) { $ cache = serialize ( $ this -> records ) ; flock ( $ this -> file , LOCK_EX ) ; rewind ( $ this -> file ) ; ftruncate ( $ this -> file , 0 ) ; $ bytes = fwrite ( $ this -> file , $ cache ) ; flock ( $ this -> file , LOCK_UN ) ; return $ bytes === strlen ( $ cache ) ; }
Write cache to disk .
19,161
public function listAction ( ) { $ params = $ this -> params ( ) ; $ page = ( int ) $ params -> fromRoute ( 'page' ) ; $ mode = $ params -> fromRoute ( 'mode' ) ; $ all = $ mode == 'all' ; $ tags = array_map ( 'rawurldecode' , explode ( '/' , $ params -> fromRoute ( 'tags' ) ) ) ; $ paginator = $ this -> getServiceLoca...
List contents by tags
19,162
public function create ( ) { if ( ! $ this -> isFile ( $ this -> getName ( ) ) ) { $ this -> createPath ( $ this -> path ) ; $ file = fopen ( $ this -> getName ( ) , "w" ) ; fclose ( $ file ) ; } }
cree le ficher
19,163
public function writeOver ( $ content ) { $ this -> createPath ( $ this -> path ) ; file_put_contents ( $ this -> getName ( ) , $ content ) ; }
Ecrit dans un fichier En ecrasant son contenu
19,164
public function write ( $ content ) { $ this -> createPath ( $ this -> path ) ; file_put_contents ( $ this -> getName ( ) , $ content , FILE_APPEND ) ; }
Ecrire dans le fichier
19,165
public function generateName ( ) { $ chars = [ 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'g' , 'h' , 'i' , 'j' , 'k' , 'l' , 'm' , 'n' , 'o' , 'p' , 'q' , 'r' , 's' , 't' , 'u' , 'v' , 'w' , 'x' , 'y' , 'z' , 'A' , 'B' , 'C' , 'D' , 'E' , 'F' , 'G' , 'H' , 'I' , 'J' , 'K' , 'L' , 'M' , 'N' , 'O' , 'P' , 'Q' , 'R' , 'S' , 'T'...
genere un nom de fichier
19,166
public function metatagOutput ( $ args , $ obj ) { $ rawTitle = ! empty ( $ GLOBALS [ 'TSFE' ] -> altPageTitle ) ? $ GLOBALS [ 'TSFE' ] -> altPageTitle : $ GLOBALS [ 'TSFE' ] -> page [ 'title' ] ; if ( $ args [ 'meta.title' ] && $ args [ 'meta.title' ] [ 'attributes' ] [ 'content' ] !== $ rawTitle ) { $ args [ 'meta.ti...
Metaseo Signal for page metadata see - > \ Metaseo \ Metaseo \ Page \ Part \ MetatagPart - > processMetaTags
19,167
protected function executeValidation ( InputInterface $ input , OutputInterface $ output ) { $ types = [ ] ; foreach ( $ this -> getResolver ( ) -> getTypes ( ) as $ type ) { $ types [ $ type -> getType ( ) ] = $ type -> getType ( ) ; } $ invalid = [ ] ; foreach ( $ input -> getArgument ( 'id' ) as $ id ) { if ( ! isse...
validate the ids in de input
19,168
protected function executeDelete ( InputInterface $ input , OutputInterface $ output ) { $ this -> doIndexCleanup ( $ input -> getArgument ( 'id' ) ) ; $ this -> doIndexCommit ( ) ; return 0 ; }
queue a delete on the solr index
19,169
protected function executeIndex ( InputInterface $ input , OutputInterface $ output ) { $ builder = $ this -> getDocumentManager ( ) -> createQueryBuilder ( Content :: class ) ; $ builder -> select ( 'id' , 'contentType' , 'class' ) -> hydrate ( false ) ; if ( $ input -> getOption ( 'full' ) ) { $ result = $ builder ->...
queue the indexing of content in to solr
19,170
protected function doIndex ( Cursor $ cursor , ProgressHelper $ progress ) { $ queue = $ this -> getQueue ( ) ; $ count = 0 ; $ manager = $ this -> getDocumentManager ( ) ; foreach ( $ cursor as $ document ) { $ progress -> advance ( ) ; $ job = new Job ( 'ADD' ) ; $ contentType = isset ( $ document [ 'contentType' ] )...
Add all the documents in the cursor to the solr queue
19,171
protected function doIndexCleanup ( array $ types , DateTime $ date = null ) { $ query = [ ] ; if ( $ types ) { $ query [ ] = 'type_name:("' . implode ( '" OR "' , $ types ) . '")' ; } else { $ query [ ] = '*:*' ; } if ( $ date ) { $ date = clone $ date ; $ date -> setTimezone ( new DateTimeZone ( 'UTC' ) ) ; $ query [...
delete all the types or everything if none is given
19,172
private function resolveRequest ( ActionInterface $ action , CallableInterface $ callable , array $ inputArguments , \ ReflectionParameter $ parameter ) { $ class = $ parameter -> getClass ( ) ; if ( $ class -> isInterface ( ) ) { throw new \ RuntimeException ( sprintf ( 'Could not create instance via interface for par...
Resolve request parameter
19,173
private function strictRequestValidate ( RequestInterface $ request ) { $ requestMetadata = $ this -> validator -> getMetadataFor ( $ request ) ; $ useStrictGroup = false ; if ( $ requestMetadata instanceof ClassMetadata ) { foreach ( $ requestMetadata -> getConstrainedProperties ( ) as $ propertyName ) { $ propertyMet...
Strict request validation
19,174
private function isPropertyRequired ( \ ReflectionProperty $ property , array $ groups ) { if ( ! $ this -> validator ) { return true ; } $ metadata = $ this -> validator -> getMetadataFor ( $ property -> getDeclaringClass ( ) -> getName ( ) ) ; if ( ! $ metadata instanceof ClassMetadata ) { return true ; } $ propertyM...
Is required property
19,175
public function canAccess ( array $ user ) { $ can = false ; foreach ( $ user [ "roles" ] as $ userRole ) { foreach ( $ userRole [ "permissions" ] as $ permission ) { if ( in_array ( $ permission , $ this -> permissions ) ) { $ can = true ; break ; } } } return $ can ; }
Test if the user has the required permissions to access .
19,176
public function setCode ( int $ code ) { $ allowed_codes = [ 0 , 1 , 2 ] ; if ( ! in_array ( $ code , $ allowed_codes ) ) { $ code = 1 ; } $ this -> code = $ code ; }
Sets banlog code
19,177
public function add ( ) : int { if ( empty ( $ this -> logdate ) || empty ( $ this -> logstamp ) ) { $ time = time ( ) ; if ( empty ( $ this -> logdate ) ) { $ this -> logdate = date ( 'Y-m-d H:i:s' , $ time ) ; } if ( empty ( $ this -> logstamp ) ) { $ this -> logstamp = $ time ; } } if ( empty ( $ this -> client ) ) ...
Creates log entry in Db and return log id
19,178
public function disconnect ( ) { if ( ! is_resource ( $ this -> _connection ) ) { $ this -> connected = false ; } else { $ this -> connected = ! fclose ( $ this -> _connection ) ; if ( ! $ this -> connected ) { $ this -> _connection = null ; } } return ! $ this -> connected ; }
Closes the connection to the beanstalk server .
19,179
public function reconnect ( ) { $ this -> disconnect ( ) ; $ this -> connect ( ) ; $ stats = $ this -> stats ( ) ; return $ stats === false ? false : true ; }
reset the connection to the beanstalk server .
19,180
public function usePut ( $ tube , $ data , $ pri = 0 , $ delay = 0 , $ ttr = 30 ) { $ result = $ this -> useTube ( $ tube ) ; if ( $ result === false ) return false ; $ jobId = $ this -> put ( $ pri , $ delay , $ ttr , $ data ) ; return $ jobId ; }
useTube and put
19,181
public function generatePasswordAction ( Request $ request ) { $ context = $ this -> loadContext ( $ request ) ; $ resourceName = $ this -> config -> getResourceName ( ) ; $ resource = $ context -> getResource ( $ resourceName ) ; $ this -> isGranted ( 'EDIT' , $ resource ) ; if ( in_array ( 'ROLE_SUPER_ADMIN' , $ reso...
Generates a new password for the user .
19,182
public function clearPasswordRequestAction ( Request $ request ) { $ context = $ this -> loadContext ( $ request ) ; $ resourceName = $ this -> config -> getResourceName ( ) ; $ resource = $ context -> getResource ( $ resourceName ) ; $ this -> isGranted ( 'EDIT' , $ resource ) ; if ( $ resource -> isPasswordRequestNon...
Clears the user password request .
19,183
public function get ( $ key , $ throwIfNotFound = false ) { if ( $ this -> has ( $ key ) ) { return $ this -> data [ $ key ] ; } else if ( $ throwIfNotFound ) { throw new \ RuntimeException ( 'Key ' . $ key . ' not found in DI Container registry' ) ; } else { return null ; } }
Fetches an object from the registry .
19,184
public static function to ( $ path ) { $ currentLanguage = \ Translation :: getLanguage ( ) ; if ( \ Translation :: getDefaultLanguage ( ) === $ currentLanguage ) { $ currentLanguage = '' ; } else { $ currentLanguage = '/' . $ currentLanguage ; } return $ currentLanguage . $ path ; }
Append with language
19,185
public static function open ( $ form_attr = array ( ) ) { try { if ( ! is_array ( $ form_attr ) ) { throw new HelperException ( sprintf ( 'Expecting array of form attributes.e.g.$form_attr = array(\'name\'=>\'form1\',\'action\'=>\'post\')' , $ form_attr ) ) ; } $ form_attr_str = '' ; foreach ( $ form_attr as $ key => $...
Ths method create form open tag with attributes in view .
19,186
public function display ( $ cachable = false , $ urlparams = array ( ) ) { $ document = JFactory :: getDocument ( ) ; $ vName = $ this -> input -> get ( 'view' , 'categories' ) ; $ vFormat = $ document -> getType ( ) ; $ lName = $ this -> input -> get ( 'layout' , 'default' , 'string' ) ; $ id = $ this -> input -> getI...
Method to display a view .
19,187
public function buildOutput ( $ form ) { $ this -> debug -> groupCollapsed ( __METHOD__ ) ; $ this -> debug -> groupUncollapse ( ) ; $ str = '' ; foreach ( $ form -> currentFields as $ field ) { $ str .= $ field -> build ( ) . "\n" ; } $ this -> debug -> groupEnd ( ) ; return $ str ; }
Default fields builder
19,188
private function buildHiddenFields ( ) { $ this -> debug -> groupCollapsed ( __METHOD__ ) ; $ cfg = $ this -> form -> cfg ; $ printOpts = & $ cfg [ 'output' ] ; $ hiddenFields = '' ; if ( $ printOpts [ 'inputKey' ] ) { $ hiddenFields .= '<input type="hidden" name="_key_" value="' . \ htmlspecialchars ( $ this -> keyVal...
Generate hidden fields not related to inputs
19,189
public static function pName ( ) { if ( is_null ( self :: $ pluginName ) ) { self :: $ pluginName = explode ( '/' , plugin_basename ( __FILE__ ) ) [ 0 ] ; } return self :: $ pluginName ; }
Get plugin name
19,190
public static function pBaseN ( ) { if ( is_null ( self :: $ pluginBaseName ) ) { self :: $ pluginBaseName = self :: pName ( ) . "/index.php" ; } return self :: $ pluginBaseName ; }
Get plugin base name
19,191
public static function pDir ( $ complement = "" ) { if ( is_null ( self :: $ pluginDirectory ) ) { self :: $ pluginDirectory = WP_PLUGIN_DIR . "/" . self :: pName ( ) ; } return self :: $ pluginDirectory . $ complement ; }
Get plugin directory
19,192
public static function pUrl ( $ complement = "" ) { if ( is_null ( self :: $ pluginUrl ) ) { self :: $ pluginUrl = WP_PLUGIN_URL . "/" . self :: pName ( ) ; } return self :: $ pluginUrl . $ complement ; }
Get plugin url
19,193
public function getArchived ( ) { if ( ! $ this -> isArchivable ( ) ) { return false ; } if ( empty ( $ this -> owner -> { $ this -> archiveField } ) ) { return false ; } return true ; }
Get archived .
19,194
public function add ( $ method , $ name , $ path , $ controller = null , array $ requirements = [ ] , array $ options = [ ] , $ host = '' , array $ schemas = [ ] , $ condition = '' ) { if ( ! in_array ( strtoupper ( $ method ) , $ this -> allowedMethod ) ) { throw new HttpMethodNotAllowedException ( ) ; } $ this -> rou...
add a route rule
19,195
public function get ( $ name , $ path , $ controller = null ) { $ this -> add ( 'GET' , $ name , $ path , $ controller ) ; return $ this ; }
add a get rule in route
19,196
public function post ( $ name , $ path , $ controller = null ) { $ this -> add ( 'POST' , $ name , $ path , $ controller ) ; return $ this ; }
add a post rule in route
19,197
public function put ( $ name , $ path , $ controller = null ) { $ this -> add ( 'PUT' , $ name , $ path , $ controller ) ; return $ this ; }
add a put rule in route
19,198
public function delete ( $ name , $ path , $ controller = null ) { $ this -> add ( 'DELETE' , $ name , $ path , $ controller ) ; return $ this ; }
add a delete rule in route
19,199
public function patch ( $ name , $ path , $ controller = null ) { $ this -> add ( 'PATCH' , $ name , $ path , $ controller ) ; return $ this ; }
add a patch rule in route