idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
10,500
public function getStatus ( ) { $ rest = $ this -> getService ( self :: API_CONNECTION_XDSL ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ Connection \ Xdsl \ XdslInfos :: class ) ; }
Get the current XDSL Connection status
10,501
protected static function getCheckoutBody ( CheckoutInterface $ checkout ) : array { return [ "checkout_reference" => $ checkout -> getReference ( ) , "amount" => $ checkout -> getAmount ( ) , "currency" => $ checkout -> getCurrency ( ) , "fee_amount" => $ checkout -> getFeeAmount ( ) , "pay_to_email" => $ checkout -> ...
Generate a body to create a new checkout
10,502
public function create ( models \ Call \ ContactNumber $ ContactNumber ) { $ rest = $ this -> getService ( self :: API_NUMBER ) ; $ rest -> POST ( $ ContactNumber ) ; return $ rest -> getResult ( models \ Call \ ContactNumber :: class ) ; }
Add a new contact number
10,503
public function update ( models \ Call \ ContactNumber $ ContactNumber ) { $ rest = $ this -> getService ( self :: API_NUMBER . $ ContactNumber -> getId ( ) ) ; $ rest -> PUT ( $ ContactNumber ) ; return $ rest -> getResult ( models \ Call \ ContactNumber :: class ) ; }
Update a contact number
10,504
public function getConfiguration ( ) { $ rest = $ this -> getService ( self :: API_LAN_CONFIG ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ LAN \ LanConfig :: class ) ; }
Get the current LAN configuration
10,505
public function setConfiguration ( models \ LAN \ LanConfig $ lanConfig ) { $ rest = $ this -> getService ( self :: API_LAN_CONFIG ) ; $ rest -> PUT ( $ lanConfig ) ; return $ rest -> getResult ( models \ LAN \ LanConfig :: class ) ; }
Update the LAN configuration
10,506
public function getConfiguration ( ) { $ rest = $ this -> getService ( self :: API_DHCP_CONFIG ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ DhcpConfig :: class ) ; }
Get the current DHCP configuration
10,507
public function setConfiguration ( models \ DhcpConfig $ dhcpConfig ) { $ rest = $ this -> getService ( self :: API_DHCP_CONFIG ) ; $ rest -> PUT ( $ dhcpConfig ) ; return $ rest -> getResult ( models \ DhcpConfig :: class ) ; }
Update the DHCP configuration
10,508
public function verifySslPeer ( $ verify_ssl_peer = true , $ custom_ca_file = null ) { if ( $ custom_ca_file ) { if ( ! is_file ( $ custom_ca_file ) ) { throw new \ InvalidArgumentException ( 'Custom CA file does not exist' ) ; } if ( ! $ verify_ssl_peer ) { throw new \ LogicException ( 'Custom CA file should not be se...
Configure SSL connection parameters
10,509
public function create ( $ key , $ value , $ ttl = 0 ) { return $ request = $ this -> set ( $ key , $ value , $ ttl , [ 'prevExist' => 'false' ] ) ; }
Create a new key with a given value
10,510
private function httpGet ( $ url , $ query_arguments = [ ] ) { if ( ! empty ( $ query_arguments ) ) { $ url .= '?' . http_build_query ( $ query_arguments ) ; } return $ this -> executeCurlRequest ( $ this -> getCurlHandle ( $ url ) , $ url ) ; }
Make a GET request
10,511
private function httpPut ( $ url , $ payload = [ ] , $ query_arguments = [ ] ) { if ( ! empty ( $ query_arguments ) ) { $ url .= '?' . http_build_query ( $ query_arguments ) ; } $ curl = $ this -> getCurlHandle ( $ url ) ; curl_setopt ( $ curl , CURLOPT_CUSTOMREQUEST , 'PUT' ) ; curl_setopt ( $ curl , CURLOPT_HTTPHEADE...
Make a PUT request
10,512
private function httpDelete ( $ url , $ query_arguments = [ ] ) { if ( ! empty ( $ query_arguments ) ) { $ url .= '?' . http_build_query ( $ query_arguments ) ; } $ curl = $ this -> getCurlHandle ( $ url ) ; curl_setopt ( $ curl , CURLOPT_CUSTOMREQUEST , 'DELETE' ) ; return $ this -> executeCurlRequest ( $ curl , $ url...
Make a DELETE request
10,513
private function getCurlHandle ( $ url ) { if ( $ curl = curl_init ( $ url ) ) { curl_setopt ( $ curl , CURLOPT_CONNECTTIMEOUT , 15 ) ; curl_setopt ( $ curl , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ curl , CURLOPT_FOLLOWLOCATION , true ) ; if ( $ this -> is_https && $ this -> verify_ssl_peer ) { curl_setopt (...
Initialize curl handle
10,514
public function getAll ( ) { $ rest = $ this -> getService ( self :: API_WIFI_AP ) ; $ rest -> GET ( ) ; return $ rest -> getResultAsArray ( models \ WiFi \ AccessPoint \ AP :: class ) ; }
Get all Access Points
10,515
public function getFromId ( $ accessPointId ) { $ rest = $ this -> getService ( self :: API_WIFI_AP . $ accessPointId ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ WiFi \ AccessPoint \ AP :: class ) ; }
Get a specific Access Point
10,516
public function update ( models \ WiFi \ AccessPoint \ AP $ accessPoint ) { $ rest = $ this -> getService ( self :: API_WIFI_AP . $ accessPoint -> getId ( ) ) ; $ rest -> PUT ( $ accessPoint ) ; return $ rest -> getResult ( models \ WiFi \ AccessPoint \ AP :: class ) ; }
Update an Access Point
10,517
public function getNeighborsFromId ( $ accessPointId ) { $ service = sprintf ( self :: API_WIFI_AP_NEIGHBORS , $ accessPointId ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> GET ( ) ; return $ rest -> getResultAsArray ( models \ WiFi \ Radar \ Neighbor :: class ) ; }
Get the list of Neighbor seen by the AP
10,518
public function refreshNeighborsScan ( $ accessPointId ) { $ service = sprintf ( self :: API_WIFI_AP_NEIGHBORS , $ accessPointId ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> POST ( ) ; return $ rest -> getSuccess ( ) ; }
WARNING during the scan the AP will be unavailable . Therefore you should ask for user confirmation prior to launching a scan . Once launched you should wait until the ap state comes back from scanning to get updated info .
10,519
public function getChannelUsageFromId ( $ accessPointId ) { $ service = sprintf ( self :: API_WIFI_AP_CHANNEL_USAGE , $ accessPointId ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> GET ( ) ; return $ rest -> getResultAsArray ( models \ WiFi \ Radar \ ChannelUsage :: class ) ; }
List Wi - Fi channels usage
10,520
public function dump ( ) : string { $ html = '<p><i>You have made ' . self :: $ numQueries . ' database queries.</i></p><pre>' ; foreach ( self :: $ queries as $ key => $ val ) { $ params = empty ( self :: $ params [ $ key ] ) ? null : htmlentities ( print_r ( self :: $ params [ $ key ] , 1 ) , null , 'UTF-8' ) . '<br/...
Get a HTML representation of all queries made for debugging and analysing purpose .
10,521
public function getConfiguration ( ) { $ rest = $ this -> getService ( self :: API_PARENTAL_CONFIG ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ ParentalControl \ FilterConfig :: class ) ; }
Return the current Filter configuration
10,522
public function setConfiguration ( models \ ParentalControl \ FilterConfig $ filterConfig ) { $ rest = $ this -> getService ( self :: API_PARENTAL_CONFIG ) ; $ rest -> PUT ( $ filterConfig ) ; return $ rest -> getResult ( models \ ParentalControl \ FilterConfig :: class ) ; }
Update the filter configuration
10,523
public function getAll ( ) { $ rest = $ this -> getService ( self :: API_PARENTAL_FILTER ) ; $ rest -> GET ( ) ; return $ rest -> getResultAsArray ( models \ ParentalControl \ Filter :: class ) ; }
Get the list of all filters
10,524
public function getFromId ( $ filterId ) { $ rest = $ this -> getService ( self :: API_PARENTAL_FILTER . $ filterId ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ ParentalControl \ Filter :: class ) ; }
Get a specific filter from id
10,525
public function update ( models \ ParentalControl \ Filter $ filter ) { $ rest = $ this -> getService ( self :: API_PARENTAL_FILTER . $ filter -> getId ( ) ) ; $ rest -> PUT ( $ filter ) ; return $ rest -> getResult ( models \ ParentalControl \ Filter :: class ) ; }
Update a filter
10,526
public function deleteFromId ( $ filterId ) { $ rest = $ this -> getService ( self :: API_PARENTAL_FILTER . $ filterId ) ; $ rest -> DELETE ( ) ; return $ rest -> getSuccess ( ) ; }
Delete a filter with the specified id
10,527
public function add ( models \ ParentalControl \ Filter $ filter ) { $ rest = $ this -> getService ( self :: API_PARENTAL_FILTER ) ; $ rest -> POST ( $ filter ) ; return $ rest -> getResult ( models \ ParentalControl \ Filter :: class ) ; }
Add a new filter
10,528
public function disableFramework ( DataContainer $ dataContainer ) : void { if ( $ dataContainer -> activeRecord -> layoutType === 'bootstrap' && $ dataContainer -> activeRecord -> framework ) { $ dataContainer -> activeRecord -> framework = [ ] ; $ statement = $ this -> connection -> prepare ( 'UPDATE tl_layout SET fr...
Disable contao framework .
10,529
protected function trimRep ( $ word ) { $ lastChar = null ; $ cleanWord = null ; $ max = mb_strlen ( $ word , 'UTF-8' ) ; for ( $ i = 0 ; $ i < $ max ; $ i ++ ) { $ char = mb_substr ( $ word , $ i , 1 , 'UTF-8' ) ; if ( $ char != $ lastChar ) { $ cleanWord .= $ char ; } $ lastChar = $ char ; } return $ cleanWord ; }
Remove any characters replicates
10,530
public function get ( $ number = 0 ) { if ( isset ( $ this -> tokens [ $ this -> current + $ number ] ) ) { return $ this -> tokens [ $ this -> current + $ number ] ; } }
Get a token .
10,531
public function next ( ) { $ this -> peek = 0 ; if ( isset ( $ this -> tokens [ $ this -> current ] ) ) { return $ this -> tokens [ $ this -> current ++ ] ; } }
Next token .
10,532
public function nextIf ( $ type , $ value = null ) { if ( $ this -> test ( $ type , $ value ) ) { return $ this -> next ( ) ; } }
Gets next token if condition is true .
10,533
public function expect ( $ type , $ value = null , $ message = null ) { $ token = $ this -> tokens [ $ this -> current ] ; if ( ! $ token -> test ( $ type , $ value ) ) { throw new SyntaxErrorException ( sprintf ( '%sUnexpected token "%s" of value "%s" ("%s" expected%s) on line %s' , $ message ? "$message. " : "" , $ t...
Tests the current token for a condition or throws an exception otherwise .
10,534
public function peek ( ) { if ( isset ( $ this -> tokens [ $ this -> current + ++ $ this -> peek ] ) ) { return $ this -> tokens [ $ this -> current + $ this -> peek ] ; } else { return null ; } }
Moves the peek token forward .
10,535
public function peekUntil ( $ type , $ value = null ) { while ( $ token = $ this -> peek ( ) and ! $ token -> test ( $ type , $ value ) ) { $ token = null ; } return $ token ; }
Peeks until a token with the given type is found .
10,536
protected static function getXsltDOMDocument ( ) { static $ cache = null ; $ xsltFile = __DIR__ . '/doctrine-xml-0.5.xsl' ; if ( ! isset ( $ cache ) ) { $ s = ( is_file ( $ xsltFile ) && is_readable ( $ xsltFile ) ) ? @ file_get_contents ( $ xsltFile ) : false ; if ( $ s === false ) { throw new Exception ( 'Failed to l...
Return the XSLT document that fixes a source xml file .
10,537
public function setMergedGrantedScopes ( array $ scopes = null ) { ValidationUtility :: ensureNullOrArrayOfString ( '$scopes' , $ scopes ) ; $ this -> mergedGrantedScopes = $ scopes ; return $ this ; }
Set the scopes granted to the client application by all the past authorization processes .
10,538
public function endpointUrl ( $ prefix = null , $ includeId = true ) { $ url = self :: API_URL ; if ( $ includeId ) { $ url = $ url . '/' . $ this -> getCompanyId ( ) ; } if ( $ prefix = trim ( $ prefix , '/' ) ) { $ url = $ url . '/' . $ prefix ; } return $ url ; }
Generate a new endpoint url .
10,539
public function authorize ( ) { $ response = $ this -> send ( self :: API_TOKEN_URL , false , array_only ( $ this -> config , [ 'client_id' , 'client_secret' , 'redirect_uri' , 'username' , 'password' , 'grant_type' ] ) , 'POST' ) ; if ( $ token = array_get ( $ response , 'access_token' ) ) { $ this -> setAccessToken (...
Send a new authorization request .
10,540
public function make ( $ type ) { if ( $ instance = array_get ( $ this -> resolved , $ type ) ) { return $ instance ; } return $ this -> build ( $ type ) ; }
Retrieve the resolved instance or build an instance of the type .
10,541
protected function build ( $ type ) { if ( $ concrete = array_get ( $ this -> aliases , $ type ) ) { return $ this -> resolved [ $ type ] = new $ concrete ( $ this ) ; } throw new InternalServerErrorException ; }
Build an instance of the type .
10,542
public function call ( $ function , array $ params = null , $ method = 'GET' ) { $ url = $ this -> endpointUrl ( $ function ) ; return $ this -> send ( $ url , true , $ params , $ method ) ; }
Create a new request with autorization .
10,543
protected function jdToGreg ( $ julian ) { $ julian = $ julian - 1721119 ; $ calc1 = 4 * $ julian - 1 ; $ year = floor ( $ calc1 / 146097 ) ; $ julian = floor ( $ calc1 - 146097 * $ year ) ; $ day = floor ( $ julian / 4 ) ; $ calc2 = 4 * $ day + 3 ; $ julian = floor ( $ calc2 / 1461 ) ; $ day = $ calc2 - 1461 * $ julia...
Converts Julian Day Count to Gregorian date
10,544
public function hijriMonthDays ( $ m , $ y , $ umAlqoura = true ) { if ( $ y >= 1320 && $ y < 1460 ) { $ begin = $ this -> mktime ( 0 , 0 , 0 , $ m , 1 , $ y ) ; if ( $ m == 12 ) { $ m2 = 1 ; $ y2 = $ y + 1 ; } else { $ m2 = $ m + 1 ; $ y2 = $ y ; } $ end = $ this -> mktime ( 0 , 0 , 0 , $ m2 , 1 , $ y2 ) ; if ( $ umAl...
Calculate how many days in a given Hijri month
10,545
public static function getRequestParams ( $ type = 'all' ) { $ request = Yii :: $ app -> getRequest ( ) ; switch ( $ type ) { case 'get' : $ params = $ request -> get ( ) ; break ; case 'post' : $ params = $ request -> post ( ) ; break ; case 'all' : default : $ params = ArrayHelper :: merge ( $ request -> get ( ) , $ ...
Returns the request Params
10,546
public static function getRequestParam ( $ name = null , $ defaultValue = null ) { $ params = self :: getRequestParams ( ) ; if ( isset ( $ params [ $ name ] ) ) { return $ params [ $ name ] ; } else { return $ defaultValue ; } }
Returns GET|POST parameter with a given name . If name isn t specified returns an array of all Request parameters .
10,547
private function parseAttributes ( string $ attributeString ) : Attributes { $ attributes = new Attributes ( ) ; array_map ( function ( $ attribute ) use ( $ attributes ) { $ attribute = trim ( $ attribute ) ; if ( ! $ attribute ) { return ; } if ( preg_match ( '/([^=]*)="([^"]*)"/' , $ attribute , $ matches ) ) { $ at...
Parse given attributes .
10,548
public function setScopes ( array $ scopes = null ) { ValidationUtility :: ensureNullOrArrayOfString ( '$scopes' , $ scopes ) ; $ this -> scopes = $ scopes ; return $ this ; }
Set the scopes that are associated with the access token .
10,549
public function setProperties ( array $ properties = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$properties' , $ properties , __NAMESPACE__ . '\Property' ) ; $ this -> properties = $ properties ; return $ this ; }
Set the properties associated with the access token .
10,550
public function setLogicalDeviceState ( $ logicalDeviceId , $ on ) { $ setActuatorStatesRequest = new SetActuatorStatesRequest ( $ this ) ; $ setActuatorStatesRequest -> addLogicalDeviceState ( $ logicalDeviceId , $ on ) ; return $ setActuatorStatesRequest -> send ( ) ; }
Set the state of an logical device
10,551
public function setSwitchActuatorState ( $ logicalDeviceId , $ on ) { $ setActuatorStatesRequest = new SetActuatorStatesRequest ( $ this ) ; $ setActuatorStatesRequest -> addSwitchActuatorState ( $ logicalDeviceId , $ on ) ; return $ setActuatorStatesRequest -> send ( ) ; }
Set the state of an adapter for example
10,552
public function getLocations ( ) { if ( ! is_array ( $ this -> locations ) || count ( $ this -> locations ) < 1 ) { $ this -> getEntities ( ) ; } return $ this -> locations ; }
Returns an array of all locations
10,553
protected function checkEn ( $ str ) { $ lines = $ this -> _enLogodd ; $ logodd = array ( ) ; $ line = array_shift ( $ lines ) ; $ line = rtrim ( $ line ) ; $ second = preg_split ( "/\t/" , $ line ) ; $ temp = array_shift ( $ second ) ; foreach ( $ lines as $ line ) { $ line = rtrim ( $ line ) ; $ values = preg_split (...
Calculate the log odd probability that inserted string from keyboard is in English language
10,554
protected function checkAr ( $ str ) { $ lines = $ this -> _arLogodd ; $ logodd = array ( ) ; $ line = array_shift ( $ lines ) ; $ line = rtrim ( $ line ) ; $ second = preg_split ( "/\t/" , $ line ) ; $ temp = array_shift ( $ second ) ; foreach ( $ lines as $ line ) { $ line = rtrim ( $ line ) ; $ values = preg_split (...
Calculate the log odd probability that inserted string from keyboard is in Arabic language
10,555
public function fixKeyboardLang ( $ str ) { preg_match_all ( "/([\x{0600}-\x{06FF}])/u" , $ str , $ matches ) ; $ arNum = count ( $ matches [ 0 ] ) ; $ nonArNum = mb_strlen ( str_replace ( ' ' , '' , $ str ) , 'UTF-8' ) - $ arNum ; $ capital = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' ; $ small = 'abcdefgh...
This method will automatically detect the language of content supplied in the input string . It will return the suggestion of correct inserted text . The accuracy of the automatic language detection increases with the amount of text entered .
10,556
final public function prepare ( $ stanza , $ parent = false ) { if ( $ parent === false ) { $ this -> packet -> from = current ( explode ( '/' , ( string ) $ stanza -> attributes ( ) -> from ) ) ; } else { $ this -> packet -> from = current ( explode ( '/' , ( string ) $ parent -> attributes ( ) -> from ) ) ; } }
Prepare the packet
10,557
final public function deliver ( ) { $ action_ns = 'Moxl\Xec\Action' ; if ( get_parent_class ( $ this ) == $ action_ns || get_parent_class ( get_parent_class ( $ this ) ) == $ action_ns ) { $ class = str_replace ( [ $ action_ns , '\\' ] , [ '' , '_' ] , get_class ( $ this ) ) ; $ key = strtolower ( substr ( $ class , 1 ...
Deliver the packet
10,558
final public function event ( $ key , $ packet = null ) { $ wrapper = Wrapper :: getInstance ( ) ; $ wrapper -> iterate ( $ key , $ packet ) ; }
Send an event to Movim
10,559
final public function pack ( $ content , $ from = null ) { $ this -> packet -> content = $ content ; if ( $ from != null ) { $ this -> packet -> from = $ from ; } }
Set the content of the packet
10,560
public function find ( $ graphId ) { $ this -> login ( ) ; return $ this -> httpClient -> get ( 'chart2.php' , [ 'query' => [ 'graphid' => $ graphId , 'width' => $ this -> width , 'height' => $ this -> height , 'stime' => $ this -> startTime -> getTimestamp ( ) , 'period' => $ this -> endTime -> getTimestamp ( ) - $ th...
Request graph from Zabbix and return a raw image . If an error occurred Zabbix will output this as an image .
10,561
function setInstallationType ( $ installationType ) { if ( $ installationType == ( self :: INSTALLATION_TYPE_WINDOW or self :: INSTALLATION_TYPE_DOOR ) ) { $ this -> installationType = $ installationType ; } else { throw new Exception ( sprintf ( "Invalid installationtype. Allowed values: '%s', '%s'" , self :: INSTALLA...
Sets the installation Type
10,562
public function addRoute ( Route $ route , array $ parameterIndexNameMap ) { if ( $ route -> allowsAnyHttpMethod ( ) ) { $ this -> defaultRouteData = MatchedRouteData :: from ( $ parameterIndexNameMap , $ route ) ; } else { $ this -> httpMethodRouteDataMap [ ] = [ $ route -> getHttpMethods ( ) , MatchedRouteData :: fro...
Adds the supplied route to the matched route data map
10,563
public function add ( $ name , $ value ) { if ( is_null ( $ name ) || empty ( $ name ) ) { return $ this ; } $ loweredKey = strtolower ( $ name ) ; $ originalKey = null ; if ( array_key_exists ( $ loweredKey , $ this -> keyMap ) === false ) { $ originalKey = $ name ; $ this -> keyMap [ $ loweredKey ] = $ originalKey ; ...
Add a pair of HTTP header name and value .
10,564
public function get ( $ name ) { if ( is_null ( $ name ) || empty ( $ name ) ) { return null ; } $ loweredKey = strtolower ( $ name ) ; if ( array_key_exists ( $ loweredKey , $ this -> keyMap ) === false ) { return null ; } $ originalKey = $ this -> keyMap [ $ loweredKey ] ; return $ this -> headerMap [ $ originalKey ]...
Get the values of an HTTP header .
10,565
public static function parse ( $ input ) { $ headers = new HttpHeaders ( ) ; if ( is_null ( $ input ) || empty ( $ input ) ) { return $ headers ; } $ lines = preg_split ( '/\R/' , $ input ) ; foreach ( $ lines as $ header ) { $ elements = explode ( ':' , $ header , 2 ) ; if ( count ( $ elements ) === 2 ) { $ name = tri...
Parse HTTP headers and generate an instance of HttpHeaders that represents the HTTP headers .
10,566
public static function cleanXML ( $ xml ) { if ( $ xml != '' ) { $ doc = new \ DOMDocument ( ) ; $ doc -> loadXML ( $ xml ) ; $ doc -> formatOutput = true ; return $ doc -> saveXML ( ) ; } else { return '' ; } }
A simple function which clean and reindent an XML string
10,567
public function setSupportedRevocationAuthMethods ( array $ methods = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$methods' , $ methods , '\Authlete\Types\ClientAuthMethod' ) ; $ this -> supportedRevocationAuthMethods = $ methods ; return $ this ; }
Set client authentication methods at the revocation endpoint supported by this service .
10,568
public function setSupportedScopes ( array $ scopes = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$scopes' , $ scopes , __NAMESPACE__ . '\Scope' ) ; $ this -> supportedScopes = $ scopes ; return $ this ; }
Set the scopes supported by this service .
10,569
public function setSupportedResponseTypes ( array $ responseTypes = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$responseTypes' , $ responseTypes , '\Authlete\Types\ResponseType' ) ; $ this -> supportedResponseTypes = $ responseTypes ; return $ this ; }
Set the response types supported by this service .
10,570
public function setSupportedGrantTypes ( array $ grantTypes = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$grantTypes' , $ grantTypes , '\Authlete\Types\GrantType' ) ; $ this -> supportedGrantTypes = $ grantTypes ; return $ this ; }
Set the grant types supported by this service .
10,571
public function setSupportedTokenAuthMethods ( array $ methods = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$methods' , $ methods , '\Authlete\Types\ClientAuthMethod' ) ; $ this -> supportedTokenAuthMethods = $ methods ; return $ this ; }
Set client authentication methods at the token endpoint supported by this service .
10,572
public function setSupportedDisplays ( array $ displays = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$displays' , $ displays , '\Authlete\Types\Display' ) ; $ this -> supportedDisplays = $ displays ; return $ this ; }
Set the values of the display request parameter supported by this service .
10,573
public function setSupportedClaimTypes ( array $ claimTypes = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$claimTypes' , $ claimTypes , '\Authlete\Types\ClaimType' ) ; $ this -> supportedClaimTypes = $ claimTypes ; return $ this ; }
Set claim types supported by this service .
10,574
public function setSupportedClaims ( array $ claims = null ) { ValidationUtility :: ensureNullOrArrayOfString ( '$claims' , $ claims ) ; $ this -> supportedClaims = $ claims ; return $ this ; }
Set claims supported by this service .
10,575
public function setSupportedClaimLocales ( array $ locales = null ) { ValidationUtility :: ensureNullOrArrayOfString ( '$locales' , $ locales ) ; $ this -> supportedClaimLocales = $ locales ; return $ this ; }
Set language and scripts for claim values supported by this service .
10,576
public function setSupportedUiLocales ( array $ locales = null ) { ValidationUtility :: ensureNullOrArrayOfString ( '$locales' , $ locales ) ; $ this -> supportedUiLocales = $ locales ; return $ this ; }
Set language and scripts for the user interface supported by this service .
10,577
public function setSupportedSnses ( array $ snses = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$snses' , $ snses , '\Authlete\Types\Sns' ) ; $ this -> supportedSnses = $ snses ; return $ this ; }
Set the list of supported SNSes for social login at the direct authorization endpoint .
10,578
public function setSnsCredentials ( array $ credentials = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$credentials' , $ credentials , __NAMESPACE__ . '\SnsCredentials' ) ; $ this -> snsCredentials = $ credentials ; return $ this ; }
Set the list of SNS credentials used for social login .
10,579
public function setSupportedDeveloperSnses ( array $ snses = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$snses' , $ snses , '\Authlete\Types\Sns' ) ; $ this -> supportedDeveloperSnses = $ snses ; return $ this ; }
Set the list of supported SNSes used for social login at the developer console .
10,580
public function setDeveloperSnsCredentials ( array $ credentials = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$credentials' , $ credentials , __NAMESPACE__ . '\SnsCredentials' ) ; $ this -> developerSnsCredentials = $ credentials ; return $ this ; }
Get the list of SNS credentials used for social login at the developer console .
10,581
public function setSupportedServiceProfiles ( array $ serviceProfiles = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$serviceProfiles' , $ serviceProfiles , '\Authlete\Types\ServiceProfile' ) ; $ this -> supportedServiceProfiles = $ serviceProfiles ; return $ this ; }
Set the service profile supported by this service .
10,582
public function setSupportedIntrospectionAuthMethods ( array $ methods = null ) { ValidationUtility :: ensureNullOrArrayOfType ( '$methods' , $ methods , '\Authlete\Types\ClientAuthMethod' ) ; $ this -> supportedIntrospectionAuthMethods = $ methods ; return $ this ; }
Set client authentication methods at the introspection endpoint supported by this service .
10,583
public function setTrustedRootCertificates ( array $ certificates = null ) { ValidationUtility :: ensureNullOrArrayOfString ( '$certificates' , $ certificates ) ; $ this -> trustedRootCertificates = $ certificates ; return $ this ; }
Set trusted root certificates .
10,584
public function clearCompiled ( ) { if ( file_exists ( $ this -> compiledRouterPath ) ) { @ unlink ( $ this -> compiledRouterPath ) ; } $ this -> compiledRouter = null ; }
Clears the compiled router it will be recompiled when next requested .
10,585
private function readConfigFile ( ) { $ configurations = $ this -> config_reader -> get ( 'api' ) ; $ this -> mappers_base_namespace = $ configurations [ 'mappers' ] ; $ this -> limit = $ configurations [ 'limit' ] ; }
get config file values and store them in attributes .
10,586
public function respond ( $ mapper , $ data ) { $ arguments = [ ] ; if ( $ this -> isPaginatorInstance ( $ data ) ) { $ arguments [ 0 ] = $ data -> total ( ) ; $ arguments [ 1 ] = $ data -> currentPage ( ) ; $ arguments [ 2 ] = $ data -> perPage ( ) ; } foreach ( array_slice ( func_get_args ( ) , 2 ) as $ arg ) { $ arg...
Map and respond .
10,587
public function data ( $ mapper , $ data ) { if ( is_array ( $ data ) && empty ( $ data ) || ( ( $ this -> isPaginatorInstance ( $ data ) ) && $ data -> isEmpty ( ) ) || ( $ data instanceof Collection && $ data -> isEmpty ( ) ) ) { return [ ] ; } $ method = 'map' ; if ( is_array ( $ mapper ) && count ( $ mapper ) == 2 ...
Get the formatted data out of the given mapper and data .
10,588
public function content ( $ mapper , $ data ) { $ response = call_user_func_array ( [ $ this , 'respond' ] , func_get_args ( ) ) ; return $ response -> getData ( true ) ; }
Get the content only from the response .
10,589
public function limit ( ) { $ limit = $ this -> getMaximumLimit ( ) ; if ( Input :: get ( 'limit' ) && is_numeric ( Input :: get ( 'limit' ) ) ) { $ limit = Input :: get ( 'limit' ) ; } return $ this -> validateRequestedLimitValue ( $ limit ) ; }
this function will be accessed as facade from anywhere to get the limit number of data for the endpoint call .
10,590
protected function doRollback ( Migrator $ migrator , $ target_group , $ target_version ) { $ installed_migrations = $ migrator -> installedMigrationsByDesc ( ) ; if ( ! isset ( $ installed_migrations [ $ target_group ] ) ) { $ this -> info ( "Nothing migrations for group '$target_group'." ) ; return ; } foreach ( $ in...
Execute rollback .
10,591
public static function export ( $ value ) { if ( is_array ( $ value ) ) { if ( empty ( $ value ) ) { return '[]' ; } elseif ( count ( $ value ) === 1 ) { reset ( $ value ) ; return '[' . self :: export ( key ( $ value ) ) . ' => ' . self :: export ( current ( $ value ) ) . ']' ; } $ code = '[' . PHP_EOL ; $ indent = ' ...
Converts the supplied value into a valid PHP representation .
10,592
public function setClientCertificatePath ( array $ path = null ) { ValidationUtility :: ensureNullOrArrayOfString ( '$path' , $ path ) ; $ this -> clientCertificatePath = $ path ; return $ this ; }
Set the certificate path presented by the client during client authentication .
10,593
public function optimize ( RouteTree $ routeTree ) { $ segmentDepthNodeMap = $ routeTree -> getSegmentDepthNodesMap ( ) ; foreach ( $ segmentDepthNodeMap as $ segmentDepth => $ nodes ) { $ segmentDepthNodeMap [ $ segmentDepth ] = $ this -> optimizeNodes ( $ nodes ) ; } return new RouteTree ( $ routeTree -> getRootRoute...
Optimizes the supplied route tree
10,594
public static function identify ( $ str ) { $ minAr = 55436 ; $ maxAr = 55698 ; $ probAr = false ; $ arFlag = false ; $ arRef = array ( ) ; $ max = strlen ( $ str ) ; $ i = - 1 ; while ( ++ $ i < $ max ) { $ cDec = ord ( $ str [ $ i ] ) ; if ( $ cDec >= 33 && $ cDec <= 58 ) { continue ; } if ( ! $ probAr && ( $ cDec ==...
Identify Arabic text in a given UTF - 8 multi language string
10,595
public static function isArabic ( $ str ) { $ isArabic = false ; $ arr = self :: identify ( $ str ) ; if ( count ( $ arr ) == 1 && $ arr [ 0 ] == 0 ) { $ isArabic = true ; } return $ isArabic ; }
Find out if given string is Arabic text or not
10,596
public static function fromArray ( array $ data ) { $ cookieJar = null ; if ( isset ( $ data [ 'cookies' ] ) ) { $ cookieJar = new CookieJar ( ) ; foreach ( $ data [ 'cookies' ] as $ cookie ) { $ cookieJar -> setCookie ( new SetCookie ( $ cookie ) ) ; } } return new static ( $ data [ 'ptWebQQ' ] , $ data [ 'vfWebQQ' ] ...
Create from a array data .
10,597
public function run ( $ hide = false ) { $ this -> boot ( ) ; $ this -> initNamespace ( ) ; $ this -> initModules ( ) ; $ this -> initServices ( ) ; if ( $ hide === false ) { return $ this -> handle ( ) -> getContent ( ) ; } else { return 'true' ; } }
Running the application
10,598
protected function boot ( ) { $ configLoader = new ConfigLoader ( $ this -> environment ) ; $ this -> di -> setShared ( 'config-loader' , $ configLoader ) ; $ id = Bootstrap :: CONFIG . '_' . $ this -> name . '_' . $ this -> environment ; $ cache = null ; if ( $ this -> cacheable === true ) { $ cache = apc_fetch ( $ id...
Loads the settings option and a list of services for the application
10,599
protected function initNamespace ( ) { $ namespaces = $ this -> config -> get ( 'namespaces' , null ) ; if ( $ namespaces !== null ) { foreach ( $ namespaces as $ namespace => $ path ) { $ this -> loader -> registerNamespaces ( [ $ namespace => $ path ] , true ) ; } $ this -> loader -> register ( ) ; $ this -> di -> se...
Initializing namespace of application