idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
56,600 | private function getGroupControllerNamespace ( ) : string { $ controllerNamespace = '' ; foreach ( $ this -> groupOptionsStack as $ groupOptions ) { if ( isset ( $ groupOptions [ 'controllerNamespace' ] ) ) { if ( mb_substr ( $ groupOptions [ 'controllerNamespace' ] , - 1 ) !== '\\' ) { $ groupOptions [ 'controllerName... | Gets the controller namespace from the current group stack |
56,601 | private function getGroupHost ( ) : string { $ host = '' ; foreach ( $ this -> groupOptionsStack as $ groupOptions ) { if ( isset ( $ groupOptions [ 'host' ] ) ) { $ host = $ groupOptions [ 'host' ] . $ host ; } } return $ host ; } | Gets the host from the current group stack |
56,602 | private function getGroupMiddleware ( ) : array { $ middleware = [ ] ; foreach ( $ this -> groupOptionsStack as $ groupOptions ) { if ( isset ( $ groupOptions [ 'middleware' ] ) ) { if ( ! is_array ( $ groupOptions [ 'middleware' ] ) ) { $ groupOptions [ 'middleware' ] = [ $ groupOptions [ 'middleware' ] ] ; } $ middle... | Gets the middleware in the current group stack |
56,603 | private function getGroupPath ( ) : string { $ path = '' ; foreach ( $ this -> groupOptionsStack as $ groupOptions ) { if ( isset ( $ groupOptions [ 'path' ] ) ) { $ path .= $ groupOptions [ 'path' ] ; } } return $ path ; } | Gets the path of the current group stack |
56,604 | private function getVarRegexes ( ) : array { $ variableRegexes = [ ] ; foreach ( $ this -> groupOptionsStack as $ groupOptions ) { if ( isset ( $ groupOptions [ 'vars' ] ) ) { $ variableRegexes = array_merge ( $ variableRegexes , $ groupOptions [ 'vars' ] ) ; } } return $ variableRegexes ; } | Gets the variable regexes from the current group stack |
56,605 | private function groupIsSecure ( ) : bool { foreach ( $ this -> groupOptionsStack as $ groupOptions ) { if ( isset ( $ groupOptions [ 'https' ] ) && $ groupOptions [ 'https' ] ) { return true ; } } return false ; } | Gets whether or not the current group stack is secure If ANY of the groups were marked as HTTPS then this will return true even if a sub - group is not marked HTTPS |
56,606 | public function crop ( $ cropTop , $ cropBottom = 0 , $ cropLeft = 0 , $ cropRight = 0 ) { $ this -> resize ( $ this -> getWidth ( ) , $ this -> getHeight ( ) , $ cropTop , $ cropBottom , $ cropLeft , $ cropRight ) ; } | Crop the frame . |
56,607 | public function serialize ( ) { $ data = [ $ this -> gdImageData , $ this -> pts , $ this -> width , $ this -> height , ] ; return serialize ( $ data ) ; } | Return string representation of a Frame . |
56,608 | public function unserialize ( $ serialized ) { list ( $ this -> gdImageData , $ this -> pts , $ this -> width , $ this -> height ) = unserialize ( $ serialized ) ; } | Constructs the Frame from serialized data . |
56,609 | public function addFrame ( Frame $ frame ) { $ tmpFrame = clone $ frame ; $ tmpFrame -> resize ( $ this -> width , $ this -> height ) ; ob_start ( ) ; imagegif ( $ tmpFrame -> toGDImage ( ) ) ; $ this -> frames [ ] = ob_get_clean ( ) ; $ tmpFrame = null ; } | Add a frame to the end of the animated gif . |
56,610 | protected function addGifHeader ( ) { if ( ord ( $ this -> frames [ 0 ] { 10 } ) & 0x80 ) { $ cMap = 3 * ( 2 << ( ord ( $ this -> frames [ 0 ] { 10 } ) & 0x07 ) ) ; $ this -> gifData = 'GIF89a' ; $ this -> gifData .= substr ( $ this -> frames [ 0 ] , 6 , 7 ) ; $ this -> gifData .= substr ( $ this -> frames [ 0 ] , 13 ,... | Adding header to the animation . |
56,611 | protected function gifBlockCompare ( $ globalBlock , $ localBlock , $ len ) { for ( $ i = 0 ; $ i < $ len ; $ i ++ ) { if ( $ globalBlock { 3 * $ i + 0 } !== $ localBlock { 3 * $ i + 0 } || $ globalBlock { 3 * $ i + 1 } !== $ localBlock { 3 * $ i + 1 } || $ globalBlock { 3 * $ i + 2 } !== $ localBlock { 3 * $ i + 2 } )... | Gif compare block . |
56,612 | public function save ( ) { if ( 0 === count ( $ this -> frames ) ) { return false ; } return ( boolean ) file_put_contents ( $ this -> outFilePath , $ this -> getAnimation ( ) , LOCK_EX ) ; } | Saving animated gif to remote file . |
56,613 | public function getAnimation ( ) { if ( 0 === count ( $ this -> frames ) ) { return false ; } $ this -> addGifHeader ( ) ; for ( $ i = 0 , $ frameCount = count ( $ this -> frames ) ; $ i < $ frameCount ; $ i ++ ) { $ this -> addFrameData ( $ i , 1 / $ this -> frameRate * 100 ) ; } $ this -> addGifFooter ( ) ; return $ ... | Getting animation binary data . |
56,614 | public function serialize ( ) { return serialize ( [ $ this -> outFilePath , $ this -> width , $ this -> height , $ this -> frameRate , $ this -> loopCount , $ this -> gifData , $ this -> frames , $ this -> counter , ] ) ; } | String representation of an AnimatedGif . |
56,615 | public function unserialize ( $ serialized ) { list ( $ this -> outFilePath , $ this -> width , $ this -> height , $ this -> frameRate , $ this -> loopCount , $ this -> gifData , $ this -> frames , $ this -> counter ) = unserialize ( $ serialized ) ; } | Constructs the AnimatedGif . |
56,616 | public function getOutput ( ) { if ( true === $ this -> persistent && array_key_exists ( get_class ( $ this ) . $ this -> binary . $ this -> movieFile , self :: $ persistentBuffer ) ) { return self :: $ persistentBuffer [ get_class ( $ this ) . $ this -> binary . $ this -> movieFile ] ; } if ( ! file_exists ( $ this ->... | Getting parsable output from ffprobe binary . |
56,617 | public function setProvider ( OutputProvider $ outputProvider ) { $ this -> provider = $ outputProvider ; $ this -> provider -> setMovieFile ( $ this -> movieFile ) ; $ this -> output = $ this -> provider -> getOutput ( ) ; return $ this ; } | Setting output provider implementation . |
56,618 | public function getDuration ( ) { if ( $ this -> duration === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_DURATION , $ this -> output , $ match ) ; if ( array_key_exists ( 1 , $ match ) && array_key_exists ( 2 , $ match ) && array_key_exists ( 3 , $ match ) ) { $ hours = ( int ) $ match [ 1 ] ; $ minutes = ( ... | Return the duration of a movie or audio file in seconds . |
56,619 | public function getFrameCount ( ) { if ( $ this -> frameCount === null ) { $ this -> frameCount = ( int ) ( $ this -> getDuration ( ) * $ this -> getFrameRate ( ) ) ; } return $ this -> frameCount ; } | Return the number of frames in a movie or audio file . |
56,620 | public function getFrameRate ( ) { if ( $ this -> frameRate === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_FRAME_RATE , $ this -> output , $ match ) ; $ this -> frameRate = ( float ) ( array_key_exists ( 1 , $ match ) ? $ match [ 1 ] : 0.0 ) ; } return $ this -> frameRate ; } | Return the frame rate of a movie in fps . |
56,621 | public function getComment ( ) { if ( $ this -> comment === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_COMMENT , $ this -> output , $ match ) ; $ this -> comment = array_key_exists ( 2 , $ match ) ? trim ( $ match [ 2 ] ) : '' ; } return $ this -> comment ; } | Return the comment field from the movie or audio file . |
56,622 | public function getTitle ( ) { if ( $ this -> title === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_TITLE , $ this -> output , $ match ) ; $ this -> title = array_key_exists ( 2 , $ match ) ? trim ( $ match [ 2 ] ) : '' ; } return $ this -> title ; } | Return the title field from the movie or audio file . |
56,623 | public function getCopyright ( ) { if ( $ this -> copyright === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_COPYRIGHT , $ this -> output , $ match ) ; $ this -> copyright = array_key_exists ( 2 , $ match ) ? trim ( $ match [ 2 ] ) : '' ; } return $ this -> copyright ; } | Return the copyright field from the movie or audio file . |
56,624 | public function getGenre ( ) { if ( $ this -> genre === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_GENRE , $ this -> output , $ match ) ; $ this -> genre = array_key_exists ( 2 , $ match ) ? trim ( $ match [ 2 ] ) : '' ; } return $ this -> genre ; } | Return the genre ID3 field from an mp3 file . |
56,625 | public function getTrackNumber ( ) { if ( $ this -> trackNumber === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_TRACK_NUMBER , $ this -> output , $ match ) ; $ this -> trackNumber = ( int ) ( array_key_exists ( 2 , $ match ) ? $ match [ 2 ] : 0 ) ; } return $ this -> trackNumber ; } | Return the track ID3 field from an mp3 file . |
56,626 | public function getYear ( ) { if ( $ this -> year === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_YEAR , $ this -> output , $ match ) ; $ this -> year = ( int ) ( array_key_exists ( 2 , $ match ) ? $ match [ 2 ] : 0 ) ; } return $ this -> year ; } | Return the year ID3 field from an mp3 file . |
56,627 | public function getFrameHeight ( ) { if ( null === $ this -> frameHeight ) { $ match = [ ] ; preg_match ( self :: $ REGEX_FRAME_WH , $ this -> output , $ match ) ; if ( array_key_exists ( 1 , $ match ) && array_key_exists ( 2 , $ match ) ) { $ this -> frameWidth = ( int ) $ match [ 1 ] ; $ this -> frameHeight = ( int )... | Return the height of the movie in pixels . |
56,628 | public function getPixelFormat ( ) { if ( $ this -> pixelFormat === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_PIXEL_FORMAT , $ this -> output , $ match ) ; $ this -> pixelFormat = array_key_exists ( 1 , $ match ) ? trim ( $ match [ 1 ] ) : '' ; } return $ this -> pixelFormat ; } | Return the pixel format of the movie . |
56,629 | public function getPixelAspectRatio ( ) { if ( $ this -> pixelAspectRatio === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_PIXEL_ASPECT_RATIO , $ this -> output , $ match ) ; $ this -> pixelAspectRatio = ( array_key_exists ( 1 , $ match ) && array_key_exists ( 2 , $ match ) ) ? ( $ match [ 1 ] / $ match [ 2 ] ... | Return the pixel aspect ratio of the movie . |
56,630 | public function getRotation ( ) { if ( $ this -> rotation === null ) { $ match = array ( ) ; preg_match ( self :: $ REGEX_ROTATION , $ this -> output , $ match ) ; $ this -> rotation = ( array_key_exists ( 1 , $ match ) ) ? intval ( trim ( $ match [ 1 ] ) ) : 0 ; } return $ this -> rotation ; } | Return the rotation angle of the movie . |
56,631 | public function getBitRate ( ) { if ( $ this -> bitRate === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_BITRATE , $ this -> output , $ match ) ; $ this -> bitRate = ( int ) ( array_key_exists ( 1 , $ match ) ? ( $ match [ 1 ] * 1000 ) : 0 ) ; } return $ this -> bitRate ; } | Return the bit rate of the movie or audio file in bits per second . |
56,632 | public function getVideoBitRate ( ) { if ( $ this -> videoBitRate === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_VIDEO_BITRATE , $ this -> output , $ match ) ; $ this -> videoBitRate = ( int ) ( array_key_exists ( 1 , $ match ) ? ( $ match [ 1 ] * 1000 ) : 0 ) ; } return $ this -> videoBitRate ; } | Return the bit rate of the video in bits per second . |
56,633 | public function getAudioBitRate ( ) { if ( $ this -> audioBitRate === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_AUDIO_BITRATE , $ this -> output , $ match ) ; $ this -> audioBitRate = ( int ) ( array_key_exists ( 1 , $ match ) ? ( $ match [ 1 ] * 1000 ) : 0 ) ; } return $ this -> audioBitRate ; } | Return the audio bit rate of the media file in bits per second . |
56,634 | public function getAudioSampleRate ( ) { if ( $ this -> audioSampleRate === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_AUDIO_SAMPLE_RATE , $ this -> output , $ match ) ; $ this -> audioSampleRate = ( int ) ( array_key_exists ( 1 , $ match ) ? $ match [ 1 ] : 0 ) ; } return $ this -> audioSampleRate ; } | Return the audio sample rate of the media file in bits per second . |
56,635 | public function getVideoCodec ( ) { if ( $ this -> videoCodec === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_VIDEO_CODEC , $ this -> output , $ match ) ; $ this -> videoCodec = array_key_exists ( 1 , $ match ) ? trim ( $ match [ 1 ] ) : '' ; } return $ this -> videoCodec ; } | Return the name of the video codec used to encode this movie . |
56,636 | public function getAudioCodec ( ) { if ( $ this -> audioCodec === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_AUDIO_CODEC , $ this -> output , $ match ) ; $ this -> audioCodec = array_key_exists ( 1 , $ match ) ? trim ( $ match [ 1 ] ) : '' ; } return $ this -> audioCodec ; } | Return the name of the audio codec used to encode this movie . |
56,637 | public function getAudioChannels ( ) { if ( $ this -> audioChannels === null ) { $ match = [ ] ; preg_match ( self :: $ REGEX_AUDIO_CHANNELS , $ this -> output , $ match ) ; if ( array_key_exists ( 1 , $ match ) ) { switch ( trim ( $ match [ 1 ] ) ) { case 'mono' : $ this -> audioChannels = 1 ; break ; case 'stereo' : ... | Return the number of audio channels in this movie . |
56,638 | public function getFrame ( $ frameNumber = null , $ width = null , $ height = null , $ quality = null ) { $ framePos = ( $ frameNumber === null ) ? $ this -> frameNumber : ( ( ( int ) $ frameNumber ) - 1 ) ; if ( ! is_numeric ( $ framePos ) || $ framePos < 0 || $ framePos > $ this -> getFrameCount ( ) ) { return false ... | Returns a frame from the movie as an Frame object . Returns false if the frame was not found . |
56,639 | public function getFrameAtTime ( $ seconds = null , $ width = null , $ height = null , $ quality = null , $ frameFilePath = null , & $ output = null ) { $ frameTime = ( $ seconds === null ) ? 0 : $ seconds ; if ( ! is_numeric ( $ frameTime ) || $ frameTime < 0 || $ frameTime > $ this -> getDuration ( ) ) { throw new \ ... | Returns a frame from the movie as a Frame object . Returns false if the frame was not found . |
56,640 | public function serialize ( ) { $ data = serialize ( [ $ this -> ffmpegBinary , $ this -> movieFile , $ this -> output , $ this -> frameNumber , $ this -> provider , ] ) ; return $ data ; } | String representation of a Movie . |
56,641 | public function unserialize ( $ serialized ) { list ( $ this -> ffmpegBinary , $ this -> movieFile , $ this -> output , $ this -> frameNumber , $ this -> provider ) = unserialize ( $ serialized ) ; } | Constructs the Movie from serialized data . |
56,642 | public function getOutput ( ) { $ bufferKey = get_class ( $ this ) . $ this -> binary . $ this -> movieFile ; if ( true === $ this -> persistent && array_key_exists ( $ bufferKey , self :: $ persistentBuffer ) ) { return self :: $ persistentBuffer [ $ bufferKey ] ; } return $ this -> output ; } | Getting parsable output from ffmpeg binary . |
56,643 | public function setOutput ( $ output ) { $ this -> output = $ output ; if ( true === $ this -> persistent ) { self :: $ persistentBuffer [ get_class ( $ this ) . $ this -> binary . $ this -> movieFile ] = $ output ; } } | Setting parsable output . |
56,644 | public function getVariablesInBlock ( array $ variables ) { $ blockVariableNames = array_map ( function ( Variable $ variable ) { return $ variable -> getName ( ) ; } , $ this -> variables ) ; return array_filter ( $ variables , function ( Variable $ variable ) use ( $ blockVariableNames ) { return in_array ( $ variabl... | Return only the variables that are in the block . |
56,645 | private function getToken ( ) { $ data = array ( 'grant_type' => 'client_credentials' , 'client_id' => $ this -> userId , 'client_secret' => $ this -> secret , ) ; $ requestResult = $ this -> sendRequest ( 'oauth/access_token' , 'POST' , $ data , false ) ; if ( $ requestResult -> http_code !== 200 ) { return false ; } ... | Get token and store it |
56,646 | protected function sendRequest ( $ path , $ method = 'GET' , $ data = array ( ) , $ useToken = true ) { $ url = $ this -> apiUrl . '/' . $ path ; $ method = strtoupper ( $ method ) ; $ curl = curl_init ( ) ; if ( $ useToken && ! empty ( $ this -> token ) ) { $ headers = array ( 'Authorization: Bearer ' . $ this -> toke... | Form and send request to API service |
56,647 | public function createAddressBook ( $ bookName ) { if ( empty ( $ bookName ) ) { return $ this -> handleError ( 'Empty book name' ) ; } $ data = array ( 'bookName' => $ bookName ) ; $ requestResult = $ this -> sendRequest ( 'addressbooks' , 'POST' , $ data ) ; return $ this -> handleResult ( $ requestResult ) ; } | Create address book |
56,648 | public function editAddressBook ( $ id , $ newName ) { if ( empty ( $ newName ) || empty ( $ id ) ) { return $ this -> handleError ( 'Empty new name or book id' ) ; } $ data = array ( 'name' => $ newName ) ; $ requestResult = $ this -> sendRequest ( 'addressbooks/' . $ id , 'PUT' , $ data ) ; return $ this -> handleRes... | Edit address book name |
56,649 | public function removeAddressBook ( $ id ) { if ( empty ( $ id ) ) { return $ this -> handleError ( 'Empty book id' ) ; } $ requestResult = $ this -> sendRequest ( 'addressbooks/' . $ id , 'DELETE' ) ; return $ this -> handleResult ( $ requestResult ) ; } | Remove address book |
56,650 | public function getBookInfo ( $ id ) { if ( empty ( $ id ) ) { return $ this -> handleError ( 'Empty book id' ) ; } $ requestResult = $ this -> sendRequest ( 'addressbooks/' . $ id ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get information about book |
56,651 | public function getBookVariables ( $ id ) { if ( empty ( $ id ) ) { return $ this -> handleError ( 'Empty book id' ) ; } $ requestResult = $ this -> sendRequest ( 'addressbooks/' . $ id . '/variables' ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get variables from book |
56,652 | public function getEmailsFromBook ( $ id , $ limit = null , $ offset = null ) { if ( empty ( $ id ) ) { return $ this -> handleError ( 'Empty book id' ) ; } $ data = array ( ) ; if ( null !== $ limit ) { $ data [ 'limit' ] = $ limit ; } if ( null !== $ offset ) { $ data [ 'offset' ] = $ offset ; } $ requestResult = $ t... | List email addresses from book |
56,653 | public function addEmails ( $ bookID , $ emails , $ additionalParams = [ ] ) { if ( empty ( $ bookID ) || empty ( $ emails ) ) { return $ this -> handleError ( 'Empty book id or emails' ) ; } $ data = array ( 'emails' => json_encode ( $ emails ) , ) ; if ( $ additionalParams ) { $ data = array_merge ( $ data , $ additi... | Add new emails to address book |
56,654 | public function getEmailInfo ( $ bookID , $ email ) { if ( empty ( $ bookID ) || empty ( $ email ) ) { return $ this -> handleError ( 'Empty book id or email' ) ; } $ requestResult = $ this -> sendRequest ( 'addressbooks/' . $ bookID . '/emails/' . $ email ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get information about email address from book |
56,655 | public function campaignCost ( $ bookID ) { if ( empty ( $ bookID ) ) { return $ this -> handleError ( 'Empty book id' ) ; } $ requestResult = $ this -> sendRequest ( 'addressbooks/' . $ bookID . '/cost' ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get cost of campaign based on address book |
56,656 | public function listCampaigns ( $ limit = null , $ offset = null ) { $ data = array ( ) ; if ( ! empty ( $ limit ) ) { $ data [ 'limit' ] = $ limit ; } if ( ! empty ( $ offset ) ) { $ data [ 'offset' ] = $ offset ; } $ requestResult = $ this -> sendRequest ( 'campaigns' , 'GET' , $ data ) ; return $ this -> handleResul... | Get list of campaigns |
56,657 | public function getCampaignInfo ( $ id ) { if ( empty ( $ id ) ) { return $ this -> handleError ( 'Empty campaign id' ) ; } $ requestResult = $ this -> sendRequest ( 'campaigns/' . $ id ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get information about campaign |
56,658 | public function campaignStatByCountries ( $ id ) { if ( empty ( $ id ) ) { return $ this -> handleError ( 'Empty campaign id' ) ; } $ requestResult = $ this -> sendRequest ( 'campaigns/' . $ id . '/countries' ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get campaign statistic by countries |
56,659 | public function campaignStatByReferrals ( $ id ) { if ( empty ( $ id ) ) { return $ this -> handleError ( 'Empty campaign id' ) ; } $ requestResult = $ this -> sendRequest ( 'campaigns/' . $ id . '/referrals' ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get campaign statistic by referrals |
56,660 | public function createCampaign ( $ senderName , $ senderEmail , $ subject , $ bodyOrTemplateId , $ bookId , $ name = '' , $ attachments = '' , $ type = '' , $ useTemplateId = false ) { if ( empty ( $ senderName ) || empty ( $ senderEmail ) || empty ( $ subject ) || empty ( $ bodyOrTemplateId ) || empty ( $ bookId ) ) {... | Create new campaign |
56,661 | public function getSenderActivationMail ( $ email ) { if ( empty ( $ email ) ) { return $ this -> handleError ( 'Empty email' ) ; } $ requestResult = $ this -> sendRequest ( 'senders/' . $ email . '/code' ) ; return $ this -> handleResult ( $ requestResult ) ; } | Request mail with activation code |
56,662 | public function getEmailGlobalInfo ( $ email ) { if ( empty ( $ email ) ) { return $ this -> handleError ( 'Empty email' ) ; } $ requestResult = $ this -> sendRequest ( 'emails/' . $ email ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get global information about email |
56,663 | public function getEmailsGlobalInfo ( $ emails ) { if ( empty ( $ emails ) ) { return $ this -> handleError ( 'Empty emails list' ) ; } $ requestResult = $ this -> sendRequest ( 'emails' , 'POST' , $ emails ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get global information about list of emails |
56,664 | public function removeEmailFromAllBooks ( $ email ) { if ( empty ( $ email ) ) { return $ this -> handleError ( 'Empty email' ) ; } $ requestResult = $ this -> sendRequest ( 'emails/' . $ email , 'DELETE' ) ; return $ this -> handleResult ( $ requestResult ) ; } | Remove email from all books |
56,665 | public function emailStatByCampaigns ( $ email ) { if ( empty ( $ email ) ) { return $ this -> handleError ( 'Empty email' ) ; } $ requestResult = $ this -> sendRequest ( 'emails/' . $ email . '/campaigns' ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get email statistic by all campaigns |
56,666 | public function addToBlackList ( $ emails , $ comment = '' ) { if ( empty ( $ emails ) ) { return $ this -> handleError ( 'Empty email' ) ; } $ data = array ( 'emails' => base64_encode ( $ emails ) , 'comment' => $ comment , ) ; $ requestResult = $ this -> sendRequest ( 'blacklist' , 'POST' , $ data ) ; return $ this -... | Add email to blacklist |
56,667 | public function removeFromBlackList ( $ emails ) { if ( empty ( $ emails ) ) { return $ this -> handleError ( 'Empty email' ) ; } $ data = array ( 'emails' => base64_encode ( $ emails ) , ) ; $ requestResult = $ this -> sendRequest ( 'blacklist' , 'DELETE' , $ data ) ; return $ this -> handleResult ( $ requestResult ) ... | Remove emails from blacklist |
56,668 | public function smtpGetEmailInfoById ( $ id ) { if ( empty ( $ id ) ) { return $ this -> handleError ( 'Empty id' ) ; } $ requestResult = $ this -> sendRequest ( '/smtp/emails/' . $ id ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get information about email by id |
56,669 | public function pushListWebsites ( $ limit = null , $ offset = null ) { $ data = array ( ) ; if ( null !== $ limit ) { $ data [ 'limit' ] = $ limit ; } if ( null !== $ offset ) { $ data [ 'offset' ] = $ offset ; } $ requestResult = $ this -> sendRequest ( 'push/websites' , 'GET' , $ data ) ; return $ this -> handleResu... | Get list of websites |
56,670 | public function pushListWebsiteSubscriptions ( $ websiteID , $ limit = null , $ offset = null ) { $ data = array ( ) ; if ( null !== $ limit ) { $ data [ 'limit' ] = $ limit ; } if ( null !== $ offset ) { $ data [ 'offset' ] = $ offset ; } $ requestResult = $ this -> sendRequest ( 'push/websites/' . $ websiteID . '/sub... | Get list of subscriptions for the website |
56,671 | public function pushSetSubscriptionState ( $ subscriptionID , $ stateValue ) { $ data = array ( 'id' => $ subscriptionID , 'state' => $ stateValue , ) ; $ requestResult = $ this -> sendRequest ( 'push/subscriptions/state' , 'POST' , $ data ) ; return $ this -> handleResult ( $ requestResult ) ; } | Set state for subscription |
56,672 | public function getPushIntegrationCode ( $ websiteID ) { if ( empty ( $ websiteID ) ) { return $ this -> handleError ( 'Empty website id' ) ; } $ requestResult = $ this -> sendRequest ( '/push/websites/' . $ websiteID . '/code' ) ; return $ this -> handleResult ( $ requestResult ) ; } | Get integration code for Push Notifications . |
56,673 | public function addPhones ( $ bookID , array $ phones ) { if ( empty ( $ bookID ) ) { return $ this -> handleError ( 'Empty book id' ) ; } $ data = [ 'addressBookId' => $ bookID , 'phones' => json_encode ( $ phones ) ] ; $ requestResult = $ this -> sendRequest ( '/sms/numbers' , 'POST' , $ data ) ; return $ this -> han... | Add phones to addressbook |
56,674 | public function addPhonesWithVariables ( $ bookID , array $ phonesWithVariables ) { if ( empty ( $ bookID ) ) { return $ this -> handleError ( 'Empty book id' ) ; } $ data = [ 'addressBookId' => $ bookID , 'phones' => json_encode ( $ phonesWithVariables ) ] ; $ requestResult = $ this -> sendRequest ( '/sms/numbers/vari... | Add phones with variables to addressbook |
56,675 | public function updatePhoneVaribales ( $ bookID , array $ phones , array $ variables ) { if ( empty ( $ bookID ) ) { return $ this -> handleError ( 'Empty book id' ) ; } $ data = [ 'addressBookId' => $ bookID , 'phones' => json_encode ( $ phones ) , 'variables' => json_encode ( $ variables ) ] ; $ requestResult = $ thi... | Update variables for phones |
56,676 | public function getPhoneInfo ( $ bookID , $ phoneNumber ) { if ( empty ( $ bookID ) ) { return $ this -> handleError ( 'Empty book id' ) ; } $ requestResult = $ this -> sendRequest ( '/sms/numbers/info/' . $ bookID . '/' . $ phoneNumber ) ; return $ this -> handleResult ( $ requestResult ) ; } | get information about phone number |
56,677 | public function addPhonesToBlacklist ( array $ phones ) { $ data = [ 'phones' => json_encode ( $ phones ) ] ; $ requestResult = $ this -> sendRequest ( '/sms/black_list' , 'POST' , $ data ) ; return $ this -> handleResult ( $ requestResult ) ; } | Add phones to blacklist |
56,678 | public function removePhonesFromBlacklist ( array $ phones ) { $ data = [ 'phones' => json_encode ( $ phones ) ] ; $ requestResult = $ this -> sendRequest ( '/sms/black_list' , 'DELETE' , $ data ) ; return $ this -> handleResult ( $ requestResult ) ; } | Delete phones from blacklist |
56,679 | public function sendSmsByBook ( $ bookID , array $ params , array $ additionalParams = [ ] ) { if ( empty ( $ bookID ) ) { return $ this -> handleError ( 'Empty book id' ) ; } $ data = [ 'addressBookId' => $ bookID ] ; $ data = array_merge ( $ data , $ params ) ; if ( $ additionalParams ) { $ data = array_merge ( $ dat... | Create sms campaign based on phones in book |
56,680 | public function sendSmsByList ( array $ phones , array $ params , array $ additionalParams ) { $ data = [ 'phones' => json_encode ( $ phones ) ] ; $ data = array_merge ( $ data , $ params ) ; if ( $ additionalParams ) { $ data = array_merge ( $ data , $ additionalParams ) ; } $ requestResult = $ this -> sendRequest ( '... | Create sms campaign based on list |
56,681 | public function listSmsCampaigns ( array $ params = null ) { $ requestResult = $ this -> sendRequest ( '/sms/campaigns/list' , 'GET' , $ params ) ; return $ this -> handleResult ( $ requestResult ) ; } | List sms campaigns |
56,682 | public function getSmsCampaignCost ( array $ params , array $ additionalParams = null ) { if ( ! isset ( $ params [ 'addressBookId' ] ) && ! isset ( $ params [ 'phones' ] ) ) { return $ this -> handleError ( 'You mast pass phones list or addressbook ID' ) ; } if ( $ additionalParams ) { $ params = array_merge ( $ param... | Get SMS campaign cost based on book or simple list |
56,683 | public static function create ( $ commandToHandlerMap ) { $ handlerMiddleware = new CommandHandlerMiddleware ( new ClassNameExtractor ( ) , new InMemoryLocator ( $ commandToHandlerMap ) , new HandleInflector ( ) ) ; $ lockingMiddleware = new LockingMiddleware ( ) ; return new CommandBus ( [ $ lockingMiddleware , $ hand... | Creates a default CommandBus that you can get started with . |
56,684 | public function execute ( $ command , callable $ next ) { $ this -> queue [ ] = function ( ) use ( $ command , $ next ) { return $ next ( $ command ) ; } ; if ( $ this -> isExecuting ) { return ; } $ this -> isExecuting = true ; try { $ returnValue = $ this -> executeQueuedJobs ( ) ; } catch ( \ Exception $ e ) { $ thi... | Execute the given command ... after other running commands are complete . |
56,685 | protected function executeQueuedJobs ( ) { $ returnValues = [ ] ; while ( $ resumeCommand = array_shift ( $ this -> queue ) ) { $ returnValues [ ] = $ resumeCommand ( ) ; } return array_shift ( $ returnValues ) ; } | Process any pending commands in the queue . If multiple jobs are in the queue only the first return value is given back . |
56,686 | public function execute ( $ command , callable $ next ) { $ commandName = $ this -> commandNameExtractor -> extract ( $ command ) ; $ handler = $ this -> handlerLocator -> getHandlerForCommand ( $ commandName ) ; $ methodName = $ this -> methodNameInflector -> inflect ( $ command , $ handler ) ; if ( ! is_callable ( [ ... | Executes a command and optionally returns a value |
56,687 | public function getHandlerForCommand ( $ commandName ) { if ( ! isset ( $ this -> handlers [ $ commandName ] ) ) { throw MissingHandlerException :: forCommand ( $ commandName ) ; } return $ this -> handlers [ $ commandName ] ; } | Returns the handler bound to the command s class name . |
56,688 | public function select ( ... $ columns ) : Query \ SelectQuery { $ query = $ this -> engine -> makeSelect ( ) ; if ( empty ( $ columns ) === false ) { $ query = $ query -> columns ( ... $ columns ) ; } return $ query ; } | Create a new SELECT query |
56,689 | public function insert ( $ table , array $ map = [ ] ) : Query \ InsertQuery { $ query = $ this -> engine -> makeInsert ( ) -> into ( $ table ) ; if ( empty ( $ map ) === false ) { $ query = $ query -> map ( $ map ) ; } return $ query ; } | Create a new INSERT query |
56,690 | public function update ( $ table , array $ map = [ ] ) : Query \ UpdateQuery { $ query = $ this -> engine -> makeUpdate ( ) -> table ( $ table ) ; if ( empty ( $ map ) === false ) { $ query = $ query -> set ( $ map ) ; } return $ query ; } | Create a new UPDATE query |
56,691 | public function criteria ( string $ expression ) : CriteriaInterface { return $ this -> visitor ( ) -> visit ( \ Hoa \ Ruler \ Ruler :: interpret ( $ expression ) ) ; } | Create a new criteria from an expression |
56,692 | public static function all ( $ params = null , $ apiKey = null ) { return self :: _all ( get_class ( ) , $ params , $ apiKey ) ; } | retrieve all trackers |
56,693 | public static function create_list ( $ params = null , $ apiKey = null ) { $ class = get_class ( ) ; if ( ! isset ( $ params [ 'trackers' ] ) || ! is_array ( $ params [ 'trackers' ] ) ) { $ clone = $ params ; unset ( $ params ) ; $ params [ 'trackers' ] = $ clone ; } $ requestor = new Requestor ( $ apiKey ) ; $ url = s... | create a list of trackers |
56,694 | public function delete ( $ params = null , $ apiKey = null ) { return self :: _delete ( get_class ( ) , $ params , true ) ; } | delete a webhook |
56,695 | public function update ( $ params = null , $ apiKey = null ) { if ( ! isset ( $ params [ 'webhook' ] ) || ! is_array ( $ params [ 'webhook' ] ) ) { $ clone = $ params ; unset ( $ params ) ; $ params [ 'webhook' ] = $ clone ; } return self :: _update ( get_class ( ) , $ params ) ; } | update a webhook |
56,696 | public static function create ( $ params = null , $ apiKey = null ) { if ( ! isset ( $ params [ 'webhook' ] ) || ! is_array ( $ params [ 'webhook' ] ) ) { $ clone = $ params ; unset ( $ params ) ; $ params [ 'webhook' ] = $ clone ; } return self :: _create ( get_class ( ) , $ params , $ apiKey ) ; } | create a webhook |
56,697 | public static function create ( $ params = null , $ apiKey = null ) { return self :: _create ( get_class ( ) , $ params , $ apiKey ) ; } | create a scan form |
56,698 | public static function create_and_buy ( $ params = null , $ apiKey = null ) { $ class = get_class ( ) ; if ( ! isset ( $ params [ 'batch' ] ) || ! is_array ( $ params [ 'batch' ] ) ) { $ clone = $ params ; unset ( $ params ) ; $ params [ 'batch' ] = $ clone ; } $ requestor = new Requestor ( $ apiKey ) ; $ url = self ::... | create and buy a batch |
56,699 | public function buy ( $ params = null ) { $ requestor = new Requestor ( $ this -> _apiKey ) ; $ url = $ this -> instanceUrl ( ) . '/buy' ; list ( $ response , $ apiKey ) = $ requestor -> request ( 'post' , $ url , $ params ) ; $ this -> refreshFrom ( $ response , $ apiKey , true ) ; return $ this ; } | buy a batch |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.