idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
5,200 | public function remove ( string $ string , bool $ caseSensitive = true ) : Manipulator { return new static ( $ this -> replace ( $ string , '' , $ caseSensitive ) -> toString ( ) ) ; } | Remove from string . |
5,201 | public function removeSpecialCharacters ( array $ exceptions = [ ] ) : Manipulator { $ regEx = "/" ; $ regEx .= "[^\w\d" ; foreach ( $ exceptions as $ exception ) { $ regEx .= "\\" . $ exception ; } $ regEx .= "]/" ; $ modifiedString = preg_replace ( $ regEx , '' , $ this -> string ) ; return new static ( $ modifiedStr... | Remove non - alphanumeric characters . |
5,202 | public function snakeToCamel ( ) : Manipulator { $ modifiedString = $ this -> replace ( '_' , ' ' ) -> capitalizeEach ( ) -> lowercaseFirst ( ) -> remove ( ' ' ) -> toString ( ) ; return new static ( $ modifiedString ) ; } | Convert snake - case to camel - case . |
5,203 | public function toCamelCase ( ) : Manipulator { $ modifiedString = '' ; foreach ( explode ( ' ' , $ this -> string ) as $ word ) { $ modifiedString .= self :: make ( $ word ) -> toLower ( ) -> capitalize ( ) -> toString ( ) ; } $ final = self :: make ( $ modifiedString ) -> replace ( ' ' , '' ) -> lowercaseFirst ( ) ->... | Convert a string to camel - case . |
5,204 | public function send ( BroadcastInterface $ broadcast = null ) { if ( $ broadcast === null && $ this -> broadcast === null ) { $ broadcast = Yii :: $ app -> getBroadcast ( ) ; } elseif ( $ broadcast === null ) { $ broadcast = $ this -> broadcast ; } return $ broadcast -> send ( $ this ) ; } | Sends this broadcast message . |
5,205 | public function registerEntityClassesMetadataDriver ( Array $ classes = array ( ) , $ namespace = 'Psc' , \ Doctrine \ Common \ Annotations \ Reader $ reader = NULL ) { if ( ! isset ( $ this -> entityClassesMetadataDriver ) ) { if ( ! isset ( $ reader ) ) { $ reader = $ this -> createAnnotationReader ( ) ; } $ this -> ... | Erstellt den EntityClassesMetadataDriver |
5,206 | public function useCache ( $ type = self :: CACHE_APC ) { if ( $ type === self :: CACHE_APC ) { $ this -> setCache ( new \ Doctrine \ Common \ Cache \ ApcCache ) ; } else { $ this -> setCache ( new \ Doctrine \ Common \ Cache \ ArrayCache ) ; } } | Overwrites the current cache |
5,207 | public static function fromEncodedDer ( $ encodedDerCert ) { $ pemCert = sprintf ( '-----BEGIN CERTIFICATE-----%s-----END CERTIFICATE-----' , PHP_EOL . wordwrap ( $ encodedDerCert , 64 , "\n" , true ) . PHP_EOL ) ; return new self ( $ pemCert ) ; } | Create a new CertParser object from the Base 64 encoded DER i . e . a base64_encode of a binary string . |
5,208 | private function toDer ( ) { $ pattern = '/.*-----BEGIN CERTIFICATE-----(.*)-----END CERTIFICATE-----.*/msU' ; $ replacement = '${1}' ; $ plainPemData = preg_replace ( $ pattern , $ replacement , $ this -> pemCert ) ; if ( null === $ plainPemData ) { throw new RuntimeException ( 'unable to extract the encoded DER data ... | Get the DER format of the certificate . |
5,209 | public function getFingerprint ( $ alg = 'sha256' ) { if ( ! in_array ( $ alg , hash_algos ( ) ) ) { throw new RuntimeException ( sprintf ( 'unsupported algorithm "%s"' , $ alg ) ) ; } return hash ( $ alg , $ this -> toDer ( ) , true ) ; } | Get the raw fingerprint of the certificate . |
5,210 | public function restart ( int $ sleep ) : void { $ this -> storage [ 'sentenced' ] = 'rewind' ; $ this -> storage [ 'sleep' ] = $ sleep ; $ this -> store ( $ this -> storage ) ; } | Gently stops daemon and starts it with new frequency |
5,211 | public function exec ( ) : void { $ this -> actionLog ( 'Script successfully entered' ) ; $ sentence = $ this -> storage [ 'sentenced' ] ; $ response = NULL ; if ( method_exists ( $ this , $ sentence ) ) $ response = $ this -> $ sentence ( ) ; else $ this -> errorLog ( 'Unknown method ' . $ sentence ) ; if ( $ response... | Makes preparations for run method Also stores memory used by daemon to be recovered |
5,212 | public static function route ( string $ command , array $ args ) : void { $ object = new static ( 'test' ) ; echo "\n" ; if ( method_exists ( static :: class , $ command ) ) { $ response = call_user_func_array ( [ $ object , $ command ] , $ args ) ; if ( $ response === NULL ) echo "SUCCESS" ; else if ( $ response === F... | Start a command to services |
5,213 | public static function _init ( ) { if ( \ ClanCats :: in_development ( ) ) { \ CCEvent :: mind ( 'response.output' , function ( $ output ) { if ( strpos ( $ output , '</body>' ) === false ) { return $ output ; } $ table = \ UI \ Table :: create ( array ( 'style' => array ( 'width' => '100%' , ) , 'cellpadding' => '5' ,... | Static init When we are in development then we append the qurey log to body |
5,214 | protected function connect ( $ name ) { if ( $ this -> _connected ) { return true ; } if ( is_array ( $ name ) ) { $ config = $ name ; } else { $ config = \ CCConfig :: create ( 'database' ) -> get ( $ name ) ; if ( is_string ( $ config ) ) { $ config = \ CCConfig :: create ( 'database' ) -> get ( $ config ) ; } } $ dr... | Try to etablish a connetion to the database . Also assign the connection and query builder to the current DB driver . |
5,215 | public function statement ( $ query , $ params = array ( ) ) { $ sth = $ this -> driver ( ) -> connection ( ) -> prepare ( $ query ) ; try { $ sth -> execute ( $ params ) ; } catch ( \ PDOException $ e ) { throw new Exception ( "DB\\Handler - PDOException: {$e->getMessage()} \n Query: {$query}" ) ; } if ( \ ClanCats ::... | Run the query and return the PDO statement |
5,216 | public function fetch ( $ query , $ params = array ( ) , $ arguments = array ( 'obj' ) ) { $ sth = $ this -> statement ( $ query , $ params ) ; $ args = null ; foreach ( $ arguments as $ argument ) { $ args |= constant ( "\PDO::FETCH_" . strtoupper ( $ argument ) ) ; } return $ sth -> fetchAll ( $ args ) ; } | Run the query and fetch the results |
5,217 | public function run ( $ query , $ params = array ( ) ) { $ sth = $ this -> statement ( $ query , $ params ) ; $ type = strtolower ( substr ( $ query , 0 , strpos ( $ query , ' ' ) ) ) ; switch ( $ type ) { case 'update' : case 'delete' : return $ sth -> rowCount ( ) ; break ; case 'insert' : return $ this -> driver ( )... | Run the query and get the correct response |
5,218 | public function get ( $ name ) { $ query = $ this -> queryAll ( ) ; return isset ( $ query [ $ name ] ) ? $ query [ $ name ] : null ; } | Get value from GET params |
5,219 | public function render ( & $ node ) { $ id = call_user_func_array ( [ & $ this , 'fetchId' ] , $ node ) ; $ output = call_user_func_array ( [ & $ this , 'fetchItem' ] , $ node ) ; list ( $ source ) = $ node ; list ( $ plugin ) = pluginSplit ( $ source ) ; $ options = [ 'id' => $ id , 'output' => $ output , 'class' => $... | Render toolbar html . |
5,220 | protected function isInIncrementsOfRange ( $ increments , $ value ) { $ incrementsParts = explode ( '/' , $ increments ) ; if ( '*' === $ incrementsParts [ 0 ] ) { return ( int ) $ value % $ incrementsParts [ 1 ] === 0 ; } if ( ! $ this -> isInRange ( $ incrementsParts [ 0 ] , $ value ) ) { return false ; } $ rangePart... | Checks if the given value is in the given increments of range . |
5,221 | protected function isInRange ( $ range , $ value ) { $ parts = explode ( '-' , $ range ) ; return $ value >= $ parts [ 0 ] && $ value <= $ parts [ 1 ] ; } | Checks if the given value is in the given range . |
5,222 | public function setControl ( Control $ control ) { $ control -> checkId ( ) ; if ( $ control instanceof Scriptable ) { $ control -> setScriptEvents ( true ) ; } $ this -> control = $ control ; return $ this ; } | Set the Profile Control |
5,223 | public static function toHex ( $ args ) { if ( func_num_args ( ) != 1 || ! is_array ( $ args ) ) { $ args = func_get_args ( ) ; } $ ret = '' ; for ( $ i = 0 ; $ i < count ( $ args ) ; $ i ++ ) $ ret .= sprintf ( '%02x' , $ args [ $ i ] ) ; return $ ret ; } | convert a number array to a hex string |
5,224 | public static function toNumbers ( $ s ) { $ ret = array ( ) ; for ( $ i = 0 ; $ i < strlen ( $ s ) ; $ i += 2 ) { $ ret [ ] = hexdec ( substr ( $ s , $ i , 2 ) ) ; } return $ ret ; } | convert a hex string to a number array |
5,225 | protected function insecureEmailChange ( ) { $ this -> user -> email = $ this -> email ; Yii :: $ app -> session -> setFlash ( 'success' , Yii :: t ( 'yuncms' , 'Your email address has been changed' ) ) ; } | Changes user s email address to given without any confirmation . |
5,226 | public function is_current_section ( ) { if ( ! isset ( $ this -> active ) ) { $ this -> active = filter_input ( INPUT_GET , 'section' ) == $ this -> get_slug ( ) ; } return $ this -> active ; } | Check if this is the current section . |
5,227 | public function get_fields ( ) { if ( ! isset ( $ this -> fields ) ) { if ( ! $ this -> has_sub_sections ( ) ) { $ this -> fields = $ this -> model [ 'fields' ] ; } else { $ this -> fields = array ( ) ; foreach ( $ this -> model [ 'subsections' ] as $ subsection ) { foreach ( $ subsection [ 'fields' ] as $ field ) { $ ... | Get the array of fields for this section . If this section has subsections the returning array will consist of all fields from all subsections . |
5,228 | public function getUser ( ) { $ this -> user = $ this -> sessionStorage -> read ( 'user' ) ; if ( ! empty ( $ this -> user ) ) { return $ this -> user ; } $ this -> exchangeToken ( ) ; return $ this -> user ; } | Get User object |
5,229 | public function getAccessToken ( ) { if ( ! empty ( $ this -> accessToken ) ) { return $ this -> accessToken ; } $ accessToken = $ this -> sessionStorage -> read ( 'access_token' ) ; if ( ! empty ( $ accessToken ) ) { $ this -> accessToken = $ accssToken ; return $ this -> accessToken ; } $ this -> exchangeToken ( ) ; ... | Get Access token . |
5,230 | public function getRefreshToken ( ) { if ( empty ( $ this -> refreshToken ) ) { $ this -> refreshToken = $ this -> sessionStorage -> read ( 'refresh_token' ) ; return $ this -> refreshToken ; } return $ this -> refreshToken ; } | Get Refresh token . |
5,231 | public function requestClientCredentials ( $ options = array ( ) ) { $ options = array_merge ( array ( 'scope' => '' , ) , $ options ) ; $ res = $ this -> sendRequest ( 'POST' , $ this -> getUrl ( 'oauth' , 'token' ) , array ( 'client_id' => $ this -> getClientId ( ) , 'client_secret' => $ this -> getClientSecret ( ) ,... | Request Client Credentials token |
5,232 | public function getLoginUrl ( $ options = array ( ) ) { $ options = array_merge ( array ( 'scope' => 'openid profile' , ) , $ options ) ; if ( isset ( $ options [ 'scope' ] ) && is_array ( $ options [ 'scope' ] ) ) { $ options [ 'scope' ] = join ( ' ' , $ options [ 'scope' ] ) ; } if ( function_exists ( 'openssl_random... | Get login url for redirect . |
5,233 | protected function exchangeToken ( ) { $ result = $ this -> requestAccessToken ( ) ; if ( $ result && ! empty ( $ result [ 'access_token' ] ) ) { $ this -> accessToken = $ result [ 'access_token' ] ; $ this -> sessionStorage -> write ( 'access_token' , $ result [ 'access_token' ] ) ; if ( ! empty ( $ result [ 'refresh_... | Exchange code to access_token |
5,234 | protected function requestUserInfo ( ) { $ res = $ this -> sendRequest ( 'GET' , $ this -> getUrl ( 'oauth' , 'userinfo' ) , array ( ) , array ( 'Authorization' => 'Bearer ' . $ this -> sessionStorage -> read ( 'access_token' ) , ) ) ; $ result = $ res -> getBody ( ) ; return json_decode ( $ result , true ) ; } | Request User Info |
5,235 | protected function requestAccessToken ( ) { $ code = $ this -> getRequestVar ( 'code' ) ; if ( ! empty ( $ code ) ) { $ res = $ this -> sendRequest ( 'POST' , $ this -> getUrl ( 'oauth' , 'token' ) , array ( 'code' => $ code , 'client_id' => $ this -> getClientId ( ) , 'client_secret' => $ this -> getClientSecret ( ) ,... | Request Access Token |
5,236 | public function getUrl ( $ type , $ path , $ params = array ( ) ) { $ url = self :: $ URL_TABLE [ $ type ] . $ path ; if ( ! empty ( $ params ) ) { $ url .= '?' . http_build_query ( $ params ) ; } return $ url ; } | Build API Url |
5,237 | protected function getCurrentUrl ( ) { $ isHttps = $ this -> getServerVar ( 'HTTPS' ) ; $ forwardedProto = $ this -> getServerVar ( 'HTTP_X_FORWARDED_PROTO' ) ; if ( $ isHttps == 'on' || $ forwardedProto === 'https' ) { $ schema = 'https://' ; } else { $ schema = 'http://' ; } $ host = $ this -> getServerVar ( 'HTTP_HO... | Get Current Url |
5,238 | protected function validateIdToken ( $ idToken ) { $ segments = explode ( '.' , $ idToken ) ; if ( count ( $ segments ) != 3 ) { throw new InvalidIdTokenException ( 'Invalid Token' ) ; } $ header = json_decode ( $ this -> decodeBase64Url ( $ segments [ 0 ] ) , true ) ; if ( empty ( $ header ) ) { throw new InvalidIdTok... | Validate ID Token |
5,239 | public function read ( $ key ) { return isset ( $ _SESSION [ $ this -> prefix . $ key ] ) ? $ _SESSION [ $ this -> prefix . $ key ] : null ; } | Read from session |
5,240 | public function build ( $ sourceDir , $ outputDir ) { $ sourceList = $ this -> findSources ( $ sourceDir , $ outputDir ) ; return array_walk ( $ sourceList , [ $ this , 'publish' ] ) ; } | Build the site . |
5,241 | protected function findSources ( $ searchIn , $ outputTo ) { $ files = iterator_to_array ( new FilesystemIterator ( $ searchIn ) ) ; return array_map ( function ( SplFileInfo $ file ) use ( $ outputTo ) { return $ this -> makeSource ( $ file , $ outputTo ) ; } , $ files ) ; } | Create array of Sources from the given input directory . |
5,242 | public function makeSource ( SplFileInfo $ file , $ outputDir ) { return new Source ( $ file -> getPathname ( ) , $ outputDir . DIRECTORY_SEPARATOR . $ file -> getFilename ( ) ) ; } | Create a Source from the given file and output dir . |
5,243 | public function clean ( $ dir , $ preserveGit = false ) { $ filesystem = new Filesystem ( ) ; if ( ! $ filesystem -> exists ( $ dir ) ) { return $ filesystem -> makeDirectory ( $ dir , 0755 , true ) ; } foreach ( new FilesystemIterator ( $ dir ) as $ file ) { if ( $ preserveGit && $ file -> getFilename ( ) == '.git' ) ... | Remove the contents of a directory but not the directory itself . |
5,244 | public function prepare ( $ sql , array $ driverOptions = array ( ) ) { $ this -> numStatements ++ ; $ pdos = $ this -> _pdo -> prepare ( $ sql , $ driverOptions ) ; return new PDOStatement ( $ this , $ pdos ) ; } | Prepare the statement SQL |
5,245 | public function query ( $ sql ) { $ this -> numExecutes ++ ; $ this -> numStatements ++ ; $ pdos = $ this -> _pdo -> query ( $ sql ) ; return new PDOStatement ( $ this , $ pdos ) ; } | Executes the statement query |
5,246 | public function import ( $ contentItem , $ target , $ includeParent = false , $ includeChildren = true , $ duplicateStrategy = 'Overwrite' , $ params = array ( ) ) { $ this -> runOnImportStart ( ) ; $ this -> params = $ params ; $ queuedVersion = 'Queued' . get_class ( $ this ) ; if ( $ this -> config ( ) -> use_queue ... | Import from a content source to a particular target |
5,247 | protected function importChildren ( $ children , $ parent , $ includeChildren , $ duplicateStrategy ) { if ( ! $ children ) { return ; } foreach ( $ children as $ child ) { $ pageType = $ this -> getExternalType ( $ child ) ; if ( isset ( $ this -> contentTransforms [ $ pageType ] ) ) { $ transformer = $ this -> conten... | Execute the importing of several children |
5,248 | public function getBase64Tag ( ) { if ( $ this -> owner -> exists ( ) ) { $ url = $ this -> owner -> getBase64Source ( ) ; $ title = ( $ this -> owner -> Title ) ? $ this -> owner -> Title : $ this -> owner -> Filename ; if ( $ this -> owner -> Title ) { $ title = Convert :: raw2att ( $ this -> owner -> Title ) ; } els... | Return an XHTML img tag for this Image . |
5,249 | public function getBase64Source ( ) { $ Fullpath = $ this -> owner -> getFullPath ( ) ; $ cache = SS_Cache :: factory ( 'Base64Image' ) ; $ cachekey = md5 ( $ Fullpath ) ; if ( ! ( $ Base64Image = $ cache -> load ( $ cachekey ) ) ) { $ Base64Image = base64_encode ( file_get_contents ( $ Fullpath ) ) ; $ cache -> save (... | retrun the Base64 Notation of the Image |
5,250 | public function DetectFace ( ) { $ detector = new svay \ FaceDetector ( ) ; $ detector -> faceDetect ( $ this -> owner -> getFullPath ( ) ) ; return $ detector -> getFace ( ) ; } | Detect a Face inside the image |
5,251 | public function DetectedFace ( ) { if ( $ this -> owner -> exists ( ) ) { $ cacheFile = $ this -> owner -> cacheDetectedFaceFilename ( ) ; if ( ! file_exists ( Director :: baseFolder ( ) . "/" . $ cacheFile ) || isset ( $ _GET [ 'flush' ] ) ) { $ this -> owner -> generateDetectedFaceImage ( ) ; } if ( $ this -> owner i... | returns the image with the face marked in a red square |
5,252 | public function getMergedImage ( $ format , $ padding , $ mergeimage ) { if ( $ this -> owner -> exists ( ) && Director :: fileExists ( $ mergeimage ) ) { $ cacheFile = $ this -> owner -> cacheMergedFilename ( $ format , $ padding , $ mergeimage ) ; if ( ! file_exists ( Director :: baseFolder ( ) . "/" . $ cacheFile ) ... | Return an image object representing the merged image . |
5,253 | public function generateMergedImage ( $ padding , $ bgImagePath , $ overlayImagePath , $ cacheFile ) { $ bgImage = Injector :: inst ( ) -> createWithArgs ( Image :: get_backend ( ) , array ( $ bgImagePath ) ) ; $ ovImage = Injector :: inst ( ) -> createWithArgs ( Image :: get_backend ( ) , array ( $ overlayImagePath ) ... | genereate the merged image |
5,254 | public function ToJPEG ( $ quality = null , $ backgroundColor = null ) { if ( ! $ quality ) $ quality = Config :: inst ( ) -> get ( 'ExtendedImage' , 'get_jpeg_default_quality' ) ; if ( ! $ backgroundColor ) $ backgroundColor = Config :: inst ( ) -> get ( 'ExtendedImage' , 'get_jpeg_default_background_color' ) ; return... | Generate a jpeg image from the source |
5,255 | public function checkRequired ( $ required ) { foreach ( $ required as $ fieldRequired ) { if ( ! isset ( $ this -> _parameters [ $ fieldRequired ] ) ) { throw new CommandsException ( "The parameter '$fieldRequired' is required for this script" ) ; } } } | Check that a set of parameters has been received . |
5,256 | public function showHelp ( $ possibleParameters ) { echo get_class ( $ this ) . ' - Usage:' . PHP_EOL . PHP_EOL ; foreach ( $ possibleParameters as $ parameter => $ description ) { echo html_entity_decode ( $ description , ENT_COMPAT , $ this -> _encoding ) . PHP_EOL ; } } | Displays help for the script . |
5,257 | public function getOptions ( $ filters = null ) { if ( ! $ filters ) { return $ this -> _parameters ; } $ result = [ ] ; foreach ( $ this -> _parameters as $ param ) { $ result [ ] = $ this -> filter ( $ param , $ filters ) ; } return $ result ; } | Returns all received options . |
5,258 | public function getOption ( $ option , $ filters = null , $ defaultValue = null ) { if ( is_array ( $ option ) ) { foreach ( $ option as $ optionItem ) { if ( isset ( $ this -> _parameters [ $ optionItem ] ) ) { if ( $ filters !== null ) { return $ this -> filter ( $ this -> _parameters [ $ optionItem ] , $ filters ) ;... | Returns the value of an option received . |
5,259 | public function isReceivedOption ( $ option ) { if ( ! is_array ( $ option ) ) { $ option = [ $ option ] ; } foreach ( $ option as $ op ) { if ( isset ( $ this -> _parameters [ $ op ] ) ) { return true ; } } return false ; } | Indicates whether the script was a particular option . |
5,260 | public function getLastUnNamedParam ( ) { foreach ( array_reverse ( $ this -> _parameters ) as $ key => $ value ) { if ( is_numeric ( $ key ) ) { return $ value ; } } return false ; } | Gets the last parameter is not associated with any parameter name . |
5,261 | public function printParameters ( $ parameters ) { $ length = 0 ; foreach ( $ parameters as $ parameter => $ description ) { if ( $ length == 0 ) { $ length = strlen ( $ parameter ) ; } if ( strlen ( $ parameter ) > $ length ) { $ length = strlen ( $ parameter ) ; } } print Color :: head ( 'Options:' ) . PHP_EOL ; fore... | Prints the available options in the script |
5,262 | protected function findModel ( $ id ) { if ( ( $ model = Order :: findOne ( $ id ) ) !== null ) { return $ model ; } else { throw new NotFoundHttpException ( t ( 'app' , 'The requested page does not exist.' ) ) ; } } | Finds the Order model based on its primary key value . If the model is not found a 404 HTTP exception will be thrown . |
5,263 | public function getDom ( $ path ) { $ dom = new \ DOMDocument ( '1.0' , 'utf8' ) ; if ( ( $ content = $ this -> getContent ( $ path ) ) && $ dom -> loadHTML ( $ content ) ) { return $ dom ; } else { return ; } } | Get DOMDocument from path . |
5,264 | public function getContent ( $ path ) { $ response = $ this -> getBrowser ( ) -> get ( $ path ) -> send ( ) ; if ( $ response -> isError ( ) ) { throw new \ RuntimeException ( 'Failed to query the server ' . $ this -> host ) ; } if ( $ response -> getStatusCode ( ) !== 200 || ! ( $ html = $ response -> getBody ( true )... | Get content from path . |
5,265 | protected function getBrowser ( ) { if ( ! ( $ this -> browser instanceof Client ) ) { $ this -> browser = new Client ( $ this -> host ) ; $ user_agent = self :: DEFAULT_USER_AGENT ; if ( $ this -> request ) { $ user_agent = $ this -> request -> server -> get ( 'HTTP_USER_AGENT' , self :: DEFAULT_USER_AGENT ) ; } $ thi... | Get HTTP browser . |
5,266 | public function validate ( $ columns = null ) { $ res = $ this -> doValidate ( $ columns ) ; if ( $ res === true ) { $ this -> validationFailures = array ( ) ; return true ; } $ this -> validationFailures = $ res ; return false ; } | Validates the objects modified field values and all objects related to this table . |
5,267 | public static function mock ( $ mockedClass ) { $ reflection = self :: getMockReflection ( $ mockedClass ) ; return static :: mockClass ( $ reflection , self :: $ namespace , self :: $ classBasePrefix ) ; } | Mocking interfaces & classes |
5,268 | public static function partialMock ( $ mockedClass ) { $ reflection = self :: getMockReflection ( $ mockedClass ) ; return static :: mockClass ( $ reflection , self :: $ namespace , self :: $ classBasePrefix , MockTypes :: PARTIAL ) ; } | Partial Mocking interfaces & classes |
5,269 | protected static function _isMethodStubbed ( $ className , $ instanceId , $ methodName ) { if ( ! isset ( self :: $ returnValues [ $ className ] [ $ instanceId ] [ $ methodName ] ) ) { return false ; } return true ; } | Checking if a method with specific arguments has been stubbed |
5,270 | protected static function _createChainResponse ( $ mockClassInstanceId , $ mockClassType , $ chainedMethodsBefore , $ currentMethod , $ args ) { $ currentMethodName = key ( $ currentMethod ) ; $ rReturnValues = & self :: getMockHierarchyResponse ( $ chainedMethodsBefore , $ mockClassType , $ mockClassInstanceId ) ; $ s... | Setting up a chained mock response function is called from mocked classes |
5,271 | protected static function _setWhenMockResponse ( $ className , $ instanceId , $ methodName , $ args , $ action , $ returns ) { $ args = serialize ( $ args ) ; $ returnValues = array ( ) ; $ returnValues [ $ className ] [ $ instanceId ] [ $ methodName ] [ $ args ] [ 'response' ] = [ 'action' => $ action , 'value' => $ r... | Setting up a mock response function is called from mocked classes |
5,272 | protected static function _addChainedResponse ( $ response ) { $ firstChainedMethodName = key ( $ response ) ; if ( isset ( self :: $ returnValues [ $ firstChainedMethodName ] ) ) { self :: $ returnValues [ $ firstChainedMethodName ] = array_replace_recursive ( self :: $ returnValues [ $ firstChainedMethodName ] , $ re... | Adding chained response to ReturnValues array |
5,273 | private static function & getMockHierarchyResponse ( $ chainedMethodsBefore , $ mockClassType , $ mockClassInstanceId ) { $ rReturnValues = & self :: $ returnValues [ $ mockClassType ] [ $ mockClassInstanceId ] ; foreach ( $ chainedMethodsBefore as $ chainedMethod ) { $ chainedMethodName = key ( $ chainedMethod ) ; $ c... | Returns the mock hierarchy response values |
5,274 | public function quantifyYCbCr ( ) { $ inc = $ this -> iteratorIncrement ; $ width = $ this -> width ( ) ; $ height = $ this -> height ( ) ; list ( $ Cb1 , $ Cb2 , $ Cr1 , $ Cr2 ) = $ this -> boundsCbCr ; $ white = $ this -> excludeWhite ; $ black = $ this -> excludeBlack ; $ total = $ count = 0 ; for ( $ x = 0 ; $ x < ... | Quantify flesh color amount using YCbCr color model |
5,275 | public function isPorn ( $ threshold = FALSE ) { return $ threshold === FALSE ? $ this -> quantifyYCbCr ( ) >= $ this -> threshold : $ this -> quantifyYCbCr ( ) >= $ threshold ; } | Check if image is of pornographic content |
5,276 | function Link ( $ action = null ) { $ cur = Controller :: curr ( ) ; if ( $ cur instanceof ExternalContentPage_Controller ) { return $ cur -> data ( ) -> LinkFor ( $ this , 'view' ) ; } return ExternalContentPage_Controller :: URL_STUB . '/view/' . $ this -> ID ; } | Return a URL that simply links back to the externalcontentadmin class view action |
5,277 | public function DownloadLink ( ) { $ cur = Controller :: curr ( ) ; if ( $ cur instanceof ExternalContentPage_Controller ) { return $ cur -> data ( ) -> LinkFor ( $ this , 'download' ) ; } return ExternalContentPage_Controller :: URL_STUB . '/download/' . $ this -> ID ; } | Where this can be downloaded from |
5,278 | public function stageChildren ( $ showAll = false ) { if ( $ this -> Title != 'Content Root' && $ this -> source ) { $ children = new ArrayList ( ) ; $ item = new ExternalContentItem ( $ this -> source , $ this -> Title . '1' ) ; $ item -> Title = $ this -> Title . '1' ; $ item -> MenuTitle = $ item -> Title ; $ childr... | Overridden to load all children from a remote content source instead of this node directly |
5,279 | public function Children ( ) { if ( ! $ this -> children ) { $ this -> children = new ArrayList ( ) ; $ kids = $ this -> stageChildren ( ) ; if ( $ kids ) { foreach ( $ kids as $ child ) { if ( $ child -> canView ( ) ) { $ this -> children -> push ( $ child ) ; } } } } return $ this -> children ; } | Handle a children call by retrieving from stageChildren |
5,280 | public function getCMSFields ( ) { $ fields = parent :: getCMSFields ( ) ; $ fields -> removeByName ( 'ParentID' ) ; if ( count ( $ this -> remoteProperties ) ) { $ mapping = $ this -> editableFieldMapping ( ) ; foreach ( $ this -> remoteProperties as $ name => $ value ) { $ field = null ; if ( isset ( $ mapping [ $ na... | For now just show a field that says this can t be edited |
5,281 | public static function fromArray ( array $ data ) { if ( ! array_key_exists ( 'client_id' , $ data ) ) throw new ClientConfigurationException ( 'Configuration file has no client_id set' ) ; if ( ! array_key_exists ( 'client_secret' , $ data ) ) throw new ClientConfigurationException ( 'Configuration file has no client_... | creates a configuration from array |
5,282 | public static function fromFile ( $ filename ) { $ filename = realpath ( $ filename ) ; if ( $ filename === false ) throw new ClientConfigurationException ( 'Configuration file ' . $ filename . ' does not exists' ) ; return static :: fromArray ( include $ filename ) ; } | creates a configuration from a php file returning an array |
5,283 | public function getDefaultSchema ( ) : ? Builder { $ manager = DB :: getFacadeRoot ( ) ; if ( isset ( $ manager ) && ! is_null ( $ manager -> connection ( ) ) ) { return Schema :: getFacadeRoot ( ) ; } return $ manager ; } | Get a default schema value if any is available |
5,284 | public function addGetParam ( $ param , $ value = true ) { if ( ! is_scalar ( $ param ) ) { throw new \ Exception ( "Param name must be scalar" ) ; } if ( is_string ( $ value ) ) { $ value = trim ( $ value ) ; } $ this -> queryParams [ trim ( $ param ) ] = $ value ; return $ this ; } | Add a GET parameter |
5,285 | public function addPostParam ( $ param , $ value = true ) { if ( ! is_scalar ( $ param ) ) { throw new \ Exception ( "Param name must be scalar" ) ; } if ( is_string ( $ value ) ) { $ value = trim ( $ value ) ; } $ this -> postParams [ trim ( $ param ) ] = $ value ; return $ this ; } | Add a POST parameter |
5,286 | public function setSearchTerm ( $ searchTerm ) { if ( ! is_scalar ( $ searchTerm ) ) { throw new \ Exception ( "Search term must be a string" ) ; } $ this -> searchTerm = trim ( $ searchTerm ) ; return $ this ; } | Set a search term for the request |
5,287 | public function getGetParams ( ) { if ( isset ( $ this -> searchTerm ) ) { $ this -> queryParams [ 'q' ] = $ this -> searchTerm ; } return $ this -> queryParams ; } | Get the request GET params |
5,288 | public function toArray ( ) { $ params = [ ] ; if ( isset ( $ this -> searchTerm ) ) { $ params [ 'q' ] = $ this -> searchTerm ; } if ( isset ( $ this -> parameters ) ) { foreach ( $ this -> parameters as $ paramKey => $ paramVal ) { $ params [ $ paramKey ] = $ paramVal ; } } return $ params ; } | This should no longer be needed todo remove |
5,289 | public function bySystemReferenceTypeBySystemReferenceIdAndByOrganization ( $ systemReferenceType , $ systemReferenceId , $ organizationId , $ databaseConnectionName = null ) { if ( empty ( $ databaseConnectionName ) ) { $ databaseConnectionName = $ this -> databaseConnectionName ; } return $ this -> File -> setConnect... | Retrieve files by system reference type and system reference id |
5,290 | protected function widgetSelector ( \ Psc \ HTML \ Tag $ tag = NULL , $ subSelector = NULL ) { $ jQuery = \ Psc \ JS \ jQuery :: getClassSelector ( $ tag ? : $ this -> html ) ; if ( isset ( $ subSelector ) ) { $ jQuery .= sprintf ( ".find(%s)" , \ Psc \ JS \ Helper :: convertString ( $ subSelector ) ) ; } return $ this... | denn das hier hat nix mit joose zu tun |
5,291 | public static function getEventLabels ( ) { return array ( self :: ENTRYSUBMIT , self :: KEYPRESS , self :: MOUSECLICK , self :: MOUSEOUT , self :: MOUSEOVER ) ; } | Get the possible event label names |
5,292 | public function getDbManager ( ) : ? DatabaseManager { if ( ! $ this -> hasDbManager ( ) ) { $ this -> setDbManager ( $ this -> getDefaultDbManager ( ) ) ; } return $ this -> dbManager ; } | Get db manager |
5,293 | public function initApiLogs ( $ overrideExisting = true ) { if ( null !== $ this -> collApiLogs && ! $ overrideExisting ) { return ; } $ this -> collApiLogs = new PropelObjectCollection ( ) ; $ this -> collApiLogs -> setModel ( 'ApiLog' ) ; } | Initializes the collApiLogs collection . |
5,294 | public function getApiLogs ( $ criteria = null , PropelPDO $ con = null ) { $ partial = $ this -> collApiLogsPartial && ! $ this -> isNew ( ) ; if ( null === $ this -> collApiLogs || null !== $ criteria || $ partial ) { if ( $ this -> isNew ( ) && null === $ this -> collApiLogs ) { $ this -> initApiLogs ( ) ; } else { ... | Gets an array of ApiLog objects which contain a foreign key that references this object . |
5,295 | public function countApiLogs ( Criteria $ criteria = null , $ distinct = false , PropelPDO $ con = null ) { $ partial = $ this -> collApiLogsPartial && ! $ this -> isNew ( ) ; if ( null === $ this -> collApiLogs || null !== $ criteria || $ partial ) { if ( $ this -> isNew ( ) && null === $ this -> collApiLogs ) { retur... | Returns the number of related ApiLog objects . |
5,296 | public function addApiLog ( ApiLog $ l ) { if ( $ this -> collApiLogs === null ) { $ this -> initApiLogs ( ) ; $ this -> collApiLogsPartial = true ; } if ( ! in_array ( $ l , $ this -> collApiLogs -> getArrayCopy ( ) , true ) ) { $ this -> doAddApiLog ( $ l ) ; if ( $ this -> apiLogsScheduledForDeletion and $ this -> a... | Method called to associate a ApiLog object to this object through the ApiLog foreign key attribute . |
5,297 | public function initRemoteHistoryContaos ( $ overrideExisting = true ) { if ( null !== $ this -> collRemoteHistoryContaos && ! $ overrideExisting ) { return ; } $ this -> collRemoteHistoryContaos = new PropelObjectCollection ( ) ; $ this -> collRemoteHistoryContaos -> setModel ( 'RemoteHistoryContao' ) ; } | Initializes the collRemoteHistoryContaos collection . |
5,298 | public function getRemoteHistoryContaos ( $ criteria = null , PropelPDO $ con = null ) { $ partial = $ this -> collRemoteHistoryContaosPartial && ! $ this -> isNew ( ) ; if ( null === $ this -> collRemoteHistoryContaos || null !== $ criteria || $ partial ) { if ( $ this -> isNew ( ) && null === $ this -> collRemoteHist... | Gets an array of RemoteHistoryContao objects which contain a foreign key that references this object . |
5,299 | public function countRemoteHistoryContaos ( Criteria $ criteria = null , $ distinct = false , PropelPDO $ con = null ) { $ partial = $ this -> collRemoteHistoryContaosPartial && ! $ this -> isNew ( ) ; if ( null === $ this -> collRemoteHistoryContaos || null !== $ criteria || $ partial ) { if ( $ this -> isNew ( ) && n... | Returns the number of related RemoteHistoryContao objects . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.