idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
236,700 | final public function readInt24BE ( ) { if ( $ this -> isLittleEndian ( ) ) { return $ this -> fromInt24 ( strrev ( $ this -> read ( 3 ) ) ) ; } else { return $ this -> fromInt24 ( $ this -> read ( 3 ) ) ; } } | Reads 3 bytes from the stream and returns big - endian ordered binary data as signed 24 - bit integer . |
236,701 | private function fromUInt24 ( $ value , $ order = 0 ) { list ( , $ int ) = unpack ( ( $ order == self :: BIG_ENDIAN_ORDER ? 'N' : ( $ order == self :: LITTLE_ENDIAN_ORDER ? 'V' : 'L' ) ) . '*' , $ this -> isLittleEndian ( ) ? ( "\x00" . $ value ) : ( $ value . "\x00" ) ) ; return $ int ; } | Returns machine endian ordered binary data as unsigned 24 - bit integer . |
236,702 | final public function readInt32LE ( ) { if ( $ this -> isBigEndian ( ) ) { return $ this -> fromInt32 ( strrev ( $ this -> read ( 4 ) ) ) ; } else { return $ this -> fromInt32 ( $ this -> read ( 4 ) ) ; } } | Reads 4 bytes from the stream and returns little - endian ordered binary data as signed 32 - bit integer . |
236,703 | final public function readInt32BE ( ) { if ( $ this -> isLittleEndian ( ) ) { return $ this -> fromInt32 ( strrev ( $ this -> read ( 4 ) ) ) ; } else { return $ this -> fromInt32 ( $ this -> read ( 4 ) ) ; } } | Reads 4 bytes from the stream and returns big - endian ordered binary data as signed 32 - bit integer . |
236,704 | final public function readUInt32LE ( ) { if ( PHP_INT_SIZE < 8 ) { list ( , $ lo , $ hi ) = unpack ( 'v*' , $ this -> read ( 4 ) ) ; return $ hi * ( 0xffff + 1 ) + $ lo ; } else { list ( , $ int ) = unpack ( 'V*' , $ this -> read ( 4 ) ) ; return $ int ; } } | Reads 4 bytes from the stream and returns little - endian ordered binary data as unsigned 32 - bit integer . |
236,705 | final public function readUInt32 ( ) { if ( PHP_INT_SIZE < 8 ) { if ( $ this -> isLittleEndian ( ) ) { list ( , $ lo , $ hi ) = unpack ( 'S*' , $ this -> read ( 4 ) ) ; } else { list ( , $ hi , $ lo ) = unpack ( 'S*' , $ this -> read ( 4 ) ) ; } return $ hi * ( 0xffff + 1 ) + $ lo ; } else { list ( , $ int ) = unpack (... | Reads 4 bytes from the stream and returns machine ordered binary data as unsigned 32 - bit integer . |
236,706 | final public function readInt64LE ( ) { list ( , $ lolo , $ lohi , $ hilo , $ hihi ) = unpack ( 'v*' , $ this -> read ( 8 ) ) ; return ( $ hihi * ( 0xffff + 1 ) + $ hilo ) * ( 0xffffffff + 1 ) + ( $ lohi * ( 0xffff + 1 ) + $ lolo ) ; } | Reads 8 bytes from the stream and returns little - endian ordered binary data as 64 - bit float . |
236,707 | final public function readFloatLE ( ) { if ( $ this -> isBigEndian ( ) ) { return $ this -> fromFloat ( strrev ( $ this -> read ( 4 ) ) ) ; } else { return $ this -> fromFloat ( $ this -> read ( 4 ) ) ; } } | Reads 4 bytes from the stream and returns little - endian ordered binary data as a 32 - bit float point number as defined by IEEE 754 . |
236,708 | final public function readFloatBE ( ) { if ( $ this -> isLittleEndian ( ) ) { return $ this -> fromFloat ( strrev ( $ this -> read ( 4 ) ) ) ; } else { return $ this -> fromFloat ( $ this -> read ( 4 ) ) ; } } | Reads 4 bytes from the stream and returns big - endian ordered binary data as a 32 - bit float point number as defined by IEEE 754 . |
236,709 | final public function readDoubleLE ( ) { if ( $ this -> isBigEndian ( ) ) { return $ this -> fromDouble ( strrev ( $ this -> read ( 8 ) ) ) ; } else { return $ this -> fromDouble ( $ this -> read ( 8 ) ) ; } } | Reads 8 bytes from the stream and returns little - endian ordered binary data as a 64 - bit floating point number as defined by IEEE 754 . |
236,710 | final public function readDoubleBE ( ) { if ( $ this -> isLittleEndian ( ) ) { return $ this -> fromDouble ( strrev ( $ this -> read ( 8 ) ) ) ; } else { return $ this -> fromDouble ( $ this -> read ( 8 ) ) ; } } | Reads 8 bytes from the stream and returns big - endian ordered binary data as a 64 - bit float point number as defined by IEEE 754 . |
236,711 | final public function readGuid ( ) { $ C = @ unpack ( 'V1V/v2v/N2N' , $ this -> read ( 16 ) ) ; list ( $ hex ) = @ unpack ( 'H*0' , pack ( 'NnnNN' , $ C [ 'V' ] , $ C [ 'v1' ] , $ C [ 'v2' ] , $ C [ 'N1' ] , $ C [ 'N2' ] ) ) ; if ( implode ( '' , unpack ( 'H*' , pack ( 'H*' , 'a' ) ) ) == 'a00' ) { $ hex = substr ( $ h... | Reads 16 bytes from the stream and returns the little - endian ordered binary data as mixed - ordered hexadecimal GUID string . |
236,712 | public function close ( ) { if ( $ this -> fileDescriptor !== null ) { @ fclose ( $ this -> fileDescriptor ) ; $ this -> fileDescriptor = null ; } } | Closes the stream . Once a stream has been closed further calls to read methods will throw an exception . Closing a previously - closed stream however has no effect . |
236,713 | private function getEndianess ( ) { if ( 0 === self :: $ endianess ) { self :: $ endianess = $ this -> fromInt32 ( "\x01\x00\x00\x00" ) == 1 ? self :: LITTLE_ENDIAN_ORDER : self :: BIG_ENDIAN_ORDER ; } return self :: $ endianess ; } | Returns the current machine endian order . |
236,714 | public function findPendingInvitationsQuery ( UserInterface $ user ) { $ qb = $ this -> createQueryBuilder ( 'i' ) ; return $ qb -> join ( 'i.event' , 'e' ) -> andWhere ( $ qb -> expr ( ) -> eq ( 'e.active' , ':active' ) ) -> andWhere ( $ qb -> expr ( ) -> gt ( 'e.end' , ':now' ) ) -> andWhere ( $ qb -> expr ( ) -> isN... | Build query to find pending invitations for a user . |
236,715 | public function findOtherInvitationsQuery ( UserInterface $ user ) { $ qb = $ this -> createQueryBuilder ( 'i' ) ; return $ qb -> join ( 'i.event' , 'e' ) -> andWhere ( $ qb -> expr ( ) -> eq ( 'e.active' , ':active' ) ) -> andWhere ( $ qb -> expr ( ) -> orX ( $ qb -> expr ( ) -> lt ( 'e.end' , ':now' ) , $ qb -> expr ... | Build query to find other invitations for a user . |
236,716 | public function hasReadAccess ( ) : bool { return $ this -> isOpen ( ) && ( $ this -> access == static :: ACCESS_READ || $ this -> access == static :: ACCESS_READWRITE ) ; } | Returns if reading is enabled . |
236,717 | public function hasWriteAccess ( ) : bool { return $ this -> isOpen ( ) && ( $ this -> access == static :: ACCESS_WRITE || $ this -> access == static :: ACCESS_READWRITE ) ; } | Returns if writing is enabled . |
236,718 | public function writeCsv ( array $ dataRow , string $ delimiter = ',' , bool $ fast = false ) : bool { if ( ! $ fast ) { if ( ! $ this -> isOpen ( ) ) { return false ; } if ( ! $ this -> hasWriteAccess ( ) ) { throw FileAccessError :: Write ( 'IO' , $ this -> file , \ sprintf ( 'Current mode of opened file is "%s" and ... | Write a csv format data row defined as array . |
236,719 | public function setPointerPosition ( int $ offset = 0 ) : bool { if ( ! \ is_resource ( $ this -> fp ) ) { return false ; } return ( bool ) \ fseek ( $ this -> fp , $ offset ) ; } | Sets a new file pointer position . |
236,720 | public function setPointerPositionToEndOfFile ( ) : bool { if ( ! \ is_resource ( $ this -> fp ) ) { return false ; } return ( bool ) \ fseek ( $ this -> fp , 0 , \ SEEK_END ) ; } | Sets the file pointer position to the end of the file . |
236,721 | public static function Create ( string $ file , $ mode = 0750 , bool $ overwrite = true , $ contents = '' ) { $ f = File :: CreateNew ( $ file , $ overwrite , true , true , $ mode ) ; $ f -> write ( $ contents ) ; $ f -> close ( ) ; } | Creates a new file with the defined content . |
236,722 | public static function Zip ( string $ sourceFile , string $ zipFile , string $ workingDir = null ) { if ( ! \ class_exists ( '\\ZipArchive' ) ) { throw new MissingExtensionError ( 'ZIP' , 'IO' , 'Can not ZIP the file "' . $ sourceFile . '"!' ) ; } $ owd = Path :: Unixize ( \ getcwd ( ) ) ; if ( empty ( $ workingDir ) )... | Compresses the defined source file to defined ZIP archive file . |
236,723 | public static function GetNameWithoutExtension ( string $ file , bool $ doubleExtension = false ) { if ( \ FALSE === ( $ ext = static :: GetExtension ( $ file , $ doubleExtension ) ) ) { return \ basename ( $ file ) ; } return \ substr ( \ basename ( $ file ) , 0 , - \ strlen ( $ ext ) ) ; } | Returns the file name without the file name extension . |
236,724 | public static function intcmp ( $ a , $ b ) { return ( $ a - $ b ) ? ( $ a - $ b ) / abs ( $ a - $ b ) : 0 ; } | Returns an integer less than equal to or greater than zero if the first argument is considered to be respectively less than equal to or greater than the second . |
236,725 | public function getFolders ( ) { $ result = [ ] ; $ files = glob ( $ this -> path . '*' , GLOB_ONLYDIR ) ; if ( $ files ) { foreach ( $ files as $ f ) { $ result [ ] = self :: getInstance ( $ f ) ; } } return $ result ; } | returns all FilesystemFolder instances in folder |
236,726 | public function getParentFolder ( $ force = FALSE ) { if ( ! isset ( $ this -> parentFolder ) || $ force ) { $ parentPath = realpath ( $ this -> path . '..' ) ; if ( $ parentPath === $ this -> path ) { $ this -> parentFolder = FALSE ; } else { $ this -> parentFolder = self :: getInstance ( $ parentPath ) ; } } return $... | return parent FilesystemFolder of current folder returns NULL when current folder is already the root folder |
236,727 | public function createFolder ( $ folderName ) { if ( ! ( $ path = realpath ( $ folderName ) ) ) { $ path = $ this -> path . $ folderName ; } else if ( strpos ( $ path , $ this -> path ) !== 0 ) { throw new FilesystemFolderException ( sprintf ( "Folder %s cannot be created within folder %s." , $ folderName , $ this -> p... | create a new subdirectory returns newly created FilesystemFolder object |
236,728 | public function purgeCache ( $ force = FALSE ) { if ( ( $ path = $ this -> getCachePath ( $ force ) ) ) { foreach ( glob ( $ path . '*' ) as $ f ) { if ( ! unlink ( $ f ) ) { throw new FilesystemFolderException ( sprintf ( 'Cache folder %s could not be purged!' , $ this -> path . self :: CACHE_PATH ) ) ; } } } } | empties the cache when found |
236,729 | public function setCharset ( $ charset ) { $ this -> _database -> exec ( 'ALTER TABLE ' . $ this -> _database -> prepareIdentifier ( $ this -> _name ) . ' CONVERT TO CHARACTER SET ' . $ this -> _database -> prepareValue ( $ charset , Column :: TYPE_VARCHAR ) ) ; } | Set character set and convert data to new character set |
236,730 | public function getEngine ( ) { if ( ! $ this -> _engine ) { $ table = $ this -> _database -> query ( 'SHOW TABLE STATUS LIKE ?' , $ this -> _name ) ; $ this -> _engine = $ table [ 0 ] [ 'engine' ] ; } return $ this -> _engine ; } | Retrieve table engine |
236,731 | public function setEngine ( $ engine ) { $ this -> _database -> exec ( 'ALTER TABLE ' . $ this -> _database -> prepareIdentifier ( $ this -> _name ) . ' ENGINE = ' . $ this -> _database -> prepareValue ( $ engine , Column :: TYPE_VARCHAR ) ) ; if ( strcasecmp ( $ this -> getEngine ( ) , $ engine ) != 0 ) { throw new \ ... | Set table engine |
236,732 | protected function unload ( ) { foreach ( $ this -> ial as $ entry ) { if ( isset ( $ entry [ 'TIMER' ] ) ) { $ this -> removeTimer ( $ entry [ 'TIMER' ] ) ; } } } | Frees the resources associated with this module . |
236,733 | protected function updateUser ( $ nick , $ ident , $ host ) { $ collator = $ this -> connection -> getCollator ( ) ; $ normNick = $ collator -> normalizeNick ( $ nick ) ; $ key = array_search ( $ normNick , $ this -> nicks ) ; if ( $ key === false ) { $ key = $ this -> sequence ++ ; $ this -> nicks [ $ key ] = $ normNi... | Updates the IAL with new information on some user . |
236,734 | protected function realRemoveUser ( $ nick ) { $ collator = $ this -> connection -> getCollator ( ) ; $ nick = $ collator -> normalizeNick ( $ nick ) ; $ key = array_search ( $ nick , $ this -> nicks ) ; if ( $ key === false ) { return ; } $ this -> ial [ $ key ] [ 'TIMER' ] = null ; if ( ! isset ( $ this -> nicks [ $ ... | Removes some user from the IAL . |
236,735 | public function handleNick ( \ Erebot \ Interfaces \ EventHandler $ handler , \ Erebot \ Interfaces \ Event \ Nick $ event ) { $ oldNick = ( string ) $ event -> getSource ( ) ; $ newNick = ( string ) $ event -> getTarget ( ) ; $ collator = $ this -> connection -> getCollator ( ) ; $ normOldNick = $ collator -> normaliz... | Handles a nick change . |
236,736 | public function handleLeaving ( \ Erebot \ Interfaces \ EventHandler $ handler , \ Erebot \ Interfaces \ Event \ Base \ Generic $ event ) { if ( $ event instanceof \ Erebot \ Interfaces \ Event \ Kick ) { $ nick = ( string ) $ event -> getTarget ( ) ; } else { $ nick = ( string ) $ event -> getSource ( ) ; } $ collator... | Handles some user leaving an IRC channel . This may result from either a QUIT or KICK command . |
236,737 | public function handleCapabilities ( \ Erebot \ Interfaces \ EventHandler $ handler , \ Erebot \ Event \ ServerCapabilities $ event ) { $ module = $ event -> getModule ( ) ; if ( $ module -> hasExtendedNames ( ) ) { $ this -> sendCommand ( 'PROTOCTL NAMESX' ) ; } if ( $ module -> hasUserHostNames ( ) ) { $ this -> send... | Handles server capabilities . |
236,738 | public function handleNames ( \ Erebot \ Interfaces \ NumericHandler $ handler , \ Erebot \ Interfaces \ Event \ Numeric $ numeric ) { $ text = $ numeric -> getText ( ) ; $ chan = $ text [ 1 ] ; $ users = new \ Erebot \ TextWrapper ( ltrim ( $ numeric -> getText ( ) -> getTokens ( 2 ) , ':' ) ) ; try { $ caps = $ this ... | Handles a list with the nicknames of all users in a given IRC channel . |
236,739 | public function handleWho ( \ Erebot \ Interfaces \ NumericHandler $ handler , \ Erebot \ Interfaces \ Event \ Numeric $ numeric ) { $ text = $ numeric -> getText ( ) ; $ this -> updateUser ( $ text [ 4 ] , $ text [ 1 ] , $ text [ 2 ] ) ; } | Handles information about some user . |
236,740 | public function handleJoin ( \ Erebot \ Interfaces \ EventHandler $ handler , \ Erebot \ Interfaces \ Event \ Join $ event ) { $ user = $ event -> getSource ( ) ; $ nick = $ user -> getNick ( ) ; $ collator = $ this -> connection -> getCollator ( ) ; $ normNick = $ collator -> normalizeNick ( $ nick ) ; $ this -> updat... | Handles some user joining an IRC channel the bot is currently on . |
236,741 | public function handleChanModeAddition ( \ Erebot \ Interfaces \ EventHandler $ handler , \ Erebot \ Interfaces \ Event \ Base \ ChanModeGiven $ event ) { $ user = $ event -> getTarget ( ) ; $ nick = self :: extractNick ( $ user ) ; $ collator = $ this -> connection -> getCollator ( ) ; $ normNick = $ collator -> norma... | Handles someone receiving a new status on an IRC channel for example when someone is OPped . |
236,742 | public function startTracking ( $ nick , $ cls = '\\Erebot\\Module\\IrcTracker\\Token' ) { $ identityCls = $ this -> getFactory ( '!Identity' ) ; $ fmt = $ this -> getFormatter ( null ) ; if ( $ nick instanceof \ Erebot \ Interfaces \ Identity ) { $ identity = $ nick ; } else { if ( ! is_string ( $ nick ) ) { throw new... | Returns a tracking token for some user . |
236,743 | public function getInfo ( $ token , $ info , $ args = array ( ) ) { if ( $ token instanceof \ Erebot \ Module \ IrcTracker \ Token ) { $ methods = array ( self :: INFO_ISON => 'isOn' , self :: INFO_MASK => 'getMask' , self :: INFO_NICK => 'getNick' , self :: INFO_IDENT => 'getIdent' , self :: INFO_HOST => 'getHost' , )... | Returns information about some user given a token associated with that user . |
236,744 | public function isOn ( $ chan , $ nick = null ) { if ( $ nick === null ) { return isset ( $ this -> chans [ $ chan ] ) ; } $ nick = self :: extractNick ( $ nick ) ; $ collator = $ this -> connection -> getCollator ( ) ; $ nick = $ collator -> normalizeNick ( $ nick ) ; $ key = array_search ( $ nick , $ this -> nicks ) ... | Indicates whether some user is present on a given IRC channel . |
236,745 | public function getCommonChans ( $ nick ) { $ nick = self :: extractNick ( $ nick ) ; $ collator = $ this -> connection -> getCollator ( ) ; $ nick = $ collator -> normalizeNick ( $ nick ) ; $ key = array_search ( $ nick , $ this -> nicks ) ; if ( $ key === false ) { throw new \ Erebot \ NotFoundException ( 'No such us... | Returns a list of IRC channels the bot and some other user have in common . |
236,746 | public function userPrivileges ( $ chan , $ nick ) { if ( ! isset ( $ this -> chans [ $ chan ] [ $ nick ] ) ) { throw new \ Erebot \ NotFoundException ( 'No such channel or user' ) ; } return $ this -> chans [ $ chan ] [ $ nick ] ; } | Returns channel status associated with the given user . |
236,747 | public function onKernelController ( FilterControllerEvent $ event ) { if ( ! is_array ( $ controller = $ event -> getController ( ) ) ) { return ; } $ subRequest = $ event -> getRequest ( ) ; if ( $ event -> getRequestType ( ) == HttpKernelInterface :: MASTER_REQUEST ) { return ; } if ( ! $ configuration = $ subReques... | Listener for the Controller call |
236,748 | public function onKernelResponse ( FilterResponseEvent $ event ) { $ subRequest = $ event -> getRequest ( ) ; if ( $ event -> getRequestType ( ) == HttpKernelInterface :: MASTER_REQUEST ) { return ; } if ( ! $ configuration = $ subRequest -> attributes -> get ( '_andres_montanez_fragment_cache' , false ) ) { return ; }... | Listener for the Response call |
236,749 | protected function getKey ( FragmentCache $ configuration , Request $ subRequest , Request $ masterRequest ) { $ event = new KeyGenerationEvent ( $ configuration , $ subRequest , $ masterRequest ) ; $ keyRequest = sha1 ( $ subRequest -> getRequestUri ( ) ) . ':' . sha1 ( $ masterRequest -> getRequestUri ( ) ) ; $ key =... | Calculates the cache Key of the Fragment |
236,750 | public function setAuthMode ( $ mode ) { if ( ! class_exists ( $ mode ) ) { throw new \ Exception ( sprintf ( "Class %s doesn't exists" , $ mode ) ) ; } $ this -> authMode = $ mode ; $ authClass = is_string ( $ mode ) ? new $ mode ( ) : $ mode ; if ( ! $ authClass instanceof SecurityInterface ) { throw new \ Exception ... | Set Authentication Mode . |
236,751 | public function setAuthDir ( $ dir ) { if ( ! file_exists ( $ dir ) ) { throw new \ Exception ( 'Auth directory is not exists!' ) ; } if ( ! is_dir ( $ dir ) ) { throw new \ Exception ( 'Auth directory is not exists!' ) ; } if ( $ this -> security && $ this -> security -> getKey ( ) ) { throw new \ Exception ( 'Auth di... | Set Authencation Directory . |
236,752 | public function breadcrumbsAction ( ) { $ default = 'dashboard' ; $ id = $ this -> getRequest ( ) -> getQuery ( 'id' , $ default ) ; $ pos = strpos ( $ id , '/' ) ; $ id = false !== $ pos ? substr ( $ id , 0 , $ pos ) : $ id ; $ view = $ this -> getServiceLocator ( ) -> get ( 'Zend\View\Renderer\PhpRenderer' ) ; $ navi... | Web service per la restituzione di un breadcrumbs in base ad un id |
236,753 | public function categoriesAction ( ) { $ main = $ this -> getServiceLocator ( ) -> get ( 'neobazaar.service.main' ) ; $ categories = $ main -> getDocumentEntityRepository ( ) -> getCategoryMultioptionsNoSlug ( $ this -> getServiceLocator ( ) ) ; return new JsonModel ( array ( 'data' => $ categories ) ) ; } | Web service per la restituzione delle categorie |
236,754 | public function locationsAction ( ) { $ main = $ this -> getServiceLocator ( ) -> get ( 'neobazaar.service.main' ) ; $ locations = $ main -> getGeonamesEntityRepository ( ) -> getLocationMultioptions ( $ this -> getServiceLocator ( ) ) ; return new JsonModel ( array ( 'data' => $ locations ) ) ; } | Web service per la restituzione delle locations |
236,755 | public function activationEmailResendAction ( ) { $ classifiedService = $ this -> getServiceLocator ( ) -> get ( 'document.service.classified' ) ; try { $ ids = $ classifiedService -> activationEmailResend ( 1 ) ; $ data = array ( 'status' => 'success' , 'message' => implode ( ", " , $ ids ) ) ; } catch ( \ Exception $... | This is needed because of mailserver goes down . Will resend activation email to those classifieds where date_insert = date_edit and state = 2 . Dispatch a classified created event with data |
236,756 | public function sameValueAs ( ValueObjectInterface $ real ) { if ( false === Util :: classEquals ( $ this , $ real ) ) { return false ; } return $ this -> toNative ( ) === $ real -> toNative ( ) ; } | Tells whether two Real are equal by comparing their values |
236,757 | public function toInteger ( RoundingMode $ rounding_mode = null ) { if ( null === $ rounding_mode ) { $ rounding_mode = RoundingMode :: HALF_UP ( ) ; } $ value = $ this -> toNative ( ) ; $ integerValue = \ round ( $ value , 0 , $ rounding_mode -> toNative ( ) ) ; $ integer = new Integer ( $ integerValue ) ; return $ in... | Returns the integer part of the Real number as a Integer |
236,758 | public function toNatural ( RoundingMode $ rounding_mode = null ) { $ integerValue = $ this -> toInteger ( $ rounding_mode ) -> toNative ( ) ; $ naturalValue = \ abs ( $ integerValue ) ; $ natural = new Natural ( $ naturalValue ) ; return $ natural ; } | Returns the absolute integer part of the Real number as a Natural |
236,759 | public function missingMethod ( $ parameters ) { if ( ! app ( ) -> runningInConsole ( ) ) { $ this -> viewPath -> missingMethod ( $ this -> layout -> layout , $ parameters ) ; } return $ this ; } | If a method is not defined try to find it s view . |
236,760 | public function setViewLayout ( $ view ) { $ this -> layout = $ this -> viewLayout -> change ( $ view ) ; $ this -> layout -> layout = $ this -> viewPath -> setUp ( $ this -> layout -> layout , null ) ; } | Set a custom layout for a page . |
236,761 | public function setViewPath ( $ view ) { $ this -> layout -> layout = $ this -> viewPath -> setUp ( $ this -> layout -> layout , $ view ) ; return $ this ; } | Override the automatically resolved view . |
236,762 | protected function _setFactory ( $ factory ) { if ( $ factory !== null && ! ( $ factory instanceof FactoryInterface ) ) { throw $ this -> _createInvalidArgumentException ( $ this -> __ ( 'Argument is not a valid factory instance' ) , null , null , $ factory ) ; } $ this -> factory = $ factory ; } | Sets the factory for this instance . |
236,763 | public function findWhereIn ( array $ parameters ) { $ q = $ this -> getQuery ( ) ; foreach ( $ parameters as $ name => $ value ) { $ q -> whereIn ( $ name , $ value ) ; } return $ q -> get ( ) ; } | Find where in . |
236,764 | protected static function getClassFromCollection ( array $ collection ) { $ classes = array_unique ( array_map ( 'get_class' , $ collection ) ) ; if ( count ( $ classes ) > 1 ) { throw new \ Exception ( sprintf ( "Can't manage entities in a container with multiple types, these are %s." , implode ( ", " , $ classes ) ) ... | Check a collection only has one class . Determine this and return it . |
236,765 | public function addRouteMiddleware ( string $ name ) : void { if ( ! array_key_exists ( $ name , $ this -> getConfigRouteMiddlewares ( ) ) ) { throw new InvalidArgumentException ( 'The middleware [' . $ name . '] does not exists.' ) ; } $ this -> routeMiddlewares [ ] = $ this -> getConfigRouteMiddlewares ( ) [ $ name ]... | Add a route middleware to the list of executed middlewares . |
236,766 | private function createEnv ( ) : void { if ( file_exists ( base_dir ( '.env' ) ) ) { $ dotEnv = new Dotenv ( ) ; $ dotEnv -> load ( base_dir ( '.env' ) ) ; $ this -> env = $ dotEnv ; } } | Create environment . |
236,767 | private function createRequest ( Request $ request = null ) : void { if ( ! $ this -> request && is_null ( $ request ) ) { $ request = ServerRequest :: fromGlobals ( ) -> withParsedBody ( json_decode ( file_get_contents ( 'php://input' ) ) ) ; } $ this -> container -> set ( Request :: class , $ request ) ; $ this -> re... | Create the request object . |
236,768 | private function registerErrorHandler ( ) : void { $ whoops = new Run ( ) ; $ whoops -> pushHandler ( new PrettyPageHandler ( ) ) ; $ whoops -> register ( ) ; $ this -> errorHandler = $ whoops ; } | Register the error handler . |
236,769 | private function registerProviders ( ) : void { $ this -> providers = array_merge ( $ this -> providers , $ this -> getConfigProviders ( ) ) ; foreach ( $ this -> providers as $ provider ) { $ provider = $ this -> container -> get ( $ provider ) ; $ provider -> boot ( ) ; } } | Registers the providers by booting them . |
236,770 | private function handleRequest ( array $ middlewares ) : void { $ requestHandler = new RequestHandler ( $ this -> container , $ middlewares ) ; $ this -> response = $ requestHandler -> handle ( $ this -> request ) ; } | Handles the request and triggers middlewares . |
236,771 | public function prepareResponse ( ) { try { $ this -> setBaseMiddlewares ( ) ; $ this -> handleRequest ( $ this -> middlewares ) ; $ this -> router -> build ( ) ; $ this -> handleRequest ( $ this -> routeMiddlewares ) ; $ this -> response = $ this -> router -> run ( ) ; } catch ( Exception $ exception ) { $ response = ... | Prepare the response object . |
236,772 | private function getEventDefinition ( string $ serialized ) : array { $ definition = $ this -> getDeserializationDefinition ( $ serialized ) ; if ( ! isset ( $ definition [ 'class' ] , $ definition [ 'payload' ] , $ definition [ 'attributes' ] ) || \ count ( \ array_diff ( \ array_keys ( $ definition ) , [ 'class' , 'p... | Get event definition from serialization . |
236,773 | private function getDeserializationDefinition ( string $ serialized ) : array { if ( \ trim ( $ serialized ) === '' ) { throw new EventSerializationException ( 'Malformed JSON serialized event: empty string' ) ; } $ definition = \ json_decode ( $ serialized , true , 512 , static :: JSON_DECODE_OPTIONS ) ; if ( $ defini... | Get deserialization definition . |
236,774 | private static function init ( ) { if ( ! self :: $ defaultLng ) { $ config = Application :: getConfigManager ( ) -> loadForModule ( 'Cmf\Language' ) ; self :: $ defaultLng = strtolower ( $ config -> defaultLanguage ) ; $ currentLng = $ config -> currentLanguage ; self :: $ currentLng = $ currentLng ? strtolower ( $ cu... | Initialization of language manager |
236,775 | public static function getAuthorizationButton ( $ client_id , $ redirect_url , $ state = '' , $ text = 'connect' , $ color = 'blue' , $ caption = 'white' , $ size = 200 , $ url = 'https://runkeeper.com/apps/authorize' ) { $ link = self :: getAuthorizationLink ( $ client_id , $ redirect_url , $ state ) ; $ text = ( in_a... | Generates a button for establishing a connection with a RunKeeper account . |
236,776 | public static function getAuthorizationLink ( $ client_id , $ redirect_url , $ state = '' , $ url = 'https://runkeeper.com/apps/authorize' ) { $ data = array ( 'client_id' => $ client_id , 'response_type' => 'code' , 'redirect_uri' => $ redirect_url , 'state' => $ state , ) ; return ( string ) \ Guzzle \ Http \ Url :: ... | Generates a link for establishing a connection with a RunKeeper account . |
236,777 | protected function getSession ( Request $ request ) : Session \ Session { $ session = $ request -> getAttribute ( SessionHandler :: SESSION_ATTRIBUTE ) ; if ( ! $ session instanceof Session \ Session ) { throw new \ Exception ( 'Session not available in request at: ' . SessionHandler :: SESSION_ATTRIBUTE ) ; } return $... | Get session from request |
236,778 | public function load ( array $ files = array ( ) ) { $ loader = new YamlLoader ( new FileLocator , new YamlParser ) ; foreach ( $ files as $ file ) { $ configValues = $ loader -> load ( $ file ) ; $ configValues = $ this -> loadImports ( $ loader , $ file , $ configValues ) ; $ this -> params = array_replace_recursive ... | Load config files |
236,779 | public function get ( $ key ) { if ( $ this -> has ( $ key ) ) { return $ this -> params [ $ key ] ; } throw new \ InvalidArgumentException ( sprintf ( "Config key %s doest not exist" , $ key ) ) ; } | Get a config value for a key |
236,780 | final protected function CreateInUrl ( ) { $ args = $ this -> EditParams ( ) ; $ args [ 'parent' ] = $ this -> item -> GetID ( ) ; return BackendRouter :: ModuleUrl ( new ModuleForm ( ) , $ args ) ; } | The url for creating content in the current item |
236,781 | final protected function CanEdit ( ) { $ form = $ this -> module -> ContentForm ( ) ; return BackendModule :: Guard ( ) -> Allow ( BackendAction :: Edit ( ) , $ this -> content ) && BackendModule :: Guard ( ) -> Allow ( BackendAction :: Read ( ) , $ form ) ; } | True if the the content can be edited |
236,782 | final protected function CanCreateIn ( ) { return $ this -> AllowChildren ( ) && BackendModule :: Guard ( ) -> Allow ( BackendAction :: Create ( ) , $ this -> content ) ; } | True if the content can be created in |
236,783 | final protected function CanCreateAfter ( ) { $ parentItem = $ this -> tree -> ParentOf ( $ this -> item ) ; if ( $ parentItem ) { $ parent = $ this -> tree -> ContentByItem ( $ parentItem ) ; return BackendModule :: Guard ( ) -> Allow ( BackendAction :: Create ( ) , $ parent ) ; } return $ this -> GrantCreateInRoot ( ... | True if there can be content created after |
236,784 | public function __isset ( $ name ) { return isset ( $ this -> children [ $ name ] ) && ! is_null ( $ this -> children [ $ name ] -> getValue ( ) ) ; } | Check if child set |
236,785 | public function overwrite ( $ container ) { $ originalValue = $ this -> getValue ( ) ; $ newValue = $ container -> getValue ( ) ; if ( is_null ( $ newValue ) ) { $ resultValue = $ originalValue ; } elseif ( is_array ( $ newValue ) && is_array ( $ originalValue ) ) { $ resultValue = array_replace_recursive ( $ originalV... | Overwrite Container s data |
236,786 | function input ( array $ formats , $ output = 'array' ) { if ( in_array ( 'post' , $ formats ) ) { $ post = $ this -> context -> web -> requestPostData ( ) ; if ( ! empty ( $ post ) ) { if ( $ output == 'array' ) { return $ post ; } } } if ( in_array ( 'json' , $ formats ) ) { $ input = $ this -> context -> web -> requ... | Given a set of acceptable formats the system tries to retrieve the data format specified and return it in the specified output format . If there is no input the method will return null . |
236,787 | public function match ( $ url ) { $ url = trim ( $ url , '/' ) ; $ path = preg_replace_callback ( '#:([\w]+)#' , [ $ this , 'paramMatch' ] , $ this -> path ) ; $ regex = "#^$path$#i" ; if ( ! preg_match ( $ regex , $ url , $ matches ) ) { return false ; } array_shift ( $ matches ) ; return $ matches ; } | Test if the current route matches the URL |
236,788 | public function execute ( $ matches ) { if ( is_string ( $ this -> callable ) ) { $ params = explode ( '#' , $ this -> callable ) ; if ( count ( $ params ) == 2 ) { $ controllerPrefix = $ params [ 0 ] ; $ controllerPrefix = str_replace ( ':' , '\\' , $ controllerPrefix ) ; $ controller = $ controllerPrefix . "Controlle... | Execute the callable of route |
236,789 | public function getUrl ( $ params ) { $ path = $ this -> path ; foreach ( $ params as $ k => $ v ) { $ path = str_replace ( ":$k" , $ v , $ path ) ; } return $ path ; } | Generate the URL with the parameters |
236,790 | public function actionAudit ( $ id ) { $ model = $ this -> findModel ( $ id ) ; $ model -> setPublished ( ) ; Yii :: $ app -> getSession ( ) -> setFlash ( 'success' , Yii :: t ( 'article' , 'Update success.' ) ) ; return $ this -> redirect ( Url :: previous ( 'actions-redirect' ) ) ; } | Audit an existing Comment model . If Audit is successful the browser will be redirected to the index page . |
236,791 | public function resolveGuard ( $ name ) { $ config = Config :: get ( 'auth.guards.' . $ name ) ; if ( is_null ( $ config ) ) throw new AccountException ( "Auth guard [" . $ name . "] is not defined in the configuration" ) ; $ uses = $ config [ 'uses' ] ; $ auth = $ this -> resolveAuth ( $ config [ 'auth' ] ? : $ this -... | Resolve the implemented Account Guard |
236,792 | public function resolveAuth ( $ auth ) { $ config = Config :: get ( 'auth.auths.' . $ auth ) ; $ uses = $ config [ 'uses' ] ; switch ( $ uses ) { case 'database' : { $ auth = new DatabaseAuth ( $ config [ 'table' ] ) ; break ; } case 'eloquent' : { $ auth = new EloquentAuth ( $ config [ 'usrModel' ] , $ config [ 'grpMo... | Resolve the implemented Account Auth |
236,793 | public function viaRequest ( $ name , callable $ callback ) { $ this -> guards [ $ name ] = new RequestGuard ( $ callback , Request :: i ( ) ) ; } | Register a callback based guard |
236,794 | protected function editFieldhandlerMethod ( ) { if ( in_array ( $ this -> method , array ( 'validate' , 'sanitize' , 'format' ) ) ) { return $ this ; } throw new InvalidArgumentException ( get_class ( $ this ) . ' passed in invalid Fieldhandler method ' . $ this -> method . ' in FieldhandlerUsageTrait::editFieldhandler... | Edit Method for Fieldhandler Method |
236,795 | protected function editFieldhandlerAttribute ( $ attribute ) { $ field_name = 'field_' . $ attribute ; $ this -> $ field_name = null ; if ( isset ( $ this -> field [ $ attribute ] ) ) { $ this -> $ field_name = $ this -> field [ $ attribute ] ; return $ this ; } if ( $ attribute === 'value' ) { $ this -> $ field_name =... | Edit Fieldhandler Attribute |
236,796 | protected function executeConstraint ( array $ options = array ( ) ) { try { $ method = $ this -> method ; return $ this -> fieldhandler -> $ method ( $ this -> field_name , $ this -> field_value , ucfirst ( strtolower ( $ this -> field_type ) ) , $ options ) ; } catch ( Exception $ e ) { throw new RuntimeException ( '... | Execute Fieldhandler Method |
236,797 | public function initializeObject ( ) { $ querySettings = $ this -> objectManager -> get ( Typo3QuerySettings :: class ) ; $ querySettings -> setIgnoreEnableFields ( false ) ; $ querySettings -> setRespectStoragePage ( false ) ; $ this -> setDefaultQuerySettings ( $ querySettings ) ; } | The life cycle method . |
236,798 | public function findByUid ( $ uid , array $ querySettings = [ 'respectSysLanguage' => false ] ) { if ( $ uid && $ uid > 0 ) { $ query = $ this -> createquery ( ) ; $ query = $ this -> applyQuerySettings ( $ query , $ querySettings ) ; $ query -> matching ( $ query -> equals ( 'uid' , $ uid ) ) ; $ result = $ query -> e... | Finds objects by UID overrides the default one . |
236,799 | public function findByUids ( $ uids , array $ querySettings = [ 'respectSysLanguage' => false ] ) { if ( is_string ( $ uids ) ) { $ uids = GeneralUtility :: intExplode ( ',' , $ uids , true ) ; } if ( ! empty ( $ uids ) ) { $ query = $ this -> createquery ( ) ; $ query = $ this -> applyQuerySettings ( $ query , $ query... | Finds objects by multiple UIDs . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.