idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
9,100
public function compute ( string $ X ) : string { $ len = strlen ( $ X ) ; if ( 0 != $ len % 16 ) { throw new \ UnexpectedValueException ( "Input string must be a multiple of 128 bits." ) ; } $ Y = GCM :: ZB_128 ; $ m = $ len >> 4 ; for ( $ i = 0 ; $ i < $ m ; ++ $ i ) { $ xi = substr ( $ X , $ i << 4 , 16 ) ; $ Y = $ ...
Compute hash .
9,101
private function _mult ( string $ X , string $ Y ) : string { $ x = GCM :: strToGMP ( $ X ) ; $ Z = GCM :: strToGMP ( GCM :: ZB_128 ) ; $ V = GCM :: strToGMP ( $ Y ) ; $ R = GCM :: strToGMP ( self :: R ) ; for ( $ i = 0 ; $ i < 128 ; ++ $ i ) { if ( gmp_testbit ( $ x , 127 - $ i ) ) { $ Z ^= $ V ; } if ( ! gmp_testbit ...
Apply block multiplication operation .
9,102
public static function xss ( $ string , $ charset = 'ISO-8859-1' ) { $ sanitize = new Sanitize ( ) ; $ string = $ sanitize :: removeNullCharacters ( $ string ) ; $ string = $ sanitize :: validateStandardCharacterEntities ( $ string ) ; $ string = $ sanitize :: validateUTF16TwoByteEncoding ( $ string ) ; $ string = $ sa...
Cleans against XSS .
9,103
public function getOwnerUser ( ) { $ reflection = ClassUtils :: newReflectionObject ( $ this ) ; if ( $ reflection -> hasMethod ( 'getUser' ) ) { return $ this -> getUser ( ) ; } elseif ( $ reflection -> hasMethod ( 'getUserProfile' ) ) { return $ this -> getUserProfile ( ) ? $ this -> getUserProfile ( ) -> getUser ( )...
Returns the owner of this entity
9,104
public function SendText ( Request \ SendText $ SendText = null ) { $ uri = $ this -> getUri ( '/text' , array ( ) ) ; return $ this -> post ( $ uri , $ SendText ) ; }
Send text message and return broadcastId
9,105
public function QueryTexts ( Request \ QueryTexts $ QueryTexts = null ) { $ uri = $ this -> getUri ( '/text' , array ( ) ) ; return $ this -> get ( $ uri , $ QueryTexts ) ; }
List sent and received text messages
9,106
public function CreateAutoReply ( Request \ CreateAutoReply $ CreateAutoReply = null ) { $ uri = $ this -> getUri ( '/text/auto-reply' , array ( ) ) ; return $ this -> post ( $ uri , $ CreateAutoReply ) ; }
Configures a new auto - reply
9,107
public function QueryAutoReplies ( Request \ QueryAutoReplies $ QueryAutoReplies = null ) { $ uri = $ this -> getUri ( '/text/auto-reply' , array ( ) ) ; return $ this -> get ( $ uri , $ QueryAutoReplies ) ; }
Lists configured auto - replies
9,108
public function SendCall ( Request \ SendCall $ SendCall = null ) { $ uri = $ this -> getUri ( '/call' , array ( ) ) ; return $ this -> post ( $ uri , $ SendCall ) ; }
Creates a call broadcast adds numbers to it and sends it immediately
9,109
public function QueryCalls ( Request \ QueryCalls $ QueryCalls = null ) { $ uri = $ this -> getUri ( '/call' , array ( ) ) ; return $ this -> get ( $ uri , $ QueryCalls ) ; }
Lists inbound and outbound calls
9,110
public function CreateSound ( Request \ CreateSound $ CreateSound = null ) { $ uri = $ this -> getUri ( '/call/sound' , array ( ) ) ; return $ this -> post ( $ uri , $ CreateSound ) ; }
Creates a new CallFire - hosted sound for use in calls .
9,111
public function QuerySoundMeta ( Request \ QuerySoundMeta $ QuerySoundMeta = null ) { $ uri = $ this -> getUri ( '/call/sound' , array ( ) ) ; return $ this -> get ( $ uri , $ QuerySoundMeta ) ; }
Lists sounds available for use in calls .
9,112
public function SendVerificationCodeToCallerId ( Request \ SendVerificationCodeToCallerId $ SendVerificationCodeToCallerId = null ) { $ uri = $ this -> getUri ( '/call/callerid/send-verification' , array ( ) ) ; return $ this -> post ( $ uri , $ SendVerificationCodeToCallerId ) ; }
Sends call to callerId number and voice verification code
9,113
public function VerifyCallerId ( Request \ VerifyCallerId $ VerifyCallerId = null ) { $ uri = $ this -> getUri ( '/call/callerid/verify' , array ( ) ) ; return $ this -> post ( $ uri , $ VerifyCallerId ) ; }
Verify callerId by including verification code
9,114
public function GetCallerIds ( Request \ GetCallerIds $ GetCallerIds = null ) { $ uri = $ this -> getUri ( '/call/callerid' , array ( ) ) ; return $ this -> get ( $ uri , $ GetCallerIds ) ; }
Return list of verified callerIds
9,115
private function getObjectClassname ( $ object ) { if ( ! is_object ( $ object ) ) { return null ; } if ( ! $ this -> isClassMappingEnabled ( ) ) { return '' ; } if ( is_callable ( $ this -> getClassmappingCallback ( ) ) ) { $ className = call_user_func_array ( $ this -> getClassmappingCallback ( ) , [ $ object ] ) ; }...
Get the fully - qualified classname for a given typed object
9,116
public static function forever ( $ name , $ value , $ path = '/' , $ domain = null , $ secure = false ) { return static :: put ( $ name , $ value , static :: FOREVER , $ path , $ domain , $ secure ) ; }
Set a permanent cookie . The cookie will last for one year .
9,117
protected static function parse ( $ value ) { $ segments = explode ( '+' , $ value ) ; if ( ! ( count ( $ segments ) >= 2 ) ) { return null ; } $ value = implode ( '+' , array_slice ( $ segments , 1 ) ) ; if ( $ segments [ 0 ] == static :: hash ( $ value ) ) { return $ value ; } return null ; }
Parse a hash fingerprinted cookie value .
9,118
public static function send ( ) { foreach ( static :: $ jar as $ cookie ) { setcookie ( $ cookie [ 'name' ] , $ cookie [ 'value' ] , $ cookie [ 'expiration' ] , $ cookie [ 'path' ] , $ cookie [ 'domain' ] , $ cookie [ 'secure' ] , true ) ; } }
Send along with the rest of the HTTP headers .
9,119
protected function addEndpoint ( EndpointCollection $ endpoints , ReflectionClass $ class , $ method , array $ annotations ) { $ endpoints -> push ( $ endpoint = new MethodEndpoint ( [ 'reflection' => $ class , 'method' => $ method , 'uses' => $ class -> name . '@' . $ method ] ) ) ; foreach ( $ annotations as $ annota...
Create a new endpoint in the collection .
9,120
public function prepare ( ) { $ result = [ ] ; $ file = $ this -> envFileToUseForDefaults ( ) ; \ Lanin \ Laravel \ SetupWizard \ Support \ DotEnv :: load ( $ this -> envFilePath ( ) , $ file ) ; foreach ( \ Lanin \ Laravel \ SetupWizard \ Support \ DotEnv :: $ variables as $ name => $ default ) { $ options = $ this ->...
Proceed step .
9,121
protected function envFileToUseForDefaults ( ) { $ file = config ( 'setup.dot_env.default_file' ) ; if ( $ this -> envFileExist ( ) && $ this -> command -> confirm ( 'Existing .env file was found. Use it for defaults?' , true ) ) { $ file = '.env' ; } return $ file ; }
Chooses what env file to use .
9,122
protected function runInput ( $ name , array $ options , $ default = null ) { return $ this -> command -> ask ( $ this -> generatePrompt ( $ name , $ options [ 'prompt' ] ) , $ default ) ; }
Run input prompt .
9,123
protected function runSelect ( $ name , array $ options , $ default = null ) { return $ this -> command -> choice ( $ this -> generatePrompt ( $ name , $ options [ 'prompt' ] ) , $ options [ 'options' ] , array_search ( $ default , $ options [ 'options' ] ) ) ; }
Run select prompt .
9,124
protected function runRandom ( $ name , array $ options , $ default = 'SomeRandomString' ) { $ value = $ this -> command -> ask ( $ this -> generatePrompt ( $ name , $ options [ 'prompt' ] ) , $ default ) ; if ( $ value === 'SomeRandomString' ) { $ value = $ this -> getRandomKey ( config ( 'app.cipher' ) ) ; } return $...
Run random prompt .
9,125
protected function saveFile ( $ results ) { $ file = fopen ( $ this -> envFilePath ( '.env' ) , 'w+' ) ; foreach ( $ results as $ variable => $ value ) { fwrite ( $ file , $ variable . '=' . $ value . PHP_EOL ) ; } return fclose ( $ file ) ; }
Save . env file .
9,126
public function beforeSave ( Event $ event , EntityInterface $ entity , ArrayObject $ options ) { if ( empty ( $ options [ 'loggedInUser' ] ) ) { $ options [ 'loggedInUser' ] = $ this -> _Auth -> user ( 'id' ) ; } }
Before save listener .
9,127
public static function setEnvironmentVariable ( $ name , $ value = null ) { list ( $ name , $ value ) = static :: normaliseEnvironmentVariable ( $ name , $ value ) ; static :: $ variables [ $ name ] = $ value ; }
Overwrite to save variables to array .
9,128
public function get ( $ path , $ query = [ ] ) { if ( ! empty ( $ query ) ) { if ( strpos ( $ path , '?' ) === false ) { $ path .= '?' . http_build_query ( $ query , '' , '&' ) ; } else { $ path .= ini_get ( 'arg_separator.output' ) . http_build_query ( $ query , '' , '&' ) ; } } return $ this -> execute ( 'GET' , $ pa...
GET function .
9,129
public static function fromKeyLength ( int $ len ) : self { $ bits = $ len << 3 ; if ( ! array_key_exists ( $ bits , self :: MAP_KEYSIZE_TO_CLS ) ) { throw new \ UnexpectedValueException ( "No AES implementation for $bits-bit key size." ) ; } $ cls = self :: MAP_KEYSIZE_TO_CLS [ $ bits ] ; return new $ cls ( ) ; }
Get AES cipher instance by key length .
9,130
protected function getCommentMethod ( PHP_CodeSniffer_File $ phpcsFile , $ commentEnd ) { $ tokens = $ phpcsFile -> getTokens ( ) ; $ next = $ phpcsFile -> findNext ( array ( T_WHITESPACE ) , $ commentEnd + 1 , null , true ) ; if ( in_array ( $ tokens [ $ next ] [ 'code' ] , \ PHP_CodeSniffer_Tokens :: $ methodPrefixes...
Get the method token if current token is a method comment . Returns false if no method found for the comment .
9,131
protected function curlCheck ( ) { $ ch = curl_init ( $ this -> endPoint ) ; curl_setopt ( $ ch , CURLOPT_HEADER , 0 ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 ) ; $ data = curl_exec ( $ ch ) ; $ responseCode = curl_getinfo ( $ ch , CURLINFO_HTTP_CODE ) ; $ responseBody = $ this -> cleanUp ( $ data ) ; curl_cl...
Check service availability using curl
9,132
protected function fileGetContentsCheck ( ) { $ contents = file_get_contents ( $ this -> endPoint ) ; $ contents = $ this -> cleanUp ( $ contents ) ; if ( $ contents === '[OK]' ) { return true ; } return false ; }
Check service availability using file_get_contents
9,133
public function CreateCccCampaign ( Request \ CreateCccCampaign $ CreateCccCampaign = null ) { $ uri = $ this -> getUri ( '/ccc' , array ( ) ) ; return $ this -> post ( $ uri , $ CreateCccCampaign ) ; }
Create CCC Campaign
9,134
public function QueryCccCampaigns ( Request \ QueryCccCampaigns $ QueryCccCampaigns = null ) { $ uri = $ this -> getUri ( '/ccc' , array ( ) ) ; return $ this -> get ( $ uri , $ QueryCccCampaigns ) ; }
Query CCC Campaigns
9,135
public function ControlCccCampaign ( $ Id , Request \ ControlCccCampaign $ ControlCccCampaign ) { $ uri = $ this -> getUri ( '/ccc/%s/control' , array ( $ Id ) ) ; return $ this -> put ( $ uri , $ ControlCccCampaign ) ; }
Starts Stops or Archives a CCC Campaign
9,136
public function QueryAgents ( Request \ QueryAgents $ QueryAgents = null ) { $ uri = $ this -> getUri ( '/ccc/agent' , array ( ) ) ; return $ this -> get ( $ uri , $ QueryAgents ) ; }
Lists existing Agents
9,137
public function QueryAgentGroups ( Request \ QueryAgentGroups $ QueryAgentGroups = null ) { $ uri = $ this -> getUri ( '/ccc/agent-group' , array ( ) ) ; return $ this -> get ( $ uri , $ QueryAgentGroups ) ; }
Lists existing AgentGroups
9,138
public function CreateAgentGroup ( Request \ CreateAgentGroup $ CreateAgentGroup = null ) { $ uri = $ this -> getUri ( '/ccc/agent-group' , array ( ) ) ; return $ this -> post ( $ uri , $ CreateAgentGroup ) ; }
Create CCC AgentGroup
9,139
public function QueryAgentSessions ( Request \ QueryAgentSessions $ QueryAgentSessions = null ) { $ uri = $ this -> getUri ( '/ccc/agent-session' , array ( ) ) ; return $ this -> get ( $ uri , $ QueryAgentSessions ) ; }
Lists existing AgentSessions
9,140
public function SendAgentInvites ( $ CampaignId , Request \ SendAgentInvites $ SendAgentInvites ) { $ uri = $ this -> getUri ( '/ccc/%s/agent-invite' , array ( $ CampaignId ) ) ; return $ this -> post ( $ uri , $ SendAgentInvites ) ; }
Send CCC AgentInvite
9,141
public function GetAgentInviteUri ( $ CampaignId , Request \ GetAgentInviteUri $ GetAgentInviteUri ) { $ uri = $ this -> getUri ( '/ccc/%s/agent-invite-uri' , array ( $ CampaignId ) ) ; return $ this -> get ( $ uri , $ GetAgentInviteUri ) ; }
Get CCC AgentInvite URI
9,142
public function GetCccCampaignStats ( $ CampaignId , Request \ GetCccCampaignStats $ GetCccCampaignStats = null ) { $ uri = $ this -> getUri ( '/ccc/%s/stats' , array ( $ CampaignId ) ) ; return $ this -> get ( $ uri , $ GetCccCampaignStats ) ; }
Get CCC Campaign statistics by campaign id
9,143
public function UpdateCccCampaign ( $ Id , Request \ UpdateCccCampaign $ UpdateCccCampaign = null ) { $ uri = $ this -> getUri ( '/ccc/%s' , array ( $ Id ) ) ; return $ this -> put ( $ uri , $ UpdateCccCampaign ) ; }
Updates an existing CCC Campaigns configuration
9,144
public function AddAgents ( $ CampaignId , Request \ AddAgents $ AddAgents = null ) { $ uri = $ this -> getUri ( '/ccc/%s/agent' , array ( $ CampaignId ) ) ; return $ this -> post ( $ uri , $ AddAgents ) ; }
Add Agents to Campaign
9,145
public function GetAgents ( $ CampaignId , Request \ GetAgents $ GetAgents = null ) { $ uri = $ this -> getUri ( '/ccc/%s/agent' , array ( $ CampaignId ) ) ; return $ this -> get ( $ uri , $ GetAgents ) ; }
Get Agents attached with Campaign
9,146
public function RemoveAgent ( $ CampaignId , $ Id , Request \ RemoveAgent $ RemoveAgent = null ) { $ uri = $ this -> getUri ( '/ccc/%s/agent/%s' , array ( $ CampaignId , $ Id ) ) ; return $ this -> delete ( $ uri , $ RemoveAgent ) ; }
Remove Agents from CCC Campaign
9,147
public function UpdateAgentGroup ( $ Id , Request \ UpdateAgentGroup $ UpdateAgentGroup = null ) { $ uri = $ this -> getUri ( '/ccc/agent-group/%s' , array ( $ Id ) ) ; return $ this -> put ( $ uri , $ UpdateAgentGroup ) ; }
Updates an existing CCC AgentGroup
9,148
public function AddAgentGroups ( $ CampaignId , Request \ AddAgentGroups $ AddAgentGroups = null ) { $ uri = $ this -> getUri ( '/ccc/%s/agent-group' , array ( $ CampaignId ) ) ; return $ this -> post ( $ uri , $ AddAgentGroups ) ; }
Add AgentGroups to Campaign
9,149
public function GetAgentGroups ( $ CampaignId , Request \ GetAgentGroups $ GetAgentGroups = null ) { $ uri = $ this -> getUri ( '/ccc/%s/agent-group' , array ( $ CampaignId ) ) ; return $ this -> get ( $ uri , $ GetAgentGroups ) ; }
Get all AgentGroups attached to Campaign
9,150
public function RemoveAgentGroup ( $ CampaignId , $ Id , Request \ RemoveAgentGroup $ RemoveAgentGroup = null ) { $ uri = $ this -> getUri ( '/ccc/%s/agent-group/%s' , array ( $ CampaignId , $ Id ) ) ; return $ this -> delete ( $ uri , $ RemoveAgentGroup ) ; }
Remove AgentGroup from Campaign
9,151
public function setFormattedAddress ( $ formattedAddress ) { if ( array_key_exists ( 'address' , $ this -> attributes ) === false ) { $ this -> attributes [ 'address' ] = [ ] ; } $ this -> attributes [ 'address' ] [ 'formatted' ] = ( string ) $ formattedAddress ; }
Set the user s address as a formatted string
9,152
public function setClaim ( $ claim , $ value ) { if ( in_array ( $ claim , [ 'sub' , 'name' , 'given_name' , 'middle_name' , 'family_name' , 'nickname' , 'preferred_username' , 'profile' , 'picture' , 'website' , 'email' , 'email_verified' , 'gender' , 'birthdate' , 'zoneinfo' , 'locale' , 'phone_number' , 'phone_numbe...
Set a claim
9,153
public function duplicate ( string $ name = null ) : LinkInterface { $ link = new self ( $ name ?? $ this -> name ( ) , $ this -> href ( ) ) ; $ link -> metaInformation ( ) -> mergeCollection ( $ this -> metaInformation ( ) ) ; return $ link ; }
Creates a new link containing all data from the current one . If set the new link will have the given name .
9,154
public function generateClasses ( $ requestNamespace = null , $ responseNamespace = null , $ structureNamespace = null ) { $ classGenerator = $ this -> getClassGenerator ( ) ; if ( $ constructorGenerator = $ this -> getConstructorGenerator ( ) ) { $ classGenerator -> addMethodFromGenerator ( $ constructorGenerator ) ; ...
Populate the API class generators from the available API data .
9,155
public function initCliAction ( ) { clearstatcache ( ) ; $ app = 'app/' . Config :: get ( 'app.name' ) . '/' ; $ assets = array ( BASE_PATH . $ app . '_session/' , BASE_PATH . $ app . '_cache/' , BASE_PATH . $ app . '_database/' , BASE_PATH . $ app . '_templates/' , ) ; echo 'Check app assets' . PHP_EOL ; foreach ( $ a...
Checks the applications architecture and creates some security and safety measures .
9,156
public function build ( ) { $ soapClientFactory = new SoapClientFactory ( ) ; $ soapClient = $ soapClientFactory -> create ( $ this -> wsdl ) ; return new Client ( $ soapClient ) ; }
Build the WSColiPosteLetterService SOAP client
9,157
public function create ( ) { if ( ! empty ( $ this -> ch ) ) { curl_close ( $ this -> ch ) ; } $ this -> ch = curl_init ( ) ; $ this -> authenticate ( ) ; }
Create function .
9,158
public function init ( $ path ) { $ this -> storage = app ( ) -> make ( 'filesystem' ) ; $ this -> path = $ path ; if ( $ this -> exists ( ) ) { list ( $ this -> dir , $ this -> name ) = FileSystem :: splitNameFromPath ( $ path ) ; $ this -> lastModified = $ this -> storage -> lastModified ( $ path ) ; $ metadata = $ t...
BlobMetadata initializer .
9,159
public function debugInfo ( ) { return [ 'exists' => $ this -> exists ( ) , 'isFile' => $ this -> isFile ( ) , 'isImage' => $ this -> isImage ( ) , 'path' => $ this -> path , 'lastModified' => $ this -> lastModified , 'name' => $ this -> name , 'dir' => $ this -> dir , 'mimeType' => $ this -> mimeType , 'extension' => ...
Get debug info of current metadata file .
9,160
public static function guessMimeType ( $ extension = '' , $ isFile = true ) { if ( $ isFile ) { $ map = config ( 'cripfilesys.mime.map' ) ; return isset ( $ map [ $ extension ] ) ? $ map [ $ extension ] : 'text/plain' ; } return 'dir' ; }
Try guess mime type from path
9,161
protected function getAllowedElements ( ) : array { return [ Speak :: class , Audio :: class , Break_ :: class , Paragraph :: class , Phoneme :: class , Sentence :: class , SayAs :: class , Word :: class , Text :: class ] ; }
Gets the allowed elements .
9,162
protected function validateElement ( BaseElement $ element ) : void { if ( $ element instanceof Break_ ) { $ this -> validateBreak ( $ element ) ; } elseif ( $ element instanceof Phoneme ) { $ this -> validatePhoneme ( $ element ) ; } elseif ( $ element instanceof SayAs ) { $ this -> validateSayAs ( $ element ) ; } els...
Calls validation methods based on the givene element .
9,163
protected function validateBreak ( Break_ $ break ) { $ strength = $ break -> strength ; if ( $ strength !== null && ! in_array ( $ strength , self :: BREAK_STRENGTHS , true ) ) { throw new InvalidAttributeValueException ( $ break , 'strength' , $ strength , self :: BREAK_STRENGTHS , 'alexa' ) ; } $ time = $ break -> t...
Validates a Break_ element .
9,164
protected function validatePhoneme ( Phoneme $ phoneme ) { $ alphabet = $ phoneme -> alphabet ; if ( ! in_array ( $ alphabet , self :: PHONEME_ALPHABETS , true ) ) { throw new InvalidAttributeValueException ( $ phoneme , 'alphabet' , $ alphabet , self :: PHONEME_ALPHABETS , 'alexa' ) ; } }
Validates a Phoneme element .
9,165
protected function validateSayAs ( SayAs $ sayAs ) { $ interpretAs = $ sayAs -> interpretAs ; if ( ! in_array ( $ interpretAs , self :: SAY_AS_INTERPRET_AS , true ) ) { throw new InvalidAttributeValueException ( $ sayAs , 'interpret-as' , $ interpretAs , self :: SAY_AS_INTERPRET_AS , 'alexa' ) ; } $ format = $ sayAs ->...
Validates a SayAs element .
9,166
protected function validateWord ( Word $ word ) { $ role = $ word -> role ; if ( ! in_array ( $ role , self :: WORD_ROLES , true ) ) { throw new InvalidAttributeValueException ( $ word , 'role' , $ role , self :: WORD_ROLES , 'alexa' ) ; } }
Validates a Word element .
9,167
public static function traverse ( Digraph $ graph , DepthFirstVisitorInterface $ visitor , $ start = NULL ) { if ( $ start === NULL ) { $ queue = self :: find_sources ( $ graph , $ visitor ) ; } else if ( $ start instanceof \ SplDoublyLinkedList ) { $ queue = $ start ; } else if ( is_object ( $ start ) ) { $ queue = ne...
Perform a depth - first traversal on the provided graph .
9,168
public static function find_sources ( Digraph $ graph , DepthFirstVisitorInterface $ visitor ) { $ incomings = new \ SplObjectStorage ( ) ; $ queue = new \ SplQueue ( ) ; foreach ( $ graph -> edges ( ) as $ edge ) { if ( ! isset ( $ incomings [ $ edge [ 1 ] ] ) ) { $ incomings [ $ edge [ 1 ] ] = new \ SplObjectStorage ...
Finds source vertices in a Digraph then enqueues them .
9,169
public static function toposort ( Digraph $ graph , $ start = NULL ) { $ visitor = new DepthFirstToposortVisitor ( ) ; self :: traverse ( $ graph , $ visitor , $ start ) ; return $ visitor -> getTsl ( ) ; }
Performs a topological sort on the provided graph .
9,170
public function preview ( $ results ) { $ table = $ results [ '__table' ] ; unset ( $ results [ '__table' ] ) ; $ this -> command -> info ( 'I will insert this values into <comment>' . $ table . '</comment> table' ) ; $ this -> command -> table ( [ 'column' , 'value' ] , $ this -> arrayToTable ( $ results ) ) ; }
Preview results .
9,171
protected function getTable ( $ table = '' ) { if ( empty ( $ table ) ) { switch ( config ( 'auth.driver' ) ) { case 'eloquent' : $ table = $ this -> getTableByModelClass ( config ( 'auth.model' ) ) ; break ; case 'database' : default : $ table = config ( 'auth.table' ) ; break ; } } return $ table ; }
Get users table name .
9,172
public function init ( ServiceBlob $ blob ) { $ this -> bytes = $ blob -> metadata -> getSize ( ) ; $ this -> dir = $ blob -> metadata -> getDir ( true ) ; $ this -> fullName = $ blob -> metadata -> getFullName ( ) ; $ this -> mediaType = $ blob -> getMediaType ( ) ; $ this -> name = $ blob -> metadata -> getName ( ) ;...
Initialize Blob properties from service instance .
9,173
protected function slag ( ) { $ ident = str_replace ( '-' , '_' , implode ( self :: getDelimiter ( ) , $ this -> args ) ) ; $ ident = str_replace ( '_' , self :: getDelimiter ( ) , $ ident ) ; $ ident = trim ( $ ident ) ; $ ident = str_replace ( ' ' , '' , $ ident ) ; return strip_tags ( strtolower ( $ ident ) ) ; }
Slags the identifier .
9,174
public function sentence ( string $ text = null ) : Sentence { $ sentence = Sentence :: factory ( ) ; if ( $ text !== null ) { $ sentence -> text ( $ text ) ; } return $ this -> addElement ( $ sentence ) ; }
Adds a new sentence element . If a text is provided it will be added .
9,175
public static function get ( array $ file , $ test = false ) { $ file = static :: heal ( $ file ) ; if ( is_array ( $ file ) && isset ( $ file [ 'name' ] ) && empty ( $ file [ 'name' ] ) === false ) { $ keys = array_keys ( $ file ) ; sort ( $ keys ) ; if ( $ keys == self :: $ fileKeys ) { if ( UPLOAD_ERR_NO_FILE == $ f...
Factory for save instance creation .
9,176
public function paragraph ( string $ text = null ) : Paragraph { $ paragraph = Paragraph :: factory ( ) ; if ( $ text !== null ) { $ paragraph -> text ( $ text ) ; } return $ this -> addElement ( $ paragraph ) ; }
Adds a new paragraph element . If text is provided this will also be added .
9,177
public function show ( $ id ) { $ item = Cache :: rememberForever ( $ this -> modelTableName . ':' . $ id , function ( ) use ( $ id ) { return call_user_func ( [ $ this -> getModelClass ( ) , 'findOrFail' ] , $ id ) -> toArray ( ) ; } ) ; return $ this -> generateResponse ( $ this -> modelTableName , $ item ) ; }
Get a single item by it s ID .
9,178
public function destroy ( $ id ) { $ item = call_user_func ( [ $ this -> getModelClass ( ) , 'findOrFail' ] , $ id ) ; $ item -> delete ( ) ; return $ this -> generateResponse ( $ this -> modelTableName , null , Response :: HTTP_OK , Status :: OK , 'Item was deleted successfully.' ) ; }
Delete a single item .
9,179
public function getModelClass ( ) { $ model = $ this -> getModelNamespace ( ) . '\\' . $ this -> getModelBaseClass ( ) ; $ this -> validateModelClass ( $ model ) ; return $ model ; }
Get the fully qualified class of the model related to this controller .
9,180
public function getModelBaseClass ( ) { if ( empty ( $ this -> modelBaseClass ) ) { $ this -> modelBaseClass = Str :: singular ( str_replace ( 'Controller' , '' , class_basename ( $ this ) ) ) ; } return $ this -> modelBaseClass ; }
Get the name of the model related to this CRUD controller .
9,181
protected function validateModelClass ( $ modelClass ) { if ( ! class_exists ( $ modelClass ) ) { throw new CrudModelException ( 'The related model does not exist.' ) ; } if ( ! is_subclass_of ( $ modelClass , self :: MICROSERVICE_BASE_MODEL_CLASS ) ) { throw new CrudModelException ( 'The related model must extend the ...
Validate a model class name .
9,182
public function QueryRegions ( Request \ QueryRegions $ QueryRegions = null ) { $ uri = $ this -> getUri ( '/number/regions' , array ( ) ) ; return $ this -> get ( $ uri , $ QueryRegions ) ; }
Queries regions for use in subsequent searches and purchase requests
9,183
public function QueryNumbers ( Request \ QueryNumbers $ QueryNumbers = null ) { $ uri = $ this -> getUri ( '/number' , array ( ) ) ; return $ this -> get ( $ uri , $ QueryNumbers ) ; }
Lists numbers owned by your account
9,184
public function ConfigureNumber ( $ Number , Request \ ConfigureNumber $ ConfigureNumber ) { $ uri = $ this -> getUri ( '/number/%s' , array ( $ Number ) ) ; return $ this -> put ( $ uri , $ ConfigureNumber ) ; }
Configure a number owned by your account
9,185
public function SearchAvailableNumbers ( Request \ SearchAvailableNumbers $ SearchAvailableNumbers = null ) { $ uri = $ this -> getUri ( '/number/search' , array ( ) ) ; return $ this -> get ( $ uri , $ SearchAvailableNumbers ) ; }
Search for new numbers that are available for purchase
9,186
public function QueryKeywords ( Request \ QueryKeywords $ QueryKeywords = null ) { $ uri = $ this -> getUri ( '/number/keyword' , array ( ) ) ; return $ this -> get ( $ uri , $ QueryKeywords ) ; }
Lists keywords owned by your account
9,187
public function SearchAvailableKeywords ( Request \ SearchAvailableKeywords $ SearchAvailableKeywords = null ) { $ uri = $ this -> getUri ( '/number/keyword/search' , array ( ) ) ; return $ this -> get ( $ uri , $ SearchAvailableKeywords ) ; }
Search for keywords available for purchase
9,188
public function Release ( Request \ Release $ Release = null ) { $ uri = $ this -> getUri ( '/number/release' , array ( ) ) ; return $ this -> put ( $ uri , $ Release ) ; }
Disable auto - renew for a number or keyword
9,189
public static function bootstrap ( array $ conf , array $ server = array ( ) ) { $ problems = array ( ) ; try { Config :: load ( $ conf ) ; $ environment = Config :: get ( 'environment' ) ; date_default_timezone_set ( Config :: get ( 'timezone' ) ) ; self :: setupUtils ( $ server , Config :: get ( 'bootstrap.local_temp...
Mechanism used to do initial setup and edging before a application runs .
9,190
public function make ( array $ config ) : ProfileRegistry { $ config = $ this -> getConfig ( $ config ) ; return $ this -> getProfileRegistry ( $ config ) ; }
Make the profile registry .
9,191
protected function getProfileRegistry ( array $ config ) : ProfileRegistry { $ registry = new ProfileRegistry ( ) ; foreach ( array_get ( $ config , 'profiles' ) as $ name => $ profile ) { $ profile = $ this -> builder -> create ( $ name , array_get ( $ profile , 'scratch_dir' , storage_path ( 'backups' ) ) , array_get...
Get the profile registry .
9,192
public function load ( $ key ) { try { $ sth = $ this -> pdo -> prepare ( 'SELECT * FROM sessions WHERE id = :id' ) ; $ sth -> bindValue ( ':id' , $ key , \ PDO :: PARAM_INT ) ; $ sth -> execute ( ) ; $ session = $ sth -> fetchObject ( ) ; if ( $ session instanceof \ stdClass ) { return array ( 'id' => $ session -> id ...
Load a session from storage by a given ID . If no session is found for the ID null will be returned .
9,193
public function delete ( $ key ) { $ sth = $ this -> pdo -> prepare ( "DELETE FROM sessions WHERE id = :id" ) ; $ sth -> bindValue ( ':id' , $ key , \ PDO :: PARAM_INT ) ; $ sth -> execute ( ) ; }
Delete a session from storage by a given ID .
9,194
public static function resource ( $ descriptor , $ basePath = null , $ skipValidations = false ) { $ resourceClass = static :: getResourceClass ( $ descriptor ) ; $ resource = new $ resourceClass ( $ descriptor , $ basePath , $ skipValidations ) ; return $ resource ; }
create a resource object .
9,195
public static function validate ( $ source , $ basePath = null ) { $ curResource = 1 ; $ curLine = null ; try { $ datapackage = static :: datapackage ( $ source , $ basePath ) ; foreach ( $ datapackage as $ resource ) { $ curLine = 1 ; foreach ( $ resource as $ line ) { if ( $ curLine == self :: VALIDATE_PEEK_LINES ) {...
validates a given datapackage descriptor will load all resources and sample 10 lines of data from each data source .
9,196
public static function exception ( \ Exception $ exception , Logger $ logger , $ exit = true ) { static :: log ( $ exception , $ logger ) ; ob_get_length ( ) > 0 && ob_get_level ( ) && ob_end_clean ( ) ; if ( Config :: get ( 'error.debug_info' ) === true ) { echo static :: format ( $ exception , Sapi :: isCli ( ) ) ; i...
Handle an exception and display the exception report .
9,197
public static function format ( \ Exception $ exception , $ isCli = false ) { if ( $ isCli === true ) { return "+++ Untreated Exception +++" . PHP_EOL . "Message: " . $ exception -> getMessage ( ) . PHP_EOL . "Location: " . $ exception -> getFile ( ) . " on line " . $ exception -> getLine ( ) . PHP_EOL . "Stack Trace: ...
If detailed errors are enabled just format the exception into a simple error message and display it .
9,198
public static function native ( $ code , $ error , $ file , $ line , Logger $ logger , $ reporting , $ exit = true ) { if ( $ reporting === 0 ) { return ; } $ exception = new \ ErrorException ( $ error , $ code , 0 , $ file , $ line ) ; if ( in_array ( $ code , ( array ) Config :: get ( 'error.ignore_levels' ) ) ) { re...
Handle a native PHP error as an ErrorException .
9,199
public function store ( Request $ request ) { $ this -> manager -> resetPath ( $ request -> folder ) ; if ( empty ( $ request -> name ) ) { return $ this -> json ( 'Name property is required.' , 422 ) ; } if ( ! $ this -> manager -> blobExists ( ) ) { return $ this -> json ( 'Folder not found.' , 404 ) ; } $ result = $...
Create new sub folder