idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
10,300
public function optOutContact ( $ databaseID , $ email , $ columns = array ( ) ) { $ data [ "Envelope" ] = array ( "Body" => array ( "OptOutRecipient" => array ( "LIST_ID" => $ databaseID , "EMAIL" => $ email , "COLUMN" => array ( ) , ) , ) , ) ; $ columns [ 'EMAIL' ] = $ email ; foreach ( $ columns as $ name => $ valu...
Opt out a contact
10,301
public function createQuery ( $ queryName , $ parentListId , $ parentFolderId , $ condition , $ isPrivate = true ) { $ data [ 'Envelope' ] = array ( 'Body' => array ( 'CreateQuery' => array ( 'QUERY_NAME' => $ queryName , 'PARENT_LIST_ID' => $ parentListId , 'PARENT_FOLDER_ID' => $ parentFolderId , 'VISIBILITY' => ( $ ...
Create a new query
10,302
public function sendMailing ( $ emailID , $ mailingID , $ optionalKeys = array ( ) ) { $ data [ "Envelope" ] = array ( "Body" => array ( "SendMailing" => array ( "MailingId" => $ mailingID , "RecipientEmail" => $ emailID , ) , ) , ) ; foreach ( $ optionalKeys as $ key => $ value ) { $ data [ "Envelope" ] [ "Body" ] [ "...
Send a single transactional email
10,303
public function purgeTable ( $ tableName , $ isPrivate = true ) { $ data [ "Envelope" ] = array ( "Body" => array ( "PurgeTable" => array ( "TABLE_NAME" => $ tableName , "TABLE_VISIBILITY" => ( $ isPrivate ? '0' : '1' ) , ) , ) , ) ; $ response = $ this -> _request ( $ data ) ; $ result = $ response [ "Envelope" ] [ "B...
Purge a table
10,304
public function insertUpdateRelationalTable ( $ tableId , $ rows ) { $ processedRows = array ( ) ; $ attribs = array ( ) ; foreach ( $ rows as $ row ) { $ columns = array ( ) ; foreach ( $ row as $ name => $ value ) { $ columns [ 'COLUMN' ] [ ] = $ value ; $ attribs [ 5 ] [ 'COLUMN' ] [ ] = array ( 'name' => $ name ) ;...
This interface inserts or updates relational data
10,305
public function exportList ( $ listId , $ exportType , $ exportFormat , $ exportColumns = array ( ) , $ email = null , $ fileEncoding = null , $ addToStoredFiles = false , $ dateStart = null , $ dateEnd = null , $ useCreatedDate = false , $ includeLeadSource = false , $ listDateFormat = null ) { $ data [ "Envelope" ] =...
Exports contact data from a database query or contact list . Engage exports the results to a CSV file then adds that file to the FTP account associated with the current session .
10,306
public function getJobStatus ( $ jobId ) { $ data [ "Envelope" ] = array ( "Body" => array ( "GetJobStatus" => array ( "JOB_ID" => $ jobId ) , ) , ) ; $ response = $ this -> _request ( $ data ) ; $ result = $ response [ "Envelope" ] [ "Body" ] [ "RESULT" ] ; if ( $ this -> _isSuccess ( $ result ) ) { if ( isset ( $ res...
Get a data job status
10,307
protected function getStatusFromProvider ( $ provider ) { $ service = sprintf ( self :: API_CONNECTION_DDNS_STATUS , $ provider ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ Connection \ DynDns \ Status :: class ) ; }
Get the current DDns status by a given dynamic dns provider
10,308
protected function getConfigFromProvider ( $ provider ) { $ service = sprintf ( self :: API_CONNECTION_DDNS_CONFIG , $ provider ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ Connection \ DynDns \ Config :: class ) ; }
Get the current DDns config by a given dynamic dns provider
10,309
public function start ( $ arguments = null ) { $ this -> checkProperties ( ) ; global $ argv ; $ arguments = $ arguments === null ? $ argv : $ arguments ; try { $ continue = $ this -> processParameters ( $ arguments ) ; if ( ! $ continue ) { return ; } return $ this -> run ( $ arguments ) ; } catch ( Exception $ e ) { ...
Starts the program using either the script arguments or custom ones .
10,310
public function apply_grip_config ( $ config ) { if ( ! is_array ( reset ( $ config ) ) ) { $ config = array ( $ config ) ; } foreach ( $ config as $ entry ) { if ( ! array_key_exists ( 'control_uri' , $ entry ) ) { continue ; } $ pub = new \ PubControl \ PubControlClient ( $ entry [ 'control_uri' ] ) ; if ( array_key_...
a URI or a URI and JWT authentication information .
10,311
public function publish_http_response ( $ channel , $ http_response , $ id = null , $ prev_id = null ) { if ( is_string ( $ http_response ) ) { $ http_response = new HttpResponseFormat ( null , null , null , $ http_response ) ; } $ item = new \ PubControl \ Item ( $ http_response , $ id , $ prev_id ) ; parent :: publis...
have the body field set to the specified string ) .
10,312
public function publish_http_stream ( $ channel , $ http_stream , $ id = null , $ prev_id = null ) { if ( is_string ( $ http_stream ) ) { $ http_stream = new HttpStreamFormat ( $ http_stream ) ; } $ item = new \ PubControl \ Item ( $ http_stream , $ id , $ prev_id ) ; parent :: publish ( $ channel , $ item ) ; }
have the content field set to the specified string ) .
10,313
public static function task ( $ name , $ data = null , \ Closure $ ready = null ) { $ task = self :: getTask ( $ name ) ; if ( ! $ task ) { if ( is_callable ( $ data ) ) { $ ready = $ data ; $ data = null ; } $ task = Task :: create ( $ name , $ data , $ ready ) ; self :: $ tasks [ $ name ] = $ task ; } return $ task ;...
create a task instance .
10,314
public static function hasTask ( $ name ) { if ( ! self :: $ tasks ) { return false ; } if ( isset ( self :: $ tasks [ $ name ] ) ) { return true ; } return false ; }
whether has task .
10,315
public static function destroy ( $ name ) { if ( is_array ( $ name ) ) { foreach ( $ name as $ v ) { self :: destroy ( $ v ) ; } } elseif ( is_string ( $ name ) && self :: hasTask ( $ name ) ) { unset ( self :: $ tasks [ $ name ] ) ; } }
destroy a task .
10,316
public function getLastReturn ( ) { if ( ! $ this -> entries ) { throw new \ LogicException ( 'No entries' ) ; } $ last = end ( $ this -> entries ) ; if ( isset ( $ last [ 'result' ] ) ) { return $ last [ 'result' ] ; } elseif ( isset ( $ last [ 'exception' ] ) ) { return $ last [ 'exception' ] ; } else { throw new \ L...
Get the last received result or exception .
10,317
public function finish ( $ ticket , $ result ) { if ( ! isset ( $ this -> entries [ $ ticket ] ) ) { throw new \ InvalidArgumentException ( 'Invalid history ticket' ) ; } elseif ( isset ( $ this -> entries [ $ ticket ] [ 'result' ] ) || isset ( $ this -> entries [ $ ticket ] [ 'exception' ] ) ) { throw new \ LogicExcep...
Finish adding an entry to the history container .
10,318
public static function getDocKeys ( \ ReflectionMethod $ reflection_method ) { $ doc_comment_string = $ reflection_method -> getDocComment ( ) ; $ keys_as_array = array ( 'url' ) ; if ( preg_match_all ( '/@(\w+)([ \t](.*?))?(?:\n|\r)+/' , $ doc_comment_string , $ matches , PREG_SET_ORDER ) ) { $ keys = array ( ) ; fore...
Get doc keys from a method s docblock documentation
10,319
public function notifier ( $ name , $ default = null ) { return isset ( $ this -> notifiers [ $ name ] ) ? $ this -> notifiers [ $ name ] : $ default ; }
Returns the given notifier .
10,320
public function get ( ) { if ( ! $ this -> filters ) { return $ this -> getAllAlerts ( ) ; } $ filteredAlerts = $ this -> filteredAlerts ; $ this -> filters = [ ] ; $ this -> filteredAlerts = [ ] ; return $ filteredAlerts ; }
Returns the alerts with the applied filters .
10,321
protected function getAllAlerts ( array $ alerts = [ ] ) { foreach ( $ this -> notifiers as $ notifier ) { $ alerts = array_merge_recursive ( $ alerts , $ notifier -> get ( ) ) ; } return $ alerts ; }
Returns all the alerts .
10,322
public function submit ( $ campaingID , $ recipient , $ transactionID = null , $ showAllSendDetail = true , $ sendAsBatch = false ) { $ data [ "XTMAILING" ] = array ( "CAMPAIGN_ID" => $ campaingID , "SHOW_ALL_SEND_DETAIL" => ( $ showAllSendDetail ? "true" : "false" ) , "SEND_AS_BATCH" => ( $ sendAsBatch ? "true" : "fal...
Submit transaction email
10,323
public function getCommand ( $ name , array $ args = [ ] ) { list ( $ region , $ args ) = $ this -> getRegionFromArgs ( $ args ) ; return $ this -> getClientFromPool ( $ region ) -> getCommand ( $ name , $ args ) ; }
Create a command for an operation name .
10,324
public function update ( $ downloadTaskId , $ announceUrl , models \ Download \ Tracker $ Tracker ) { $ service = sprintf ( self :: API_DOWNLOAD_TRACKER_ITEM , $ downloadTaskId , $ announceUrl ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> PUT ( $ Tracker ) ; return $ rest -> getSuccess ( ) ; }
Update a tracker Attempting to call this method on a download other than bittorent will fail
10,325
public static function filterMessages ( $ messages , $ levels = 0 , $ categories = [ ] , $ except = [ ] ) { $ messages = parent :: filterMessages ( $ messages , $ levels , $ categories , $ except ) ; foreach ( $ messages as $ i => $ message ) { $ type = explode ( ':' , $ message [ 2 ] ) ; if ( is_array ( $ type ) && si...
Filter all exceptions . They logged via ErrorHandler
10,326
public function init ( ) { parent :: init ( ) ; $ this -> options [ 'cache' ] = Yii :: getAlias ( $ this -> cachePath ) ; $ haml = new MtHaml \ Environment ( 'twig' , $ this -> options , $ this -> getFilters ( ) ) ; $ fs = new \ Twig_Loader_Filesystem ( [ dirname ( Yii :: $ app -> getView ( ) -> getViewFile ( ) ) , Yii...
Init a parser
10,327
private function getExtension ( $ name ) { if ( class_exists ( 'Twig_Extensions_Extension_' . $ name ) ) { $ name = 'Twig_Extensions_Extension_' . $ name ; } elseif ( class_exists ( 'Twig_Extensions_Extension_' . ucfirst ( strtolower ( $ name ) ) ) ) { $ name = 'Twig_Extensions_Extension_' . ucfirst ( strtolower ( $ na...
Get twig extension
10,328
public function downloadFeedItem ( models \ Download \ Feed \ DownloadFeedItem $ DownloadFeedItem ) { $ service = sprintf ( self :: API_DOWNLOAD_FEEDS_ITEMS_ITEM_DOWNLOAD , $ DownloadFeedItem -> getFeedId ( ) , $ DownloadFeedItem -> getId ( ) ) ; $ rest = $ this -> callService ( 'POST' , $ service , $ DownloadFeedItem ...
Download the specified feed item
10,329
public function getConfigurationFromId ( $ vpnId ) { $ service = sprintf ( self :: API_VPN_SERVER_CONFIG , $ vpnId ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ VPN \ Server \ Config \ ServerConfig :: class ) ; }
Get a VPN config
10,330
public function setConfiguration ( models \ VPN \ Server \ Config \ ServerConfig $ serverConfig ) { $ service = sprintf ( self :: API_VPN_SERVER_CONFIG , $ serverConfig -> getId ( ) ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> PUT ( $ serverConfig ) ; return $ rest -> getResult ( models \ VPN \ Server \ ...
Update the VPN configuration
10,331
public function setCard ( ? array $ data ) : PaymentInstrumentInterface { $ this -> setLast4Digits ( $ data [ 'last_4_digits' ] ) ; $ this -> setCardType ( $ data [ 'type' ] ) ; return $ this ; }
Set PaymentInstrument array
10,332
public function openSession ( ) { $ Login = new services \ login \ Session ( $ this ) ; $ Login -> askLoginStatus ( ) ; $ Login -> createSession ( ) ; $ this -> permissions = $ Login -> getPermissions ( ) ; $ this -> session_token = $ Login -> getSessionToken ( ) ; }
Open a new session and save the session token
10,333
protected function registerAlerts ( ) { $ this -> app -> singleton ( 'alerts' , function ( $ app ) { $ config = $ this -> app [ 'config' ] -> get ( 'cartalyst.alerts' ) ; $ alerts = $ this -> app -> make ( 'Cartalyst\Alerts\Alerts' ) ; $ viewNotifier = new Notifier ( 'view' , $ config [ 'classes' ] ) ; $ flashNotifier ...
Register alerts .
10,334
public function getConfiguration ( ) { $ rest = $ this -> getService ( self :: API_WIFI_CONFIG ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ WiFi \ GlobalConfig :: class ) ; }
Get the global wifi configuration
10,335
public function setConfiguration ( models \ WiFi \ GlobalConfig $ globalConfig ) { $ rest = $ this -> getService ( self :: API_WIFI_CONFIG ) ; $ rest -> PUT ( $ globalConfig ) ; return $ rest -> getResult ( models \ WiFi \ GlobalConfig :: class ) ; }
Update the global wifi configuration
10,336
public function resetConfiguration ( ) { $ rest = $ this -> getService ( self :: API_WIFI_CONFIG_RESET ) ; $ rest -> POST ( ) ; return $ rest -> getSuccess ( ) ; }
Reset Wifi to default configuration
10,337
public function getAll ( ) { $ rest = $ this -> getService ( self :: API_STORAGE_PARTITION ) ; $ rest -> GET ( ) ; return $ rest -> getResultAsArray ( models \ Storage \ DiskPartition :: class ) ; }
Get the list of partitions
10,338
public function getFromId ( $ diskId ) { $ rest = $ this -> getService ( self :: API_STORAGE_PARTITION . $ diskId ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ Storage \ DiskPartition :: class ) ; }
Get a given partition info
10,339
public function manipulate ( $ value , $ row = array ( ) , $ fieldName = '' ) { $ type = $ this -> type ; if ( $ type && is_callable ( array ( $ this , $ type ) ) ) { return $ this -> $ type ( $ value , $ row , $ fieldName ) ; } else { error_log ( 'Invalid Data Manipulator type: "' . $ type . '"' ) ; return $ value . '...
manipulate This is used by the Table class to manipulate the data passed in and returns the formatted data .
10,340
public function getAll ( ) { $ rest = $ this -> getService ( self :: API_VPN_CLIENT_CONFIG ) ; $ rest -> GET ( ) ; return $ rest -> getResultAsArray ( models \ VPN \ Client \ Config \ ClientConfig :: class ) ; }
Get VPN Client configuration list
10,341
public function getConfiguration ( ) { $ rest = $ this -> getService ( self :: API_NETWORK_SHARE_AFP ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ NetworkShare \ AfpConfig :: class ) ; }
Get the current Afp configuration
10,342
public function setConfiguration ( models \ NetworkShare \ AfpConfig $ afpConfig ) { $ rest = $ this -> getService ( self :: API_NETWORK_SHARE_AFP ) ; $ rest -> PUT ( $ afpConfig ) ; return $ rest -> getResult ( models \ NetworkShare \ AfpConfig :: class ) ; }
Update the Afp configuration
10,343
protected function getService ( $ service ) { $ rest = new utils \ rest \ RestAuth ( $ this -> application -> getFreeboxApiHost ( ) . $ service ) ; $ rest -> setSessionToken ( $ this -> application -> getSessionToken ( ) ) ; return $ rest ; }
Return a Rest object with the session token of the application
10,344
public function getAll ( ) { $ rest = $ this -> getService ( self :: API_CALL_LOG ) ; $ rest -> GET ( ) ; return $ rest -> getResultAsArray ( models \ Call \ CallEntry :: class ) ; }
List every calls
10,345
public function getFromId ( $ CallId ) { $ rest = $ this -> getService ( self :: API_CALL_LOG . $ CallId ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ Call \ CallEntry :: class ) ; }
Access a given call entry
10,346
public function deleteFromId ( $ CallId ) { $ rest = $ this -> getService ( self :: API_CALL_LOG . $ CallId ) ; $ rest -> DELETE ( ) ; return $ rest -> getSuccess ( ) ; }
Delete a call entry
10,347
public function update ( models \ Call \ CallEntry $ CallEntry ) { $ rest = $ this -> getService ( self :: API_CALL_LOG . $ CallEntry -> getId ( ) ) ; $ rest -> PUT ( $ CallEntry ) ; return $ rest -> getResult ( models \ Call \ CallEntry :: class ) ; }
Update a given call entry
10,348
public function getPiecesFromId ( $ taskId ) { $ Service = sprintf ( self :: API_DOWNLOAD_PIECES , $ taskId ) ; $ rest = $ this -> callService ( 'GET' , $ Service ) ; return $ rest -> getResult ( ) ; }
Get the pieces status a given download
10,349
public function createAuthorization ( $ dirName , $ FileName ) { $ rest = $ this -> getService ( self :: API_UPLOAD ) ; $ rest -> POST ( [ 'dirname' => base64_encode ( $ dirName ) , 'upload_name' => $ FileName , ] ) ; return ( int ) $ rest -> getResult ( ) [ 'id' ] ; }
Create a file upload authorization
10,350
public function uploadFile ( $ FileUploadTaskId , $ fileToUpload_afi ) { $ Service = sprintf ( self :: API_UPLOAD_SEND , $ FileUploadTaskId ) ; $ rest = $ this -> getService ( $ Service ) ; $ rest -> setContentType_MultipartFormData ( ) ; $ rest -> POST ( [ basename ( $ fileToUpload_afi ) => new \ CurlFile ( $ fileToUp...
Send the content of the FileUpload task
10,351
public function cleanTerminated ( ) { $ rest = $ this -> getService ( self :: API_UPLOAD_CLEAN ) ; $ rest -> DELETE ( ) ; return $ rest -> getSuccess ( ) ; }
Deletes all the FileUpload not in_progress
10,352
public function reboot ( ) { $ rest = $ this -> getService ( self :: API_SYSTEM_REBOOT ) ; $ rest -> POST ( ) ; return $ rest -> getSuccess ( ) ; }
Reboot the Freebox
10,353
public function getStats ( $ db , $ date_start = null , $ date_end = null , $ precision = null , array $ fields = [ ] ) { $ QueryParameters = $ this -> buildQuery ( $ db , $ date_start , $ date_end , $ precision , $ fields ) ; $ rest = $ this -> getService ( self :: API_RDD ) ; $ rest -> GET ( $ QueryParameters ) ; ret...
Return Freebox information & statistics
10,354
public function create ( models \ Call \ ContactUrl $ ContactUrl ) { $ rest = $ this -> getService ( self :: API_URL ) ; $ rest -> POST ( $ ContactUrl ) ; return $ rest -> getResult ( models \ Call \ ContactUrl :: class ) ; }
Add a new contact url
10,355
public function update ( models \ Call \ ContactUrl $ ContactUrl ) { $ rest = $ this -> getService ( self :: API_URL . $ ContactUrl -> getId ( ) ) ; $ rest -> PUT ( $ ContactUrl ) ; return $ rest -> getResult ( models \ Call \ ContactUrl :: class ) ; }
Update a contact url
10,356
protected function initProperty ( $ propertyName , $ propertyClass ) { if ( property_exists ( static :: class , $ propertyName ) && ! empty ( $ this -> $ propertyName ) ) { $ this -> $ propertyName = new $ propertyClass ( $ this -> $ propertyName ) ; } }
Convert a property into a given class
10,357
protected function initPropertyArray ( $ propertyName , $ propertyClass ) { if ( property_exists ( static :: class , $ propertyName ) && is_array ( $ this -> $ propertyName ) ) { $ newProperty = [ ] ; foreach ( $ this -> $ propertyName as $ PropertyItem ) { if ( is_array ( $ PropertyItem ) ) { $ newProperty [ ] = new $...
Convert a property into an array of the given class
10,358
public function toArray ( ) { $ ModelArray = [ ] ; foreach ( get_object_vars ( $ this ) as $ propertyName => $ propertyValue ) { if ( is_subclass_of ( $ propertyValue , Model :: class ) ) { $ ModelArray [ $ propertyName ] = $ propertyValue -> toArray ( ) ; } else { $ ModelArray [ $ propertyName ] = $ propertyValue ; } ...
Return an array representation of the model properties
10,359
private function selectRadioOption ( $ xpath , $ value ) { $ name = $ this -> getAttribute ( $ xpath , 'name' ) ; if ( null !== $ name ) { $ name = json_encode ( $ name ) ; $ function = <<<JS(function(){ for (var i = 0; i < document.forms.length; i++) { if (document.forms[i].elements[{$name}]) { v...
Selects specific radio option .
10,360
public function promise ( ) { return \ GuzzleHttp \ Promise \ coroutine ( function ( ) { $ objectStats = ( yield $ this -> client -> executeAsync ( $ this -> client -> getCommand ( 'HeadObject' , $ this -> source ) ) ) ; if ( $ objectStats [ 'ContentLength' ] > $ this -> options [ 'mup_threshold' ] ) { $ mup = new Mult...
Perform the configured copy asynchronously . Returns a promise that is fulfilled with the result of the CompleteMultipartUpload or CopyObject operation or rejected with an exception .
10,361
public function getConfiguration ( ) { $ rest = $ this -> getService ( self :: API_NETWORK_SHARE_SAMBA ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ NetworkShare \ SambaConfig :: class ) ; }
Get the current Samba configuration
10,362
public function setConfiguration ( models \ NetworkShare \ SambaConfig $ sambaConfig ) { $ rest = $ this -> getService ( self :: API_NETWORK_SHARE_SAMBA ) ; $ rest -> PUT ( $ sambaConfig ) ; return $ rest -> getResult ( models \ NetworkShare \ SambaConfig :: class ) ; }
Update the Samba configuration
10,363
public function getAll ( ) { $ rest = $ this -> getService ( self :: API_NAT_INCOMING ) ; $ rest -> GET ( ) ; return $ rest -> getResultAsArray ( models \ NAT \ IncomingPortConfig :: class ) ; }
Getting the list of incoming ports
10,364
public function getFromId ( $ IncomingPortId ) { $ rest = $ this -> getService ( self :: API_NAT_INCOMING . $ IncomingPortId ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ NAT \ IncomingPortConfig :: class ) ; }
Getting a specific incoming port
10,365
public function update ( models \ NAT \ IncomingPortConfig $ incomingPortConfig ) { $ rest = $ this -> getService ( self :: API_NAT_INCOMING . $ incomingPortConfig -> getId ( ) ) ; $ rest -> PUT ( $ incomingPortConfig ) ; return $ rest -> getResult ( models \ NAT \ IncomingPortConfig :: class ) ; }
Updating an incoming port
10,366
public function getBrowsableInterfaces ( ) { $ rest = $ this -> getService ( self :: API_LAN_BROWSER_INTERFACES ) ; $ rest -> GET ( ) ; return $ rest -> getResultAsArray ( models \ LAN \ LanInterface :: class ) ; }
Get all Lan interfaces
10,367
public function getHostsFromInterfaceName ( $ lanInterfaceId ) { $ service = sprintf ( self :: API_LAN_BROWSER_INTERFACE , $ lanInterfaceId ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> GET ( ) ; return $ rest -> getResultAsArray ( models \ LAN \ LanHost :: class ) ; }
Get the LanHosts of the specified interface name
10,368
public function getHostFromId ( $ lanInterfaceId , $ hostId ) { $ service = sprintf ( self :: API_LAN_BROWSER_HOST , $ lanInterfaceId , $ hostId ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ LAN \ LanHost :: class ) ; }
Get a specific LanHost
10,369
public function updateHostFromInterfaceId ( models \ LAN \ LanHost $ LanHost , $ lanInterfaceId ) { $ service = sprintf ( self :: API_LAN_BROWSER_HOST , $ lanInterfaceId , $ LanHost -> getId ( ) ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> PUT ( $ LanHost ) ; return $ rest -> getResult ( models \ LAN \ L...
Update a LanHost
10,370
public function wakeOnLan ( models \ LAN \ LanInterface $ lanInterface , models \ LAN \ LanHost $ lanHost , $ password = '' ) { $ service = sprintf ( self :: API_WAKE_ON_LAN , $ lanInterface -> getName ( ) ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> PUT ( [ 'mac' => $ lanHost -> getId ( ) , 'password' =...
Send Wake ok Lan packet to an host
10,371
public function create ( models \ Call \ ContactEmail $ ContactEmail ) { $ rest = $ this -> getService ( self :: API_EMAIL ) ; $ rest -> POST ( $ ContactEmail ) ; return $ rest -> getResult ( models \ Call \ ContactEmail :: class ) ; }
Create a new email contact
10,372
public function update ( models \ Call \ ContactEmail $ ContactEmail ) { $ rest = $ this -> getService ( self :: API_EMAIL . $ ContactEmail -> getId ( ) ) ; $ rest -> PUT ( $ ContactEmail ) ; return $ rest -> getResult ( models \ Call \ ContactEmail :: class ) ; }
Update an email contact
10,373
public function getIPv6Configuration ( ) { $ rest = $ this -> getService ( self :: API_CONNECTION_IPV6_CONFIG ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ Connection \ Ipv6 \ Configuration :: class ) ; }
Get the current IPv6 Connection configuration
10,374
public function setIPv6Configuration ( models \ Connection \ Ipv6 \ Configuration $ connectionIpv6Configuration ) { $ rest = $ this -> getService ( self :: API_CONNECTION_IPV6_CONFIG ) ; $ rest -> PUT ( $ connectionIpv6Configuration ) ; return $ rest -> getResult ( models \ Connection \ Ipv6 \ Configuration :: class ) ...
Update the IPv6 Connection configuration
10,375
public static function create_hold ( $ mode , $ channels , $ response , $ timeout = null ) { $ channels = self :: parse_channels ( $ channels ) ; $ ichannels = self :: get_hold_channels ( $ channels ) ; $ hold = array ( ) ; $ hold [ 'mode' ] = $ mode ; $ hold [ 'channels' ] = $ ichannels ; if ( ! is_null ( $ timeout ) ...
either a string representing the response body or a Response instance .
10,376
public static function parse_grip_uri ( $ uri ) { $ uri = parse_url ( $ uri ) ; $ params = array ( ) ; if ( array_key_exists ( 'query' , $ uri ) ) { parse_str ( $ uri [ 'query' ] , $ params ) ; } $ iss = null ; $ key = null ; if ( array_key_exists ( 'iss' , $ params ) ) { $ iss = $ params [ 'iss' ] ; unset ( $ params [...
encoded format .
10,377
public static function validate_sig ( $ token , $ key ) { try { \ Firebase \ JWT \ JWT :: decode ( $ token , $ key , array ( 'HS256' , 'HS384' , 'HS512' , 'RS256' ) ) ; return true ; } catch ( \ Exception $ e ) { return false ; } }
Note that the token expiration is also verified .
10,378
public static function create_grip_channel_header ( $ channels ) { $ channels = self :: parse_channels ( $ channels ) ; $ parts = array ( ) ; foreach ( $ channels as $ channel ) { $ s = $ channel -> name ; if ( ! is_null ( $ channel -> prev_id ) ) { $ s .= "; prev-id={$channel->prev_id}" ; } $ parts [ ] = $ s ; } retur...
HTTP headers .
10,379
public static function create_hold_response ( $ channels , $ response = null , $ timeout = null ) { return self :: create_hold ( 'response' , $ channels , $ response , $ timeout ) ; }
create_hold method with response as the hold mode .
10,380
public static function decode_websocket_events ( $ body ) { $ out = array ( ) ; $ start = 0 ; while ( $ start < strlen ( $ body ) ) { $ at = strpos ( $ body , "\r\n" , $ start ) ; if ( $ at === false ) { throw new \ RuntimeException ( 'bad format' ) ; } $ typeline = substr ( $ body , $ start , $ at - $ start ) ; $ star...
is raised if the format is invalid .
10,381
public static function encode_websocket_events ( $ events ) { $ out = '' ; foreach ( $ events as $ event ) { if ( ! is_null ( $ event -> content ) ) { $ content_length = dechex ( strlen ( $ event -> content ) ) ; $ out .= "{$event->type} {$content_length}\r\n" . "{$event->content}\r\n" ; } else { $ out .= "{$event->typ...
when using the WebSocket - over - HTTP protocol .
10,382
protected static function parse_channels ( $ channels ) { if ( $ channels instanceof Channel ) { $ channels = array ( $ channels ) ; } elseif ( is_string ( $ channels ) ) { $ channels = array ( new Channel ( $ channels ) ) ; } if ( count ( $ channels ) == 0 ) { throw new \ RuntimeException ( 'channels length is 0' ) ; ...
Channel instance or an array of Channel instances .
10,383
protected static function get_hold_channels ( $ channels ) { $ ichannels = array ( ) ; foreach ( $ channels as $ channel ) { if ( is_string ( $ channel ) ) { $ channel = new Channel ( $ channel ) ; } $ ichannel = array ( ) ; $ ichannel [ 'name' ] = $ channel -> name ; if ( ! is_null ( $ channel -> prev_id ) ) { $ ichan...
GRIP proxy hold instructions .
10,384
protected static function get_hold_response ( $ response ) { $ iresponse = null ; if ( ! is_null ( $ response ) ) { if ( is_string ( $ response ) ) { $ response = new Response ( null , null , null , $ response ) ; } $ iresponse = array ( ) ; if ( ! is_null ( $ response -> code ) ) { $ iresponse [ 'code' ] = $ response ...
proxy hold instructions .
10,385
public function getFromFilterId ( $ filterId ) { $ service = sprintf ( self :: API_PARENTAL_FILTER_PLANNING , $ filterId ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ ParentalControl \ FilterPlanning :: class ) ; }
Get the filer planning associated with the given filter id
10,386
public function setFromFilterId ( models \ ParentalControl \ FilterPlanning $ filterPlanning , $ filterId ) { $ service = sprintf ( self :: API_PARENTAL_FILTER_PLANNING , $ filterId ) ; $ rest = $ this -> getService ( $ service ) ; $ rest -> PUT ( $ filterPlanning ) ; return $ rest -> getResult ( models \ ParentalContr...
Update the filer planning associated with the given filter id
10,387
public static function create ( Task $ task , $ name , $ weight = 1 , $ backup = false , \ Closure $ work = null ) { return new self ( $ task , $ name , $ weight , $ backup , $ work ) ; }
create a driver instance .
10,388
public function run ( ) { if ( ! $ this -> beforeRun ( ) ) { return ; } $ result = null ; if ( is_callable ( $ this -> work ) ) { $ result = call_user_func_array ( $ this -> work , [ $ this , $ this -> getData ( ) ] ) ; } return $ this -> afterRun ( $ result ) ; }
run driver s work .
10,389
public function backup ( $ is = true ) { $ is = ( bool ) $ is ; if ( $ this -> backup === $ is ) { return $ this ; } $ this -> backup = $ is ; if ( $ this -> backup ) { $ this -> task -> appendToBackupDrivers ( $ this ) ; } else { $ this -> task -> removeFromBackupDrivers ( $ this ) ; } return $ this ; }
set current driver to be a backup driver .
10,390
public function reset ( ) { $ args = func_get_args ( ) ; extract ( self :: parseArgs ( $ args ) ) ; if ( $ this -> weight !== $ weight ) { $ this -> weight ( $ weight ) ; } if ( $ this -> backup !== $ backup ) { $ this -> backup ( $ backup ) ; } if ( is_callable ( $ work ) && $ this -> work !== $ work ) { $ this -> wor...
reset driver s properties .
10,391
public static function parseArgs ( array $ args ) { $ result = [ 'name' => null , 'work' => null , 'weight' => 1 , 'backup' => false , ] ; foreach ( $ args as $ arg ) { if ( is_callable ( $ arg ) ) { $ result [ 'work' ] = $ arg ; } if ( is_string ( $ arg ) || is_numeric ( $ arg ) ) { $ arg = preg_replace ( '/\s+/' , ' ...
parse arguments to driver properties .
10,392
public static function sortByPriority ( $ accept ) { if ( $ accept == '' ) { return array ( ) ; } $ tmp_accept_list = array ( ) ; $ accepts = explode ( ',' , strtolower ( $ accept ) ) ; foreach ( $ accepts as $ pos => $ accept ) { $ parts = explode ( ';q=' , trim ( $ accept ) ) ; $ type = $ parts [ 0 ] ; $ quality = is...
Pass any content negotiation header such as Accept Accept - Language to break it up and sort the resulting array by the order of negotiation .
10,393
public static function objectToArray ( $ data ) { if ( is_object ( $ data ) ) { $ data = get_object_vars ( $ data ) ; } if ( is_array ( $ data ) ) { $ self_name = 'self::' . __FUNCTION__ ; return array_map ( $ self_name , $ data ) ; } else { return $ data ; } }
Converts an object into an array
10,394
public static function arrayToObject ( $ data ) { if ( is_array ( $ data ) ) { $ self_name = 'self::' . __FUNCTION__ ; return ( object ) array_map ( $ self_name , $ data ) ; } else { return $ data ; } }
Converts an array into an object
10,395
public static function arrayToXml ( array $ data ) { $ xml = '' ; foreach ( $ data as $ key => $ value ) { $ tag = ( is_numeric ( $ key ) ) ? 'item' : $ key ; $ xml = ( ! empty ( $ xml ) ) ? $ xml : '' ; if ( is_array ( $ value ) ) { $ xml .= "<$tag index=\"" . $ key . "\">" . self :: arrayToXml ( $ value ) . "</$tag>"...
Auxiliary method to help converting a PHP array into a XML representation .
10,396
public static function reflectionClassFromObjectOrClass ( $ object_or_class ) { $ reflection = null ; if ( is_object ( $ object_or_class ) ) { $ reflection = new ReflectionObject ( $ object_or_class ) ; } elseif ( class_exists ( $ object_or_class ) ) { $ reflection = new ReflectionClass ( $ object_or_class ) ; } return...
Returns a ReflectionClass object from a living instance or a class name
10,397
public static function fromIterator ( AwsClientInterface $ client , $ bucket , \ Iterator $ iter , array $ options = [ ] ) { $ fn = function ( BatchDelete $ that ) use ( $ iter ) { return \ GuzzleHttp \ Promise \ coroutine ( function ( ) use ( $ that , $ iter ) { foreach ( $ iter as $ obj ) { if ( $ promise = $ that ->...
Creates a BatchDelete object from an iterator that yields results .
10,398
public function getSignature ( $ resource = null , $ expires = null , $ policy = null ) { $ signatureHash = [ ] ; if ( $ policy ) { $ policy = preg_replace ( '/\s/s' , '' , $ policy ) ; $ signatureHash [ 'Policy' ] = $ this -> encode ( $ policy ) ; } elseif ( $ resource && $ expires ) { $ policy = $ this -> createCanne...
Create the values used to construct signed URLs and cookies .
10,399
public function getConfiguration ( ) { $ rest = $ this -> getService ( self :: API_FTP_CONFIG ) ; $ rest -> GET ( ) ; return $ rest -> getResult ( models \ FtpConfig :: class ) ; }
Get the current FTP configuration