idx
int64 0
60.3k
| question
stringlengths 64
4.24k
| target
stringlengths 5
618
|
|---|---|---|
60,300
|
public function getMaxValue ( ) { $ values = $ this -> values -> toArray ( ) ; uasort ( $ values , $ this -> cmpValues ( 'getName' ) ) ; return end ( $ values ) ; }
|
Get maximum value
|
60,301
|
private function cmpValues ( $ methodName ) { return function ( $ value1 , $ value2 ) use ( $ methodName ) { return strnatcmp ( $ value1 -> { $ methodName } ( ) , $ value2 -> { $ methodName } ( ) ) ; } ; }
|
Compares two values
|
60,302
|
public function setMobileDetectionRules ( ) { $ this -> mobileDetectionRules = array_merge ( $ this -> phoneDevices , $ this -> tabletDevices , $ this -> operatingSystems , $ this -> userAgents ) ; }
|
Method sets the mobile detection rules .
|
60,303
|
public function setMobileDetectionRulesExtended ( ) { $ this -> mobileDetectionRulesExtended = array_merge ( $ this -> phoneDevices , $ this -> tabletDevices , $ this -> operatingSystems , $ this -> userAgents , $ this -> utilities ) ; }
|
Method sets the mobile detection rules + utilities . The reason this is separate is because utilities rules don t necessary imply mobile .
|
60,304
|
private function matchDetectionRulesAgainstUA ( $ userAgent = null ) { foreach ( $ this -> getRules ( ) as $ _regex ) { if ( empty ( $ _regex ) ) { continue ; } if ( $ this -> match ( $ _regex , $ userAgent ) ) { return true ; } } return false ; }
|
Find a detection rule that matches the current User - agent .
|
60,305
|
private function matchUAAgainstKey ( $ key , $ userAgent = null ) { $ key = strtolower ( $ key ) ; $ _rules = array_change_key_case ( $ this -> getRules ( ) ) ; if ( array_key_exists ( $ key , $ _rules ) ) { if ( empty ( $ _rules [ $ key ] ) ) { return null ; } return $ this -> match ( $ _rules [ $ key ] , $ userAgent ) ; } return false ; }
|
Search for a certain key in the rules array . If the key is found the try to match the corresponding regex agains the User - agent .
|
60,306
|
public function setEngines ( array $ engines ) { $ this -> engines = [ ] ; foreach ( $ engines as $ engine ) { $ this -> addEngine ( $ engine ) ; } }
|
Sets the render engines .
|
60,307
|
public function isDefaultValue ( $ key , $ value ) { if ( false === $ this -> definitions -> has ( $ key ) ) { return true ; } return $ this -> definitions -> isDefaultValue ( $ key , $ value ) ; }
|
Determines if a value is the same as the default for the provided field key .
|
60,308
|
protected function injectCSS ( ) { if ( ! $ this -> isCLI && ! self :: $ cssInjected ) { self :: $ cssInjected = true ; if ( file_exists ( $ this -> config -> cssPath ) ) { echo '<style type="text/css">' ; include $ this -> config -> cssPath ; echo '</style>' ; } else { echo 'The AloFramework handlers\' CSS file could not be found: ' . $ this -> config -> cssPath . PHP_EOL ; } } }
|
Injects the error handler CSS if it hasn t been injected yet
|
60,309
|
protected function getTrace ( $ trace , $ label ) { ob_start ( ) ; $ trace = array_slice ( $ trace , $ this -> config -> traceDepth * - 1 ) ; if ( $ this -> isCLI ) { $ this -> traceCLI ( $ trace , $ label ) ; } else { $ this -> traceHTML ( $ trace ) ; } return ob_get_clean ( ) ; }
|
Returns the formatted debug backtrace
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.