idx int64 0 60.3k | question stringlengths 101 6.21k | target stringlengths 7 803 |
|---|---|---|
22,400 | private function getLastState ( $ questionAttempt ) { $ sequencenumber = - 1 ; $ state = ( object ) [ "state" => "todo" , "timestamp" => null ] ; foreach ( $ questionAttempt -> steps as $ stepId => $ step ) { if ( $ step -> sequencenumber > $ sequencenumber ) { $ sequencenumber = $ step -> sequencenumber ; $ state = ( object ) [ "state" => $ step -> state , "timestamp" => $ step -> timecreated , "fraction" => ( is_null ( $ step -> fraction ) || $ step -> fraction == '' ) ? 0 : floatval ( $ step -> fraction ) ] ; } } return $ state ; } | Get pertient data from the last recorded step of a learners interactions within a question attempt . |
22,401 | public function addUninterpretedOption ( \ google \ protobuf \ UninterpretedOption $ value ) { if ( $ this -> uninterpreted_option === null ) { $ this -> uninterpreted_option = new \ Protobuf \ MessageCollection ( ) ; } $ this -> uninterpreted_option -> add ( $ value ) ; } | Add a new element to uninterpreted_option |
22,402 | private function validate ( ) { $ this -> resolveSubrules ( ) ; $ filters = new Filters ( $ this -> inputs , $ this -> filters , $ this ) ; $ this -> inputs = $ filters -> apply ( ) ; $ this -> customRules ( ) ; $ this -> validator = $ this -> validator -> make ( $ this -> inputs , $ this -> rules , $ this -> messages ) ; $ this -> validator -> setAttributeNames ( $ this -> attributes ) ; if ( method_exists ( $ this , 'after' ) ) { $ this -> after ( $ this -> validator ) ; } } | Run the validation using Laravel s Validator . |
22,403 | public function scope ( $ scope ) { $ beforeMethod = 'before' . ucfirst ( $ scope ) ; $ afterMethod = 'after' . ucfirst ( $ scope ) ; if ( method_exists ( $ this , $ beforeMethod ) ) { call_user_func ( [ $ this , $ beforeMethod ] ) ; } $ this -> rules = $ this -> resolveScope ( $ scope ) ; $ this -> attributes = $ this -> resolveAttributes ( $ scope ) ; $ this -> messages = $ this -> resolveMessages ( $ scope ) ; if ( method_exists ( $ this , $ afterMethod ) ) { call_user_func ( [ $ this , $ afterMethod ] ) ; } return $ this ; } | Set the scope . |
22,404 | private function resolveSubrules ( ) { $ subrules = new Subrules ( $ this -> inputs , $ this -> rules , $ this -> attributes , $ this -> filters , $ this -> messages ) ; $ this -> rules = $ subrules -> rules ( ) ; $ this -> attributes = $ subrules -> attributes ( ) ; $ this -> filters = $ subrules -> filters ( ) ; $ this -> messages = $ subrules -> messages ( ) ; $ this -> inputs = $ subrules -> inputs ( ) ; } | Runs the Subrules class to resolve subrules . |
22,405 | private function customRules ( ) { $ methods = get_class_methods ( get_called_class ( ) ) ; $ methods = array_filter ( $ methods , function ( $ var ) { return strpos ( $ var , 'custom' ) !== false && $ var !== 'customRules' ; } ) ; if ( count ( $ methods ) ) { foreach ( $ methods as $ method ) { $ self = $ this ; $ customRule = snake_case ( $ method ) ; $ customRule = str_replace ( 'custom_' , '' , $ customRule ) ; $ this -> validator -> extend ( $ customRule , function ( $ attribute , $ value , $ parameters ) use ( $ self , $ method ) { return $ self -> $ method ( $ attribute , $ value , $ parameters ) ; } ) ; } } } | Applies custom rules . |
22,406 | public function append ( $ rule , $ value ) { if ( isset ( $ this -> rules [ $ rule ] ) ) { $ existing = $ this -> rules [ $ rule ] ; if ( ! is_array ( $ existing ) ) $ existing = explode ( '|' , $ existing ) ; if ( ! is_array ( $ value ) ) $ value = explode ( '|' , $ value ) ; $ this -> rules [ $ rule ] = implode ( '|' , array_unique ( array_merge ( $ existing , $ value ) ) ) ; } return $ this ; } | Appends a rule to an existing set . |
22,407 | public function bind ( ) { if ( func_num_args ( ) ) { $ bindings = new Bindings ( func_get_args ( ) , $ this -> rules ) ; $ this -> rules = $ bindings -> rules ( ) ; } return $ this ; } | Binds a rule parameter . |
22,408 | protected function curl_setopt ( $ ch ) { curl_setopt ( $ ch , CURLOPT_FOLLOWLOCATION , TRUE ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , TRUE ) ; } | Override to disable follow location adding new opts etc .. |
22,409 | public function lettering ( $ str ) { $ output = '' ; $ array = str_split ( $ str ) ; $ idx = 1 ; foreach ( $ array as $ letter ) { $ output .= '<span class="char' . $ idx ++ . '">' . $ letter . '</span>' ; } return $ output ; } | a port of Lettering . js in php |
22,410 | public static function iconv_fallback_iso88591_utf16be ( $ string , $ bom = false ) { $ newcharstring = '' ; if ( $ bom ) { $ newcharstring .= "\xFE\xFF" ; } for ( $ i = 0 ; $ i < strlen ( $ string ) ; $ i ++ ) { $ newcharstring .= "\x00" . $ string { $ i } ; } return $ newcharstring ; } | ISO - 8859 - 1 = > UTF - 16BE |
22,411 | public static function iconv_fallback_iso88591_utf16le ( $ string , $ bom = false ) { $ newcharstring = '' ; if ( $ bom ) { $ newcharstring .= "\xFF\xFE" ; } for ( $ i = 0 ; $ i < strlen ( $ string ) ; $ i ++ ) { $ newcharstring .= $ string { $ i } . "\x00" ; } return $ newcharstring ; } | ISO - 8859 - 1 = > UTF - 16LE |
22,412 | public static function iconv_fallback_utf8_iso88591 ( $ string ) { if ( function_exists ( 'utf8_decode' ) ) { return utf8_decode ( $ string ) ; } $ newcharstring = '' ; $ offset = 0 ; $ stringlength = strlen ( $ string ) ; while ( $ offset < $ stringlength ) { if ( ( ord ( $ string { $ offset } ) | 0x07 ) == 0xF7 ) { $ charval = ( ( ord ( $ string { ( $ offset + 0 ) } ) & 0x07 ) << 18 ) & ( ( ord ( $ string { ( $ offset + 1 ) } ) & 0x3F ) << 12 ) & ( ( ord ( $ string { ( $ offset + 2 ) } ) & 0x3F ) << 6 ) & ( ord ( $ string { ( $ offset + 3 ) } ) & 0x3F ) ; $ offset += 4 ; } elseif ( ( ord ( $ string { $ offset } ) | 0x0F ) == 0xEF ) { $ charval = ( ( ord ( $ string { ( $ offset + 0 ) } ) & 0x0F ) << 12 ) & ( ( ord ( $ string { ( $ offset + 1 ) } ) & 0x3F ) << 6 ) & ( ord ( $ string { ( $ offset + 2 ) } ) & 0x3F ) ; $ offset += 3 ; } elseif ( ( ord ( $ string { $ offset } ) | 0x1F ) == 0xDF ) { $ charval = ( ( ord ( $ string { ( $ offset + 0 ) } ) & 0x1F ) << 6 ) & ( ord ( $ string { ( $ offset + 1 ) } ) & 0x3F ) ; $ offset += 2 ; } elseif ( ( ord ( $ string { $ offset } ) | 0x7F ) == 0x7F ) { $ charval = ord ( $ string { $ offset } ) ; $ offset += 1 ; } else { $ charval = false ; $ offset += 1 ; } if ( $ charval !== false ) { $ newcharstring .= ( ( $ charval < 256 ) ? chr ( $ charval ) : '?' ) ; } } return $ newcharstring ; } | UTF - 8 = > ISO - 8859 - 1 |
22,413 | public static function iconv_fallback_utf8_utf16be ( $ string , $ bom = false ) { $ newcharstring = '' ; if ( $ bom ) { $ newcharstring .= "\xFE\xFF" ; } $ offset = 0 ; $ stringlength = strlen ( $ string ) ; while ( $ offset < $ stringlength ) { if ( ( ord ( $ string { $ offset } ) | 0x07 ) == 0xF7 ) { $ charval = ( ( ord ( $ string { ( $ offset + 0 ) } ) & 0x07 ) << 18 ) & ( ( ord ( $ string { ( $ offset + 1 ) } ) & 0x3F ) << 12 ) & ( ( ord ( $ string { ( $ offset + 2 ) } ) & 0x3F ) << 6 ) & ( ord ( $ string { ( $ offset + 3 ) } ) & 0x3F ) ; $ offset += 4 ; } elseif ( ( ord ( $ string { $ offset } ) | 0x0F ) == 0xEF ) { $ charval = ( ( ord ( $ string { ( $ offset + 0 ) } ) & 0x0F ) << 12 ) & ( ( ord ( $ string { ( $ offset + 1 ) } ) & 0x3F ) << 6 ) & ( ord ( $ string { ( $ offset + 2 ) } ) & 0x3F ) ; $ offset += 3 ; } elseif ( ( ord ( $ string { $ offset } ) | 0x1F ) == 0xDF ) { $ charval = ( ( ord ( $ string { ( $ offset + 0 ) } ) & 0x1F ) << 6 ) & ( ord ( $ string { ( $ offset + 1 ) } ) & 0x3F ) ; $ offset += 2 ; } elseif ( ( ord ( $ string { $ offset } ) | 0x7F ) == 0x7F ) { $ charval = ord ( $ string { $ offset } ) ; $ offset += 1 ; } else { $ charval = false ; $ offset += 1 ; } if ( $ charval !== false ) { $ newcharstring .= ( ( $ charval < 65536 ) ? self :: BigEndian2String ( $ charval , 2 ) : "\x00" . '?' ) ; } } return $ newcharstring ; } | UTF - 8 = > UTF - 16BE |
22,414 | public static function iconv_fallback_utf8_utf16le ( $ string , $ bom = false ) { $ newcharstring = '' ; if ( $ bom ) { $ newcharstring .= "\xFF\xFE" ; } $ offset = 0 ; $ stringlength = strlen ( $ string ) ; while ( $ offset < $ stringlength ) { if ( ( ord ( $ string { $ offset } ) | 0x07 ) == 0xF7 ) { $ charval = ( ( ord ( $ string { ( $ offset + 0 ) } ) & 0x07 ) << 18 ) & ( ( ord ( $ string { ( $ offset + 1 ) } ) & 0x3F ) << 12 ) & ( ( ord ( $ string { ( $ offset + 2 ) } ) & 0x3F ) << 6 ) & ( ord ( $ string { ( $ offset + 3 ) } ) & 0x3F ) ; $ offset += 4 ; } elseif ( ( ord ( $ string { $ offset } ) | 0x0F ) == 0xEF ) { $ charval = ( ( ord ( $ string { ( $ offset + 0 ) } ) & 0x0F ) << 12 ) & ( ( ord ( $ string { ( $ offset + 1 ) } ) & 0x3F ) << 6 ) & ( ord ( $ string { ( $ offset + 2 ) } ) & 0x3F ) ; $ offset += 3 ; } elseif ( ( ord ( $ string { $ offset } ) | 0x1F ) == 0xDF ) { $ charval = ( ( ord ( $ string { ( $ offset + 0 ) } ) & 0x1F ) << 6 ) & ( ord ( $ string { ( $ offset + 1 ) } ) & 0x3F ) ; $ offset += 2 ; } elseif ( ( ord ( $ string { $ offset } ) | 0x7F ) == 0x7F ) { $ charval = ord ( $ string { $ offset } ) ; $ offset += 1 ; } else { $ charval = false ; $ offset += 1 ; } if ( $ charval !== false ) { $ newcharstring .= ( ( $ charval < 65536 ) ? self :: LittleEndian2String ( $ charval , 2 ) : '?' . "\x00" ) ; } } return $ newcharstring ; } | UTF - 8 = > UTF - 16LE |
22,415 | public static function iconv_fallback_utf16le_utf8 ( $ string ) { if ( substr ( $ string , 0 , 2 ) == "\xFF\xFE" ) { $ string = substr ( $ string , 2 ) ; } $ newcharstring = '' ; for ( $ i = 0 ; $ i < strlen ( $ string ) ; $ i += 2 ) { $ charval = self :: LittleEndian2Int ( substr ( $ string , $ i , 2 ) ) ; $ newcharstring .= self :: iconv_fallback_int_utf8 ( $ charval ) ; } return $ newcharstring ; } | UTF - 16LE = > UTF - 8 |
22,416 | public static function iconv_fallback_utf16be_iso88591 ( $ string ) { if ( substr ( $ string , 0 , 2 ) == "\xFE\xFF" ) { $ string = substr ( $ string , 2 ) ; } $ newcharstring = '' ; for ( $ i = 0 ; $ i < strlen ( $ string ) ; $ i += 2 ) { $ charval = self :: BigEndian2Int ( substr ( $ string , $ i , 2 ) ) ; $ newcharstring .= ( ( $ charval < 256 ) ? chr ( $ charval ) : '?' ) ; } return $ newcharstring ; } | UTF - 16BE = > ISO - 8859 - 1 |
22,417 | public static function iconv_fallback_utf16le_iso88591 ( $ string ) { if ( substr ( $ string , 0 , 2 ) == "\xFF\xFE" ) { $ string = substr ( $ string , 2 ) ; } $ newcharstring = '' ; for ( $ i = 0 ; $ i < strlen ( $ string ) ; $ i += 2 ) { $ charval = self :: LittleEndian2Int ( substr ( $ string , $ i , 2 ) ) ; $ newcharstring .= ( ( $ charval < 256 ) ? chr ( $ charval ) : '?' ) ; } return $ newcharstring ; } | UTF - 16LE = > ISO - 8859 - 1 |
22,418 | public function isSuccessful ( ) { $ successful = false ; $ errorCode = $ this -> getErrorCode ( ) ; if ( $ errorCode === 200 || $ errorCode === 0 ) { $ successful = true ; } return $ successful ; } | Request success flag . |
22,419 | private function initUrl ( $ demo ) { $ url = self :: LIVE_URL ; if ( $ demo === true ) { $ url = self :: DEMO_URL ; } $ this -> setUrl ( $ url ) ; return $ this ; } | Init URL to connect to . |
22,420 | private function initCertificate ( $ providedCertificate , $ pass , $ rawCertificate = false ) { $ certificateContent = $ providedCertificate ; if ( $ rawCertificate === false ) { $ certificateContent = $ this -> readCertificateFromDisk ( $ providedCertificate ) ; } openssl_pkcs12_read ( $ certificateContent , $ certificate , $ pass ) ; $ this -> setCertificate ( $ certificate ) ; $ this -> setPrivateKeyResource ( openssl_pkey_get_private ( $ this -> getCertificatePrivateKey ( ) , $ pass ) ) ; $ this -> setPublicCertificateData ( openssl_x509_parse ( $ this -> getCertificateCert ( ) ) ) ; return $ this ; } | Read certificate from provided path parse it and store in array . |
22,421 | private function initRootCertificatePath ( $ demo ) { $ rootCertificatePath = self :: LIVE_ROOT_CERTIFICATE_PATH ; if ( $ demo === true ) { $ rootCertificatePath = self :: DEMO_ROOT_CERTIFICATE_PATH ; } $ this -> setRootCertificatePath ( $ rootCertificatePath ) ; return $ this ; } | Init root certificate path . |
22,422 | private function readCertificateFromDisk ( $ path ) { $ cert = @ file_get_contents ( $ path ) ; if ( $ cert === false ) { throw new \ Exception ( 'Can not read certificate from location: ' . $ path , 1 ) ; } return $ cert ; } | Read certificate from provided path . |
22,423 | private function getCertificateIssuerName ( ) { $ publicCertData = $ this -> getPublicCertificateData ( ) ; $ x509Issuer = $ publicCertData [ 'issuer' ] ; $ x509IssuerC = isset ( $ x509Issuer [ 'C' ] ) ? $ x509Issuer [ 'C' ] : '' ; $ x509IssuerO = isset ( $ x509Issuer [ 'O' ] ) ? $ x509Issuer [ 'O' ] : '' ; $ x509IssuerOU = isset ( $ x509Issuer [ 'OU' ] ) ? $ x509Issuer [ 'OU' ] : '' ; $ x509IssuerName = sprintf ( 'OU=%s,O=%s,C=%s' , $ x509IssuerOU , $ x509IssuerO , $ x509IssuerC ) ; return $ x509IssuerName ; } | Get certificate issuer name . |
22,424 | private function signXML ( $ xmlRequest ) { $ xmlRequestDOMDoc = new DOMDocument ( ) ; $ xmlRequestDOMDoc -> loadXML ( $ xmlRequest ) ; $ canonical = $ xmlRequestDOMDoc -> C14N ( ) ; $ digestValue = base64_encode ( hash ( 'sha1' , $ canonical , true ) ) ; $ rootElem = $ xmlRequestDOMDoc -> documentElement ; $ signatureNode = $ rootElem -> appendChild ( new DOMElement ( 'Signature' ) ) ; $ signatureNode -> setAttribute ( 'xmlns' , 'http://www.w3.org/2000/09/xmldsig#' ) ; $ signedInfoNode = $ signatureNode -> appendChild ( new DOMElement ( 'SignedInfo' ) ) ; $ signedInfoNode -> setAttribute ( 'xmlns' , 'http://www.w3.org/2000/09/xmldsig#' ) ; $ canonicalMethodNode = $ signedInfoNode -> appendChild ( new DOMElement ( 'CanonicalizationMethod' ) ) ; $ canonicalMethodNode -> setAttribute ( 'Algorithm' , 'http://www.w3.org/2001/10/xml-exc-c14n#' ) ; $ signatureMethodNode = $ signedInfoNode -> appendChild ( new DOMElement ( 'SignatureMethod' ) ) ; $ signatureMethodNode -> setAttribute ( 'Algorithm' , 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' ) ; $ referenceNode = $ signedInfoNode -> appendChild ( new DOMElement ( 'Reference' ) ) ; $ referenceNode -> setAttribute ( 'URI' , sprintf ( '#%s' , $ xmlRequestDOMDoc -> documentElement -> getAttribute ( 'Id' ) ) ) ; $ transformsNode = $ referenceNode -> appendChild ( new DOMElement ( 'Transforms' ) ) ; $ transform1Node = $ transformsNode -> appendChild ( new DOMElement ( 'Transform' ) ) ; $ transform1Node -> setAttribute ( 'Algorithm' , 'http://www.w3.org/2000/09/xmldsig#enveloped-signature' ) ; $ transform2Node = $ transformsNode -> appendChild ( new DOMElement ( 'Transform' ) ) ; $ transform2Node -> setAttribute ( 'Algorithm' , 'http://www.w3.org/2001/10/xml-exc-c14n#' ) ; $ digestMethodNode = $ referenceNode -> appendChild ( new DOMElement ( 'DigestMethod' ) ) ; $ digestMethodNode -> setAttribute ( 'Algorithm' , 'http://www.w3.org/2000/09/xmldsig#sha1' ) ; $ referenceNode -> appendChild ( new DOMElement ( 'DigestValue' , $ digestValue ) ) ; $ signedInfoNode = $ xmlRequestDOMDoc -> getElementsByTagName ( 'SignedInfo' ) -> item ( 0 ) ; $ signatureNode = $ xmlRequestDOMDoc -> getElementsByTagName ( 'Signature' ) -> item ( 0 ) ; $ signatureValueNode = new DOMElement ( 'SignatureValue' , base64_encode ( $ this -> generateSignature ( $ signedInfoNode ) ) ) ; $ signatureNode -> appendChild ( $ signatureValueNode ) ; $ keyInfoNode = $ signatureNode -> appendChild ( new DOMElement ( 'KeyInfo' ) ) ; $ x509DataNode = $ keyInfoNode -> appendChild ( new DOMElement ( 'X509Data' ) ) ; $ x509CertificateNode = new DOMElement ( 'X509Certificate' , $ this -> getPublicCertificateString ( ) ) ; $ x509DataNode -> appendChild ( $ x509CertificateNode ) ; $ x509IssuerSerialNode = $ x509DataNode -> appendChild ( new DOMElement ( 'X509IssuerSerial' ) ) ; $ x509IssuerNameNode = new DOMElement ( 'X509IssuerName' , $ this -> getCertificateIssuerName ( ) ) ; $ x509IssuerSerialNode -> appendChild ( $ x509IssuerNameNode ) ; $ x509SerialNumberNode = new DOMElement ( 'X509SerialNumber' , $ this -> getCertificateIssuerSerialNumber ( ) ) ; $ x509IssuerSerialNode -> appendChild ( $ x509SerialNumberNode ) ; return $ this -> plainXML ( $ xmlRequestDOMDoc ) ; } | Sign XML request . |
22,425 | private function plainXML ( $ xmlRequest ) { $ envelope = new DOMDocument ( ) ; $ envelope -> loadXML ( '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body></soapenv:Body>
</soapenv:Envelope>' ) ; $ envelope -> encoding = 'UTF-8' ; $ envelope -> version = '1.0' ; $ xmlRequestType = $ xmlRequest -> documentElement -> localName ; $ xmlRequestTypeNode = $ xmlRequest -> getElementsByTagName ( $ xmlRequestType ) -> item ( 0 ) ; $ xmlRequestTypeNode = $ envelope -> importNode ( $ xmlRequestTypeNode , true ) ; $ envelope -> getElementsByTagName ( 'Body' ) -> item ( 0 ) -> appendChild ( $ xmlRequestTypeNode ) ; return $ envelope -> saveXML ( ) ; } | Generate XML request |
22,426 | public function sendSoap ( $ payload ) { $ options = [ CURLOPT_URL => $ this -> getUrl ( ) , CURLOPT_CONNECTTIMEOUT => 5 , CURLOPT_TIMEOUT => 5 , CURLOPT_RETURNTRANSFER => true , CURLOPT_POST => true , CURLOPT_POSTFIELDS => $ payload , CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2 , CURLOPT_SSL_VERIFYHOST => 2 , CURLOPT_SSL_VERIFYPEER => false , CURLOPT_CAINFO => $ this -> getRootCertificatePath ( ) , ] ; $ curlHandle = curl_init ( ) ; curl_setopt_array ( $ curlHandle , $ options ) ; $ this -> setLastRequest ( $ payload ) ; $ response = curl_exec ( $ curlHandle ) ; $ code = curl_getinfo ( $ curlHandle , CURLINFO_HTTP_CODE ) ; $ error = curl_error ( $ curlHandle ) ; $ this -> setErrorCode ( $ code ) ; $ this -> setLastResponse ( $ response ) ; curl_close ( $ curlHandle ) ; if ( $ response ) { return $ this -> parseResponse ( $ response , $ code ) ; } else { throw new Exception ( $ error ) ; } } | Send SOAP request to service |
22,427 | public function parseResponse ( $ response , $ code = 4 ) { $ domResponse = new DOMDocument ( ) ; $ domResponse -> loadXML ( $ response ) ; if ( $ code === 200 || $ code == 0 ) { return $ response ; } else { $ errorCode = $ domResponse -> getElementsByTagName ( 'SifraGreske' ) -> item ( 0 ) ; $ errorMessage = $ domResponse -> getElementsByTagName ( 'PorukaGreske' ) -> item ( 0 ) ; $ faultCode = $ domResponse -> getElementsByTagName ( 'faultcode' ) -> item ( 0 ) ; $ faultMessage = $ domResponse -> getElementsByTagName ( 'faultstring' ) -> item ( 0 ) ; if ( $ errorCode && $ errorMessage ) { throw new Exception ( sprintf ( '[%s] %s' , $ errorCode -> nodeValue , $ errorMessage -> nodeValue ) ) ; } else { if ( $ faultCode && $ faultMessage ) { throw new Exception ( sprintf ( '[%s] %s' , $ faultCode -> nodeValue , $ faultMessage -> nodeValue ) ) ; } else { throw new Exception ( print_r ( $ response , true ) , $ code ) ; } } } } | Parse response from service |
22,428 | public function sendRequest ( $ xmlRequest ) { $ payload = $ this -> signXML ( $ xmlRequest -> toXML ( ) ) ; return $ this -> sendSoap ( $ payload ) ; } | Signs and sends request |
22,429 | public function getFullAttributeReferences ( FilterInterface $ filter , DoctrineQueryHandlerInterface $ queryHandler ) : array { $ references = [ ] ; foreach ( $ filter -> getAttributes ( ) as $ attributePath ) { $ references [ ] = $ queryHandler -> resolveAttributeAlias ( $ attributePath ) ; } return $ references ; } | Returns an array of DQL references ready for filtering handling nested entities through joins |
22,430 | protected function fireBeforeOperation ( $ operation , OperationArguments $ args ) { $ this -> getEventManager ( ) -> triggerEvent ( new OperationEvent ( 'beforeOperation' , $ this , $ operation , $ args ) ) ; } | Trigger beforeOperation event . |
22,431 | protected function fireAfterOperation ( $ operation , OperationArguments $ args , & $ returnValue ) { $ this -> getEventManager ( ) -> triggerEvent ( new OperationEvent ( 'afterOperation' , $ this , $ operation , $ args , $ returnValue ) ) ; } | Trigger afterOperation event . |
22,432 | protected function fireOnOperationException ( $ operation , OperationArguments $ args , Exception $ exception ) { $ returnValue = null ; $ this -> getEventManager ( ) -> triggerEvent ( new OperationEvent ( 'onOperationException' , $ this , $ operation , $ args , $ returnValue , $ exception ) ) ; } | Trigger onOperationException event . |
22,433 | protected function doOperation ( $ operation , OperationArguments $ args ) { try { $ this -> fireBeforeOperation ( $ operation , $ args ) ; $ forwardMethod = 'forward' . ucfirst ( $ operation ) ; $ returnValue = call_user_func ( [ $ this , $ forwardMethod ] , $ args ) ; $ this -> fireAfterOperation ( $ operation , $ args , $ returnValue ) ; return $ returnValue ; } catch ( Exception $ e ) { $ this -> fireOnOperationException ( $ operation , $ args , $ e ) ; throw $ e ; } } | Do the specified operation . |
22,434 | public function addOperationListener ( OperationListenerInterface $ listener , $ priority = 0 ) { $ this -> getEventManager ( ) -> attach ( 'beforeOperation' , [ $ listener , 'beforeOperation' ] , $ priority ) ; $ this -> getEventManager ( ) -> attach ( 'afterOperation' , [ $ listener , 'afterOperation' ] , $ priority ) ; $ this -> getEventManager ( ) -> attach ( 'onOperationException' , [ $ listener , 'onOperationException' ] , $ priority ) ; } | Attach a listener for operation events . |
22,435 | protected function createIndex ( $ model ) { if ( $ this -> identifierAsIndex ) { return current ( $ this -> getIdentifierValues ( $ model ) ) ; } return parent :: createIndex ( $ model ) ; } | Creates a new unique index for this model . |
22,436 | protected function createValue ( $ model ) { if ( $ this -> identifierAsIndex ) { return ( string ) current ( $ this -> getIdentifierValues ( $ model ) ) ; } return parent :: createValue ( $ model ) ; } | Creates a new unique value for this model . |
22,437 | private function load ( ) { if ( $ this -> loaded ) { return ; } $ models = ( array ) $ this -> query -> find ( ) ; $ preferred = array ( ) ; if ( $ this -> preferredQuery instanceof \ ModelCriteria ) { $ preferred = ( array ) $ this -> preferredQuery -> find ( ) ; } try { parent :: initialize ( $ models , array ( ) , $ preferred ) ; $ this -> loaded = true ; } catch ( StringCastException $ e ) { throw new StringCastException ( str_replace ( 'argument $labelPath' , 'option "property"' , $ e -> getMessage ( ) ) , null , $ e ) ; } } | Loads the complete choice list entries once . |
22,438 | private function getIdentifierValues ( $ model ) { if ( ! $ model instanceof $ this -> class ) { return array ( ) ; } if ( 1 === count ( $ this -> identifier ) && current ( $ this -> identifier ) instanceof \ ColumnMap ) { $ phpName = current ( $ this -> identifier ) -> getPhpName ( ) ; if ( method_exists ( $ model , 'get' . $ phpName ) ) { return array ( $ model -> { 'get' . $ phpName } ( ) ) ; } } if ( $ model instanceof \ Persistent ) { return array ( $ model -> getPrimaryKey ( ) ) ; } if ( $ model instanceof \ BaseObject && method_exists ( $ model , 'getPrimaryKey' ) ) { return array ( $ model -> getPrimaryKey ( ) ) ; } if ( ! method_exists ( $ model , 'getPrimaryKeys' ) ) { return array ( ) ; } return $ model -> getPrimaryKeys ( ) ; } | Returns the values of the identifier fields of a model . |
22,439 | private function isEqual ( $ choice , $ givenChoice ) { if ( $ choice === $ givenChoice ) { return true ; } if ( $ this -> getIdentifierValues ( $ choice ) === $ this -> getIdentifierValues ( $ givenChoice ) ) { return true ; } return false ; } | Check the given choices for equality . |
22,440 | public function addServer ( string $ dsn ) : bool { try { $ context = new \ ZMQContext ; $ this -> socket = $ context -> getSocket ( \ ZMQ :: SOCKET_REQ ) ; $ this -> socket -> connect ( $ dsn ) ; $ this -> dsn = $ dsn ; return true ; } catch ( \ ZMQException $ e ) { throw new ClientException ( $ e -> getMessage ( ) ) ; } } | Connects to a server socket . |
22,441 | public function doBackground ( string $ jobName , string $ workload ) : string { try { $ this -> socket -> send ( json_encode ( [ 'action' => 'background_job' , 'job' => [ 'name' => $ jobName , 'workload' => $ workload ] ] ) ) ; $ result = $ this -> socket -> recv ( ) ; return $ result ; } catch ( \ ZMQException $ e ) { throw new ClientException ( $ e -> getMessage ( ) ) ; } } | Executes a job in background or non - blocking mode . Returns the job handle received from server but not a job result . |
22,442 | public function sendCommand ( string $ command ) : string { try { $ this -> socket -> send ( json_encode ( [ 'action' => 'command' , 'command' => [ 'name' => $ command , ] ] ) ) ; $ result = $ this -> socket -> recv ( ) ; return $ result ; } catch ( \ ZMQException $ e ) { throw new ClientException ( $ e -> getMessage ( ) ) ; } } | Sends a controll command to server and returns servers response . |
22,443 | public function close ( ) { try { $ this -> socket -> disconnect ( $ this -> dsn ) ; } catch ( \ ZMQException $ e ) { throw new ClientException ( $ e -> getMessage ( ) ) ; } } | Closes socket connection to server . |
22,444 | public function generateUuid ( ) { $ format = '%04x%04x-%04x-%04x-%04x-%04x%04x%04x' ; return sprintf ( $ format , mt_rand ( 0 , 0xffff ) , mt_rand ( 0 , 0xffff ) , mt_rand ( 0 , 0xffff ) , mt_rand ( 0 , 0x0fff ) | 0x4000 , mt_rand ( 0 , 0x3fff ) | 0x8000 , mt_rand ( 0 , 0xffff ) , mt_rand ( 0 , 0xffff ) , mt_rand ( 0 , 0xffff ) ) ; } | Generate UUID v4 |
22,445 | public function setAutoRetryMax ( $ autoretrymax = null ) { if ( is_integer ( $ autoretrymax ) ) { if ( $ autoretrymax == 0 ) { $ this -> setAutoRetry ( false ) ; } else { $ this -> _autoretrymax = $ autoretrymax ; } } else { $ this -> _autoretrymax = self :: DEF_AUTORETRY_MAX ; } return $ this -> _autoretrymax ; } | Sets the maximum number of attempts to connect to a server before giving up . |
22,446 | public function setDisconnectTime ( $ milliseconds = null ) { if ( is_integer ( $ milliseconds ) && $ milliseconds >= self :: DEF_DISCONNECT_TIME ) { $ this -> _disconnecttime = $ milliseconds ; } else { $ this -> _disconnecttime = self :: DEF_DISCONNECT_TIME ; } return $ this -> _disconnecttime ; } | Sets the delaytime before closing the socket when disconnect . |
22,447 | public function setLogDestination ( $ type ) { switch ( $ type ) { case SMARTIRC_FILE : case SMARTIRC_STDOUT : case SMARTIRC_SYSLOG : case SMARTIRC_BROWSEROUT : case SMARTIRC_NONE : $ this -> _logdestination = $ type ; break ; default : $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: unknown logdestination type (' . $ type . '), will use STDOUT instead' , __FILE__ , __LINE__ ) ; $ this -> _logdestination = SMARTIRC_STDOUT ; } return $ this -> _logdestination ; } | Sets the destination of all log messages . |
22,448 | public function setReceiveDelay ( $ milliseconds = null ) { if ( is_integer ( $ milliseconds ) && $ milliseconds >= self :: DEF_RECEIVE_DELAY ) { $ this -> _receivedelay = $ milliseconds ; } else { $ this -> _receivedelay = self :: DEF_RECEIVE_DELAY ; } return $ this -> _receivedelay ; } | Sets the delay for receiving data from the IRC server . |
22,449 | public function setReconnectDelay ( $ milliseconds = null ) { if ( is_integer ( $ milliseconds ) ) { $ this -> _reconnectdelay = $ milliseconds ; } else { $ this -> _reconnectdelay = self :: DEF_RECONNECT_DELAY ; } return $ this -> _reconnectdelay ; } | Sets the delaytime before attempting reconnect . Value of 0 disables the delay entirely . |
22,450 | public function setSendDelay ( $ milliseconds = null ) { if ( is_integer ( $ milliseconds ) ) { $ this -> _senddelay = $ milliseconds ; } else { $ this -> _senddelay = self :: DEF_SEND_DELAY ; } return $ this -> _senddelay ; } | Sets the delay for sending data to the IRC server . |
22,451 | public function setTransmitTimeout ( $ seconds = null ) { if ( is_integer ( $ seconds ) ) { $ this -> _txtimeout = $ seconds ; } else { $ this -> _txtimeout = self :: DEF_TX_RX_TIMEOUT ; } return $ this -> _txtimeout ; } | Sets the transmit timeout . |
22,452 | public function stopBenchmark ( ) { $ this -> _benchmark_stoptime = microtime ( true ) ; $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'benchmark stopped' , __FILE__ , __LINE__ ) ; if ( $ this -> _benchmark ) { $ this -> showBenchmark ( ) ; } return $ this ; } | Stops the benchmark and displays the result . |
22,453 | public function showBenchmark ( ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'benchmark time: ' . ( ( float ) $ this -> _benchmark_stoptime - ( float ) $ this -> _benchmark_starttime ) , __FILE__ , __LINE__ ) ; return $ this ; } | Shows the benchmark result . |
22,454 | public function & getChannel ( $ channelname ) { $ err = null ; if ( ! $ this -> _channelsyncing ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: getChannel() is called and the required Channel ' . 'Syncing is not activated!' , __FILE__ , __LINE__ ) ; return $ err ; } if ( ! isset ( $ this -> _channels [ strtolower ( $ channelname ) ] ) ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: getChannel() is called and the required channel ' . $ channelname . ' has not been joined!' , __FILE__ , __LINE__ ) ; return $ err ; } return $ this -> _channels [ strtolower ( $ channelname ) ] ; } | Returns a reference to the channel object of the specified channelname . |
22,455 | public function & getUser ( $ channelname , $ username ) { if ( ! $ this -> _channelsyncing ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: getUser() is called and' . ' the required Channel Syncing is not activated!' , __FILE__ , __LINE__ ) ; return ; } if ( $ this -> isJoined ( $ channelname , $ username ) ) { return $ this -> getChannel ( $ channelname ) -> users [ strtolower ( $ username ) ] ; } } | Returns a reference to the user object for the specified username and channelname . |
22,456 | public function connect ( $ addr , $ port = 6667 , $ reconnecting = false ) { ob_implicit_flush ( ) ; $ this -> log ( SMARTIRC_DEBUG_CONNECTION , 'DEBUG_CONNECTION: connecting' , __FILE__ , __LINE__ ) ; if ( $ hasPort = preg_match ( self :: IP_PATTERN , $ addr ) ) { $ colon = strrpos ( $ addr , ':' ) ; $ this -> _address = substr ( $ addr , 0 , $ colon ) ; $ this -> _port = ( int ) substr ( $ addr , $ colon + 1 ) ; } elseif ( $ hasPort === 0 ) { $ this -> _address = $ addr ; $ this -> _port = $ port ; $ addr .= ':' . $ port ; } $ timeout = ini_get ( "default_socket_timeout" ) ; $ context = stream_context_create ( array ( 'socket' => array ( 'bindto' => $ this -> _bindto ) ) ) ; $ this -> log ( SMARTIRC_DEBUG_SOCKET , 'DEBUG_SOCKET: binding to ' . $ this -> _bindto , __FILE__ , __LINE__ ) ; if ( $ this -> _socket = stream_socket_client ( $ addr , $ errno , $ errstr , $ timeout , STREAM_CLIENT_CONNECT , $ context ) ) { if ( ! stream_set_blocking ( $ this -> _socket , 0 ) ) { $ this -> log ( SMARTIRC_DEBUG_SOCKET , 'DEBUG_SOCKET: unable to unblock stream' , __FILE__ , __LINE__ ) ; $ this -> throwError ( 'unable to unblock stream' ) ; } $ this -> log ( SMARTIRC_DEBUG_CONNECTION , 'DEBUG_CONNECTION: connected' , __FILE__ , __LINE__ ) ; $ this -> _autoretrycount = 0 ; $ this -> _connectionerror = false ; $ this -> registerTimeHandler ( $ this -> _rxtimeout * 125 , $ this , '_pingcheck' ) ; $ this -> _lasttx = $ this -> _lastrx = time ( ) ; $ this -> _updatestate ( ) ; return $ this ; } $ error_msg = "couldn't connect to \"$addr\" reason: \"$errstr ($errno)\"" ; $ this -> log ( SMARTIRC_DEBUG_SOCKET , 'DEBUG_NOTICE: ' . $ error_msg , __FILE__ , __LINE__ ) ; $ this -> throwError ( $ error_msg ) ; return ( $ reconnecting ) ? false : $ this -> reconnect ( ) ; } | Creates the sockets and connects to the IRC server on the given port . |
22,457 | function disconnect ( $ quick = false ) { if ( $ this -> _updatestate ( ) != SMARTIRC_STATE_CONNECTED ) { return false ; } if ( ! $ quick ) { $ this -> send ( 'QUIT' , SMARTIRC_CRITICAL ) ; usleep ( $ this -> _disconnecttime * 1000 ) ; } fclose ( $ this -> _socket ) ; $ this -> _updatestate ( ) ; $ this -> log ( SMARTIRC_DEBUG_CONNECTION , 'DEBUG_CONNECTION: disconnected' , __FILE__ , __LINE__ ) ; if ( $ this -> _channelsyncing ) { $ this -> _channels = array ( ) ; $ this -> log ( SMARTIRC_DEBUG_CHANNELSYNCING , 'DEBUG_CHANNELSYNCING: ' . 'cleaned channel array' , __FILE__ , __LINE__ ) ; } if ( $ this -> _usersyncing ) { $ this -> _users = array ( ) ; $ this -> log ( SMARTIRC_DEBUG_USERSYNCING , 'DEBUG_USERSYNCING: cleaned ' . 'user array' , __FILE__ , __LINE__ ) ; } if ( $ this -> _logdestination == SMARTIRC_FILE ) { fclose ( $ this -> _logfilefp ) ; $ this -> _logfilefp = null ; } else if ( $ this -> _logdestination == SMARTIRC_SYSLOG ) { closelog ( ) ; } return $ this ; } | Disconnects from the IRC server nicely with a QUIT or just destroys the socket . |
22,458 | public function reconnect ( ) { $ channels = array ( ) ; foreach ( $ this -> _channels as $ value ) { if ( empty ( $ value -> key ) ) { $ channels [ ] = array ( 'name' => $ value -> name ) ; } else { $ channels [ ] = array ( 'name' => $ value -> name , 'key' => $ value -> key ) ; } } $ this -> disconnect ( true ) ; while ( $ this -> _autoretry === true && ( $ this -> _autoretrymax == 0 || $ this -> _autoretrycount < $ this -> _autoretrymax ) && $ this -> _updatestate ( ) != SMARTIRC_STATE_CONNECTED ) { $ this -> _autoretrycount ++ ; if ( $ this -> _reconnectdelay > 0 ) { $ this -> log ( SMARTIRC_DEBUG_CONNECTION , 'DEBUG_CONNECTION: delaying ' . 'reconnect for ' . $ this -> _reconnectdelay . ' ms' , __FILE__ , __LINE__ ) ; for ( $ i = 0 ; $ i < $ this -> _reconnectdelay ; $ i ++ ) { $ this -> _callTimeHandlers ( ) ; usleep ( 1000 ) ; } } $ this -> _callTimeHandlers ( ) ; $ this -> log ( SMARTIRC_DEBUG_CONNECTION , 'DEBUG_CONNECTION: reconnecting...' , __FILE__ , __LINE__ ) ; if ( $ this -> connect ( $ this -> _address , $ this -> _port , true ) !== false ) { break ; } } if ( $ this -> _updatestate ( ) != SMARTIRC_STATE_CONNECTED ) { return false ; } $ this -> login ( $ this -> _nick , $ this -> _realname , $ this -> _usermode , $ this -> _username , $ this -> _password ) ; foreach ( $ channels as $ value ) { if ( isset ( $ value [ 'key' ] ) ) { $ this -> join ( $ value [ 'name' ] , $ value [ 'key' ] ) ; } else { $ this -> join ( $ value [ 'name' ] ) ; } } return $ this ; } | Reconnects to the IRC server with the same login info it also rejoins the channels |
22,459 | public function login ( $ nick , $ realname , $ usermode = 0 , $ username = null , $ password = null ) { $ this -> log ( SMARTIRC_DEBUG_CONNECTION , 'DEBUG_CONNECTION: logging in' , __FILE__ , __LINE__ ) ; $ this -> _nick = str_replace ( ' ' , '' , $ nick ) ; $ this -> _realname = $ realname ; if ( $ username !== null ) { $ this -> _username = str_replace ( ' ' , '' , $ username ) ; } else { $ this -> _username = str_replace ( ' ' , '' , exec ( 'whoami' ) ) ; } if ( $ password !== null ) { $ this -> _password = $ password ; $ this -> send ( 'PASS ' . $ this -> _password , SMARTIRC_CRITICAL ) ; } if ( ! is_numeric ( $ usermode ) ) { $ ipos = strpos ( $ usermode , 'i' ) ; $ wpos = strpos ( $ usermode , 'w' ) ; $ val = 0 ; if ( $ ipos ) $ val += 8 ; if ( $ wpos ) $ val += 4 ; if ( $ val == 0 ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'DEBUG_NOTICE: login() usermode (' . $ usermode . ') is not valid, using 0 instead' , __FILE__ , __LINE__ ) ; } $ usermode = $ val ; } $ this -> send ( 'NICK ' . $ this -> _nick , SMARTIRC_CRITICAL ) ; $ this -> send ( 'USER ' . $ this -> _username . ' ' . $ usermode . ' ' . SMARTIRC_UNUSED . ' :' . $ this -> _realname , SMARTIRC_CRITICAL ) ; if ( count ( $ this -> _performs ) ) { foreach ( $ this -> _performs as $ command ) { $ this -> send ( $ command , SMARTIRC_HIGH ) ; } $ this -> send ( 'NICK ' . $ this -> _nick , SMARTIRC_HIGH ) ; } return $ this ; } | login and register nickname on the IRC network |
22,460 | public function send ( $ data , $ priority = SMARTIRC_MEDIUM ) { switch ( $ priority ) { case SMARTIRC_CRITICAL : $ this -> _rawsend ( $ data ) ; break ; case SMARTIRC_HIGH : case SMARTIRC_MEDIUM : case SMARTIRC_LOW : $ this -> _messagebuffer [ $ priority ] [ ] = $ data ; break ; default : $ this -> log ( SMARTIRC_DEBUG_NOTICE , "WARNING: message ($data) " . "with an invalid priority passed ($priority), message is " . 'ignored!' , __FILE__ , __LINE__ ) ; return false ; } return $ this ; } | sends an IRC message |
22,461 | public function isJoined ( $ channel , $ nickname = null ) { if ( ! $ this -> _channelsyncing ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: isJoined() is called ' . 'and the required Channel Syncing is not activated!' , __FILE__ , __LINE__ ) ; return false ; } if ( ! isset ( $ this -> _channels [ strtolower ( $ channel ) ] ) ) { if ( $ nickname !== null ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: isJoined() is called' . ' on a user in a channel we are not joined to!' , __FILE__ , __LINE__ ) ; } return false ; } if ( $ nickname === null ) { return true ; } return isset ( $ this -> getChannel ( $ channel ) -> users [ strtolower ( $ nickname ) ] ) ; } | checks if we or the given user is joined to the specified channel and returns the result ChannelSyncing is required for this . |
22,462 | public function isFounder ( $ channel , $ nickname = null ) { if ( ! $ this -> _channelsyncing ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: isFounder() is called ' . 'and the required Channel Syncing is not activated!' , __FILE__ , __LINE__ ) ; return false ; } if ( $ nickname === null ) { $ nickname = $ this -> _nick ; } return ( $ this -> isJoined ( $ channel , $ nickname ) && $ this -> getUser ( $ channel , $ nickname ) -> founder ) ; } | Checks if we or the given user is founder on the specified channel and returns the result . ChannelSyncing is required for this . |
22,463 | public function isAdmin ( $ channel , $ nickname = null ) { if ( ! $ this -> _channelsyncing ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: isAdmin() is called ' . 'and the required Channel Syncing is not activated!' , __FILE__ , __LINE__ ) ; return false ; } if ( $ nickname === null ) { $ nickname = $ this -> _nick ; } return ( $ this -> isJoined ( $ channel , $ nickname ) && $ this -> getUser ( $ channel , $ nickname ) -> admin ) ; } | Checks if we or the given user is admin on the specified channel and returns the result . ChannelSyncing is required for this . |
22,464 | public function isOpped ( $ channel , $ nickname = null ) { if ( ! $ this -> _channelsyncing ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: isOpped() is called ' . 'and the required Channel Syncing is not activated!' , __FILE__ , __LINE__ ) ; return false ; } if ( $ nickname === null ) { $ nickname = $ this -> _nick ; } return ( $ this -> isJoined ( $ channel , $ nickname ) && $ this -> getUser ( $ channel , $ nickname ) -> op ) ; } | Checks if we or the given user is opped on the specified channel and returns the result . ChannelSyncing is required for this . |
22,465 | public function isHopped ( $ channel , $ nickname = null ) { if ( ! $ this -> _channelsyncing ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: isHopped() is called ' . 'and the required Channel Syncing is not activated!' , __FILE__ , __LINE__ ) ; return false ; } if ( $ nickname === null ) { $ nickname = $ this -> _nick ; } return ( $ this -> isJoined ( $ channel , $ nickname ) && $ this -> getUser ( $ channel , $ nickname ) -> hop ) ; } | Checks if we or the given user is hopped on the specified channel and returns the result . ChannelSyncing is required for this . |
22,466 | public function isVoiced ( $ channel , $ nickname = null ) { if ( ! $ this -> _channelsyncing ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: isVoiced() is called ' . 'and the required Channel Syncing is not activated!' , __FILE__ , __LINE__ ) ; return false ; } if ( $ nickname === null ) { $ nickname = $ this -> _nick ; } return ( $ this -> isJoined ( $ channel , $ nickname ) && $ this -> getUser ( $ channel , $ nickname ) -> voice ) ; } | Checks if we or the given user is voiced on the specified channel and returns the result . ChannelSyncing is required for this . |
22,467 | public function isBanned ( $ channel , $ hostmask ) { if ( ! $ this -> _channelsyncing ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: isBanned() is called ' . 'and the required Channel Syncing is not activated!' , __FILE__ , __LINE__ ) ; return false ; } return ( $ this -> isJoined ( $ channel ) && array_search ( $ hostmask , $ this -> getChannel ( $ channel ) -> bans ) !== false ) ; } | Checks if the hostmask is on the specified channel banned and returns the result . ChannelSyncing is required for this . |
22,468 | public function listenFor ( $ messagetype , $ regex = '.*' ) { $ listenfor = new Net_SmartIRC_listenfor ( ) ; $ this -> registerActionHandler ( $ messagetype , $ regex , array ( $ listenfor , 'handler' ) ) ; $ this -> listen ( ) ; return $ listenfor -> result ; } | waits for a special message type and returns the answer |
22,469 | public function registerActionHandler ( $ handlertype , $ regexhandler , $ object , $ methodname = '' ) { if ( ! ( $ handlertype & SMARTIRC_TYPE_ALL ) ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: passed invalid handler' . 'type to registerActionHandler()' , __FILE__ , __LINE__ ) ; return false ; } if ( ! empty ( $ methodname ) ) { $ object = array ( $ object , $ methodname ) ; } $ id = $ this -> _actionhandlerid ++ ; $ this -> _actionhandler [ ] = array ( 'id' => $ id , 'type' => $ handlertype , 'message' => $ regexhandler , 'callback' => $ object , ) ; $ this -> log ( SMARTIRC_DEBUG_ACTIONHANDLER , 'DEBUG_ACTIONHANDLER: ' . 'actionhandler(' . $ id . ') registered' , __FILE__ , __LINE__ ) ; return $ id ; } | registers a new actionhandler and returns the assigned id |
22,470 | public function unregisterActionHandler ( $ handlertype , $ regexhandler , $ object , $ methodname = '' ) { if ( ! ( $ handlertype & SMARTIRC_TYPE_ALL ) ) { $ this -> log ( SMARTIRC_DEBUG_NOTICE , 'WARNING: passed invalid handler' . 'type to unregisterActionHandler()' , __FILE__ , __LINE__ ) ; return false ; } if ( ! empty ( $ methodname ) ) { $ object = array ( $ object , $ methodname ) ; } foreach ( $ this -> _actionhandler as $ i => & $ handlerinfo ) { if ( $ handlerinfo [ 'type' ] == $ handlertype && $ handlerinfo [ 'message' ] == $ regexhandler && $ handlerinfo [ 'callback' ] == $ object ) { $ id = $ handlerinfo [ 'id' ] ; unset ( $ this -> _actionhandler [ $ i ] ) ; $ this -> log ( SMARTIRC_DEBUG_ACTIONHANDLER , 'DEBUG_ACTIONHANDLER: ' . 'actionhandler(' . $ id . ') unregistered' , __FILE__ , __LINE__ ) ; $ this -> _actionhandler = array_values ( $ this -> _actionhandler ) ; return $ this ; } } $ this -> log ( SMARTIRC_DEBUG_ACTIONHANDLER , 'DEBUG_ACTIONHANDLER: could ' . 'not find actionhandler type: "' . $ handlertype . '" message: "' . $ regexhandler . '" matching callback. Nothing unregistered' , __FILE__ , __LINE__ ) ; return false ; } | unregisters an existing actionhandler |
22,471 | public function unregisterActionId ( $ id ) { if ( is_array ( $ id ) ) { foreach ( $ id as $ each ) { $ this -> unregisterActionId ( $ each ) ; } return $ this ; } foreach ( $ this -> _actionhandler as $ i => & $ handlerinfo ) { if ( $ handlerinfo [ 'id' ] == $ id ) { unset ( $ this -> _actionhandler [ $ i ] ) ; $ this -> log ( SMARTIRC_DEBUG_ACTIONHANDLER , 'DEBUG_ACTIONHANDLER: ' . 'actionhandler(' . $ id . ') unregistered' , __FILE__ , __LINE__ ) ; $ this -> _actionhandler = array_values ( $ this -> _actionhandler ) ; return $ this ; } } $ this -> log ( SMARTIRC_DEBUG_ACTIONHANDLER , 'DEBUG_ACTIONHANDLER: could ' . 'not find actionhandler id: ' . $ id . ' _not_ unregistered' , __FILE__ , __LINE__ ) ; return false ; } | unregisters an existing actionhandler via the id |
22,472 | public function registerTimeHandler ( $ interval , $ object , $ methodname = '' ) { $ id = $ this -> _timehandlerid ++ ; if ( ! empty ( $ methodname ) ) { $ object = array ( $ object , $ methodname ) ; } $ this -> _timehandler [ ] = array ( 'id' => $ id , 'interval' => $ interval , 'callback' => $ object , 'lastmicrotimestamp' => microtime ( true ) , ) ; $ this -> log ( SMARTIRC_DEBUG_TIMEHANDLER , 'DEBUG_TIMEHANDLER: timehandler(' . $ id . ') registered' , __FILE__ , __LINE__ ) ; if ( ( $ this -> _mintimer == false ) || ( $ interval < $ this -> _mintimer ) ) { $ this -> _mintimer = $ interval ; } return $ id ; } | registers a timehandler and returns the assigned id |
22,473 | public function unregisterTimeId ( $ id ) { if ( is_array ( $ id ) ) { foreach ( $ id as $ each ) { $ this -> unregisterTimeId ( $ each ) ; } return $ this ; } foreach ( $ this -> _timehandler as $ i => & $ handlerinfo ) { if ( $ handlerinfo [ 'id' ] == $ id ) { unset ( $ this -> _timehandler [ $ i ] ) ; $ this -> log ( SMARTIRC_DEBUG_TIMEHANDLER , 'DEBUG_TIMEHANDLER: ' . 'timehandler(' . $ id . ') unregistered' , __FILE__ , __LINE__ ) ; $ this -> _timehandler = array_values ( $ this -> _timehandler ) ; $ timerarray = array ( ) ; foreach ( $ this -> _timehandler as $ values ) { $ timerarray [ ] = $ values -> interval ; } $ this -> _mintimer = ( array_multisort ( $ timerarray , SORT_NUMERIC , SORT_ASC ) && isset ( $ timerarray [ 0 ] ) ) ? $ timerarray [ 0 ] : false ; return $ this ; } } $ this -> log ( SMARTIRC_DEBUG_TIMEHANDLER , 'DEBUG_TIMEHANDLER: could not ' . "find timehandler id: $id _not_ unregistered" , __FILE__ , __LINE__ ) ; return false ; } | unregisters an existing timehandler via the id |
22,474 | public function unloadModule ( $ name ) { $ this -> log ( SMARTIRC_DEBUG_MODULES , 'DEBUG_MODULES: unloading module: ' . "$name..." , __FILE__ , __LINE__ ) ; if ( isset ( $ this -> _modules [ $ name ] ) ) { if ( in_array ( 'module_exit' , get_class_methods ( get_class ( $ this -> _modules [ $ name ] ) ) ) ) { $ this -> _modules [ $ name ] -> module_exit ( $ this ) ; } unset ( $ this -> _modules [ $ name ] ) ; $ this -> log ( SMARTIRC_DEBUG_MODULES , 'DEBUG_MODULES: successfully' . " unloaded module: $name" , __FILE__ , __LINE__ ) ; return $ this ; } $ this -> log ( SMARTIRC_DEBUG_MODULES , "DEBUG_MODULES: couldn't unload" . " module: $name (it's not loaded!)" , __FILE__ , __LINE__ ) ; return false ; } | unloads a module by the name originally loaded with |
22,475 | protected function _adduser ( & $ channel , & $ newuser ) { $ lowerednick = strtolower ( $ newuser -> nick ) ; if ( $ this -> isJoined ( $ channel -> name , $ newuser -> nick ) ) { $ this -> log ( SMARTIRC_DEBUG_CHANNELSYNCING , 'DEBUG_CHANNELSYNCING: ' . 'updating user: ' . $ newuser -> nick . ' on channel: ' . $ channel -> name , __FILE__ , __LINE__ ) ; $ currentuser = & $ channel -> users [ $ lowerednick ] ; $ props = array ( 'ident' , 'host' , 'realname' , 'ircop' , 'founder' , 'admin' , 'op' , 'hop' , 'voice' , 'away' , 'server' , 'hopcount' ) ; foreach ( $ props as $ prop ) { if ( $ newuser -> $ prop !== null ) { $ currentuser -> $ prop = $ newuser -> $ prop ; } } } else { $ this -> log ( SMARTIRC_DEBUG_CHANNELSYNCING , 'DEBUG_CHANNELSYNCING: ' . 'adding user: ' . $ newuser -> nick . ' to channel: ' . $ channel -> name , __FILE__ , __LINE__ ) ; $ channel -> users [ $ lowerednick ] = $ newuser ; } $ user = & $ channel -> users [ $ lowerednick ] ; $ modes = array ( 'founder' , 'admin' , 'op' , 'hop' , 'voice' ) ; foreach ( $ modes as $ mode ) { if ( $ user -> $ mode ) { $ this -> log ( SMARTIRC_DEBUG_CHANNELSYNCING , "DEBUG_CHANNELSYNCING: adding $mode: " . $ user -> nick . ' to channel: ' . $ channel -> name , __FILE__ , __LINE__ ) ; $ ms = $ mode . 's' ; $ channel -> { $ ms } [ $ user -> nick ] = true ; } } return $ this ; } | adds an user to the channelobject or updates his info |
22,476 | protected function _callTimeHandlers ( ) { foreach ( $ this -> _timehandler as & $ handlerinfo ) { $ microtimestamp = microtime ( true ) ; if ( $ microtimestamp >= $ handlerinfo [ 'lastmicrotimestamp' ] + ( $ handlerinfo [ 'interval' ] / 1000.0 ) ) { $ callback = $ handlerinfo [ 'callback' ] ; $ handlerinfo [ 'lastmicrotimestamp' ] = $ microtimestamp ; $ cbstring = ( is_array ( $ callback ) ) ? ( is_object ( $ callback [ 0 ] ) ? get_class ( $ callback [ 0 ] ) : $ callback [ 0 ] ) . '->' . $ callback [ 1 ] : '(anonymous function)' ; if ( is_callable ( $ callback ) ) { $ this -> log ( SMARTIRC_DEBUG_TIMEHANDLER , 'DEBUG_TIMEHANDLER: calling "' . $ cbstring . '"' , __FILE__ , __LINE__ ) ; call_user_func ( $ callback , $ this ) ; } else { $ this -> log ( SMARTIRC_DEBUG_TIMEHANDLER , 'DEBUG_TIMEHANDLER: callback is invalid! "' . $ cbstring . '"' , __FILE__ , __LINE__ ) ; } } } } | looks for any time handlers that have timed out and calls them if valid |
22,477 | protected function _pingcheck ( ) { $ time = time ( ) ; if ( $ time - $ this -> _lastrx > $ this -> _rxtimeout ) { $ this -> reconnect ( ) ; $ this -> _lastrx = $ time ; } elseif ( $ time - $ this -> _lastrx > $ this -> _rxtimeout / 2 ) { $ this -> send ( 'PING ' . $ this -> _address , SMARTIRC_CRITICAL ) ; } } | An active - pinging system to keep the bot from dropping the connection |
22,478 | protected function _rawsend ( $ data ) { if ( $ this -> _updatestate ( ) != SMARTIRC_STATE_CONNECTED ) { return false ; } $ this -> log ( SMARTIRC_DEBUG_IRCMESSAGES , 'DEBUG_IRCMESSAGES: sent: "' . $ data . '"' , __FILE__ , __LINE__ ) ; $ result = fwrite ( $ this -> _socket , $ data . SMARTIRC_CRLF ) ; if ( ! $ result ) { $ this -> _connectionerror = true ; } else { $ this -> _lasttx = time ( ) ; } return $ result ; } | sends a raw message to the IRC server |
22,479 | protected function _removeuser ( $ ircdata ) { if ( $ ircdata -> type & ( SMARTIRC_TYPE_PART | SMARTIRC_TYPE_QUIT ) ) { $ nick = $ ircdata -> nick ; } else if ( $ ircdata -> type & SMARTIRC_TYPE_KICK ) { $ nick = $ ircdata -> params [ 1 ] ; } else { $ this -> log ( SMARTIRC_DEBUG_CHANNELSYNCING , 'DEBUG_CHANNELSYNCING: ' . 'unknown TYPE (' . $ ircdata -> type . ') in _removeuser(), trying default' , __FILE__ , __LINE__ ) ; $ nick = $ ircdata -> nick ; } $ lowerednick = strtolower ( $ nick ) ; if ( $ this -> _nick == $ nick ) { $ this -> log ( SMARTIRC_DEBUG_CHANNELSYNCING , 'DEBUG_CHANNELSYNCING: we left channel: ' . $ ircdata -> channel . ' destroying...' , __FILE__ , __LINE__ ) ; unset ( $ this -> _channels [ strtolower ( $ ircdata -> channel ) ] ) ; } else { $ lists = array ( 'founders' , 'admins' , 'ops' , 'hops' , 'voices' ) ; if ( $ ircdata -> type & SMARTIRC_TYPE_QUIT ) { $ this -> log ( SMARTIRC_DEBUG_CHANNELSYNCING , 'DEBUG_CHANNELSYNCING: user ' . $ nick . ' quit, removing him from all channels' , __FILE__ , __LINE__ ) ; $ channelkeys = array_keys ( $ this -> _channels ) ; foreach ( $ channelkeys as $ channelkey ) { $ channel = & $ this -> getChannel ( $ channelkey ) ; foreach ( $ channel -> users as $ uservalue ) { if ( $ nick == $ uservalue -> nick ) { $ this -> log ( SMARTIRC_DEBUG_CHANNELSYNCING , 'DEBUG_CHANNELSYNCING: found him on channel: ' . $ channel -> name . ' destroying...' , __FILE__ , __LINE__ ) ; unset ( $ channel -> users [ $ lowerednick ] ) ; foreach ( $ lists as $ list ) { if ( isset ( $ channel -> { $ list } [ $ nick ] ) ) { $ this -> log ( SMARTIRC_DEBUG_CHANNELSYNCING , 'DEBUG_CHANNELSYNCING: removing him ' . "from $list list" , __FILE__ , __LINE__ ) ; unset ( $ channel -> { $ list } [ $ nick ] ) ; } } } } } } else { $ this -> log ( SMARTIRC_DEBUG_CHANNELSYNCING , 'DEBUG_CHANNELSYNCING: removing user: ' . $ nick . ' from channel: ' . $ ircdata -> channel , __FILE__ , __LINE__ ) ; $ channel = & $ this -> getChannel ( $ ircdata -> channel ) ; unset ( $ channel -> users [ $ lowerednick ] ) ; foreach ( $ lists as $ list ) { if ( isset ( $ channel -> { $ list } [ $ nick ] ) ) { $ this -> log ( SMARTIRC_DEBUG_CHANNELSYNCING , 'DEBUG_CHANNELSYNCING: removing him ' . "from $list list" , __FILE__ , __LINE__ ) ; unset ( $ channel -> { $ list } [ $ nick ] ) ; } } } } return $ this ; } | removes an user from one channel or all if he quits |
22,480 | public function handler ( & $ irc , & $ ircdata ) { $ irc -> log ( SMARTIRC_DEBUG_ACTIONHANDLER , 'DEBUG_ACTIONHANDLER: listenfor handler called' , __FILE__ , __LINE__ ) ; $ this -> result [ ] = $ ircdata ; $ irc -> disconnect ( ) ; } | stores the received answer into the result array |
22,481 | public function createOptionsForms ( ) { $ factory = new \ Zend \ Form \ Factory ( ) ; $ formElements = $ this -> getServiceLocator ( ) -> get ( 'FormElementManager' ) ; $ factory -> setFormElementManager ( $ formElements ) ; $ formConfig = $ this -> pluginBackConfig [ 'modal_form' ] ; $ response = [ ] ; $ render = [ ] ; if ( ! empty ( $ formConfig ) ) { foreach ( $ formConfig as $ formKey => $ config ) { $ form = $ factory -> createForm ( $ config ) ; $ request = $ this -> getServiceLocator ( ) -> get ( 'request' ) ; $ parameters = $ request -> getQuery ( ) -> toArray ( ) ; if ( ! isset ( $ parameters [ 'validate' ] ) ) { $ form -> setData ( $ this -> getFormData ( ) ) ; $ viewModelTab = new ViewModel ( ) ; $ viewModelTab -> setTemplate ( $ config [ 'tab_form_layout' ] ) ; $ viewModelTab -> modalForm = $ form ; $ viewModelTab -> formData = $ this -> getFormData ( ) ; $ viewRender = $ this -> getServiceLocator ( ) -> get ( 'ViewRenderer' ) ; $ html = $ viewRender -> render ( $ viewModelTab ) ; array_push ( $ render , [ 'name' => $ config [ 'tab_title' ] , 'icon' => $ config [ 'tab_icon' ] , 'html' => $ html ] ) ; } else { $ post = get_object_vars ( $ request -> getPost ( ) ) ; $ success = false ; $ form -> setData ( $ post ) ; $ errors = array ( ) ; if ( $ form -> isValid ( ) ) { $ data = $ form -> getData ( ) ; $ success = true ; array_push ( $ response , [ 'name' => $ this -> pluginBackConfig [ 'modal_form' ] [ $ formKey ] [ 'tab_title' ] , 'success' => $ success , ] ) ; } else { $ errors = $ form -> getMessages ( ) ; foreach ( $ errors as $ keyError => $ valueError ) { foreach ( $ config [ 'elements' ] as $ keyForm => $ valueForm ) { if ( $ valueForm [ 'spec' ] [ 'name' ] == $ keyError && ! empty ( $ valueForm [ 'spec' ] [ 'options' ] [ 'label' ] ) ) $ errors [ $ keyError ] [ 'label' ] = $ valueForm [ 'spec' ] [ 'options' ] [ 'label' ] ; } } array_push ( $ response , [ 'name' => $ this -> pluginBackConfig [ 'modal_form' ] [ $ formKey ] [ 'tab_title' ] , 'success' => $ success , 'errors' => $ errors , 'message' => '' , ] ) ; } } } } if ( ! isset ( $ parameters [ 'validate' ] ) ) { return $ render ; } else { return $ response ; } } | This function generates the form displayed when editing the parameters of the plugin |
22,482 | public function make ( $ text , $ options = null ) { $ this -> setUserOptions ( $ options ) ; $ text = $ this -> decode ( $ text ) ; $ text = trim ( $ text ) ; $ text = $ this -> lower ( $ text ) ; $ text = $ this -> strip ( $ text ) ; $ text = $ this -> filter ( $ text ) ; if ( strlen ( $ text ) > $ this -> maxlength ) { $ text = substr ( $ text , 0 , $ this -> maxlength ) ; if ( $ this -> whole_word ) { $ words = explode ( $ this -> separator , $ text ) ; $ temp = implode ( $ this -> separator , array_diff ( $ words , [ array_pop ( $ words ) ] ) ) ; if ( $ temp != '' ) { $ text = $ temp ; } } $ text = rtrim ( $ text , $ this -> separator ) ; } if ( $ text == '' ) { return $ this -> blank ; } return $ text ; } | the worker method . |
22,483 | private function setUserOptions ( $ options ) { if ( is_array ( $ options ) ) { foreach ( $ options as $ property => $ value ) { $ this -> $ property = $ value ; } } } | Set user defined options . |
22,484 | public function convertCharacters ( $ text ) { $ text = html_entity_decode ( $ text , ENT_QUOTES , $ this -> decode_charset ) ; $ text = strtr ( $ text , $ this -> translation_table ) ; return $ text ; } | Helper method that uses the translation table to convert non - ascii characters to a resonalbe alternative . |
22,485 | private function filter ( $ text ) { $ text = preg_replace ( "/[^&a-z0-9-_\s']/i" , '' , $ text ) ; $ text = str_replace ( ' ' , $ this -> separator , $ text ) ; $ text = trim ( preg_replace ( "/{$this->separator}{2,}/" , $ this -> separator , $ text ) , $ this -> separator ) ; return $ text ; } | Strip anything that isn t alphanumeric or an underscore . |
22,486 | public function onBackupStarted ( BackupEvent $ event ) { $ database = $ event -> getDatabase ( ) ; $ database -> set ( 'started' , ( new \ DateTime ( ) ) -> format ( \ DateTime :: RFC3339 ) ) ; } | Write information to database . |
22,487 | public function onBackup ( BackupEvent $ event ) { $ plugin = $ this -> pluginRegistry -> getPlugin ( $ event -> getOption ( 'plugin' ) ) ; $ optionsResolver = new OptionsResolver ( ) ; $ plugin -> configureOptionsResolver ( $ optionsResolver ) ; $ parameter = $ optionsResolver -> resolve ( $ event -> getOption ( 'parameter' ) ) ; try { $ plugin -> backup ( $ event -> getSource ( ) , $ event -> getDestination ( ) , $ event -> getDatabase ( ) , $ parameter ) ; $ event -> setStatus ( BackupStatus :: STATE_SUCCESS ) ; } catch ( \ Exception $ exception ) { $ event -> setStatus ( BackupStatus :: STATE_FAILED ) ; $ event -> setException ( $ exception ) ; } } | Executes backup for given event . |
22,488 | public function onBackupFinished ( BackupEvent $ event ) { $ database = $ event -> getDatabase ( ) ; $ database -> set ( 'finished' , ( new \ DateTime ( ) ) -> format ( \ DateTime :: RFC3339 ) ) ; $ database -> set ( 'state' , $ event -> getStatus ( ) ) ; if ( BackupStatus :: STATE_FAILED === $ event -> getStatus ( ) ) { $ database -> set ( 'exception' , $ this -> serializeException ( $ event -> getException ( ) ) ) ; } } | Write information from event to database .. |
22,489 | private function serializeException ( \ Exception $ exception ) { return [ 'message' => $ exception -> getMessage ( ) , 'code' => $ exception -> getCode ( ) , 'trace' => $ exception -> getTrace ( ) , 'file' => $ exception -> getFile ( ) , 'line' => $ exception -> getLine ( ) , 'previous' => null !== $ exception -> getPrevious ( ) ? $ this -> serializeException ( $ exception -> getPrevious ( ) ) : null , ] ; } | Serializes exception . |
22,490 | public function repositoryExists ( ) { $ schema = $ this -> em -> getConnection ( ) -> getSchemaManager ( ) ; $ tables = array_filter ( $ schema -> listTables ( ) , function ( $ value ) { return $ value -> getName ( ) === 'migrations' ; } ) ; return ! empty ( $ tables ) ; } | Determine if the migration repository exists . |
22,491 | protected function writeAndReadSocket ( $ buffer ) { $ this -> writeSocket ( $ buffer . self :: SOCKET_MSG_ENDL ) ; $ read = $ this -> readSocket ( ) ; return $ read ; } | Write data to socket and read |
22,492 | public function AuthEnable ( AuthEnableRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/etcdserverpb.Auth/AuthEnable' , $ argument , [ '\Etcdserverpb\AuthEnableResponse' , 'decode' ] , $ metadata , $ options ) ; } | AuthEnable enables authentication . |
22,493 | public function AuthDisable ( AuthDisableRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/etcdserverpb.Auth/AuthDisable' , $ argument , [ '\Etcdserverpb\AuthDisableResponse' , 'decode' ] , $ metadata , $ options ) ; } | AuthDisable disables authentication . |
22,494 | public function Authenticate ( AuthenticateRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/etcdserverpb.Auth/Authenticate' , $ argument , [ '\Etcdserverpb\AuthenticateResponse' , 'decode' ] , $ metadata , $ options ) ; } | Authenticate processes an authenticate request . |
22,495 | public function UserAdd ( AuthUserAddRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/etcdserverpb.Auth/UserAdd' , $ argument , [ '\Etcdserverpb\AuthUserAddResponse' , 'decode' ] , $ metadata , $ options ) ; } | UserAdd adds a new user . |
22,496 | public function UserGet ( AuthUserGetRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/etcdserverpb.Auth/UserGet' , $ argument , [ '\Etcdserverpb\AuthUserGetResponse' , 'decode' ] , $ metadata , $ options ) ; } | UserGet gets detailed user information . |
22,497 | public function UserList ( AuthUserListRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/etcdserverpb.Auth/UserList' , $ argument , [ '\Etcdserverpb\AuthUserListResponse' , 'decode' ] , $ metadata , $ options ) ; } | UserList gets a list of all users . |
22,498 | public function UserDelete ( AuthUserDeleteRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/etcdserverpb.Auth/UserDelete' , $ argument , [ '\Etcdserverpb\AuthUserDeleteResponse' , 'decode' ] , $ metadata , $ options ) ; } | UserDelete deletes a specified user . |
22,499 | public function UserChangePassword ( AuthUserChangePasswordRequest $ argument , $ metadata = [ ] , $ options = [ ] ) { return $ this -> _simpleRequest ( '/etcdserverpb.Auth/UserChangePassword' , $ argument , [ '\Etcdserverpb\AuthUserChangePasswordResponse' , 'decode' ] , $ metadata , $ options ) ; } | UserChangePassword changes the password of a specified user . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.