idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
59,200 | public function validateAttribute ( $ object , $ attribute ) { $ this -> columnCount -- ; $ file = $ object -> $ attribute ; if ( ! $ file instanceof CUploadedFile ) { $ file = CUploadedFile :: getInstance ( $ object , $ attribute ) ; if ( null === $ file ) return $ this -> emptyAttribute ( $ object , $ attribute ) ; }... | Main entry point for validation . This method is called via the model s rules method when using the csv validator |
59,201 | protected function validateCSVHeaders ( $ object , $ attribute , $ file ) { $ file = fopen ( $ file -> getTempName ( ) , "r" ) ; $ headerColumns = $ this -> explodeToColumns ( fgets ( $ file ) ) ; if ( $ headerColumns == array ( ) ) { $ this -> addError ( $ object , $ attribute , 'Could not read header line. File empty... | Validates the headers of a csv file |
59,202 | protected function validateCSVRows ( $ object , $ attribute , $ file ) { $ this -> countryColumnNumber -- ; $ countrySynonyms = Yii :: app ( ) -> params [ 'countrySynonyms' ] ; $ allowedCountrySynonyms = array ( ) ; foreach ( $ countrySynonyms as $ countrySynonymsRow ) { foreach ( explode ( ',' , $ countrySynonymsRow )... | Validates every row in a csv |
59,203 | protected function explodeToColumns ( $ row ) { $ columns = explode ( $ this -> separator , $ row ) ; foreach ( $ columns as $ column => $ value ) { $ columns [ $ column ] = trim ( $ value ) ; } return $ columns ; } | Explodes a row to columns and returns the resulting array |
59,204 | public static function getServerDatetime ( $ p_plus = null ) { $ datetime = new \ Datetime ( ) ; if ( $ p_plus !== null ) { $ datetime -> add ( new \ DateInterval ( 'PT' . $ p_plus . 'M' ) ) ; } return $ datetime -> format ( 'Y-m-d H:i:s' ) ; } | Return a datetime |
59,205 | public static function getCurrentTimestamp ( $ p_plus = null ) { $ datetime = new \ Datetime ( ) ; if ( $ p_plus !== null ) { if ( $ p_plus > 0 ) { $ datetime -> add ( new \ DateInterval ( 'PT' . $ p_plus . 'M' ) ) ; } else { $ datetime -> sub ( new \ DateInterval ( 'PT' . ( - 1 * $ p_plus ) . 'M' ) ) ; } } return $ da... | Return a datetime as string |
59,206 | public static function ddmmyyyyToMysql ( $ p_date ) { if ( $ p_date !== null && $ p_date != '' ) { $ format = 'd/m/Y H:i:s' ; $ date = \ DateTime :: createFromFormat ( $ format , $ p_date ) ; if ( $ date === false ) { $ format = 'd/m/Y H:i' ; $ date = \ DateTime :: createFromFormat ( $ format , $ p_date ) ; } if ( $ da... | Conversion d une date en chaine |
59,207 | public static function mysqlToddmmyyyy ( $ p_date , $ p_withSeconds = false , $ p_withHour = true ) { if ( $ p_date !== null && $ p_date != '' ) { $ format1 = 'Y-m-d H:i:s' ; $ format2 = 'Y-m-d' ; if ( $ p_withSeconds && $ p_withHour ) { $ oFormat = 'd/m/Y H:i:s' ; } else { if ( $ p_withHour ) { $ oFormat = 'd/m/Y H:i'... | Affichage d une date au format EU |
59,208 | public static function mysqlToDatetime ( $ p_date ) { $ date = new \ Datetime ( ) ; if ( $ p_date !== null && $ p_date != '' ) { $ format = 'Y-m-d H:i:s' ; $ date = \ DateTime :: createFromFormat ( $ format , $ p_date ) ; if ( $ date === false ) { $ date = new \ Datetime ( ) ; } } return $ date ; } | Conversion d une date mysql en DateTime |
59,209 | public static function datetimeToMysql ( $ p_date , $ p_withSeconds = false , $ p_withHour = true ) { $ format = 'Y-m-d' ; if ( $ p_withSeconds && $ p_withHour ) { $ format = 'Y-m-d H:i:s' ; } else { if ( $ p_withHour ) { $ format = 'Y-m-d H:i' ; } } return $ p_date -> format ( $ format ) ; } | Converti un datetime en format de base |
59,210 | public function getAvailability ( $ excludeId = null ) { if ( ! $ this -> Active ) { return array ( 'available' => false , 'reason' => 'Ticket is not active.' ) ; } $ start = strtotime ( $ this -> StartDate ) ; if ( $ this -> StartDate && $ start >= time ( ) ) { return array ( 'available' => false , 'reason' => 'Ticket... | Returns the number of tickets available for an event time . |
59,211 | private function replaceLegacyTokenAuthenticator ( ContainerBuilder $ container ) { if ( ( int ) Kernel :: MAJOR_VERSION === 2 && Kernel :: MINOR_VERSION < 8 ) { $ definition = $ container -> getDefinition ( 'tree_house.keystone.token_authenticator' ) ; $ definition -> setClass ( LegacyTokenAuthenticator :: class ) ; }... | Replaces token authenticator service with legacy class for older Symfony versions . |
59,212 | public function register ( Container $ app ) { $ app [ 'sanity.client.options' ] = [ 'projectId' => null , 'dataset' => null , ] ; $ app [ 'sanity.client' ] = function ( Application $ app ) { return new Client ( $ app [ 'sanity.client.options' ] ) ; } ; } | Register the API client as a service in the container |
59,213 | public function regenerateToken ( $ name = null ) { $ this -> initialize ( ) ; $ name = $ this -> hashName ( $ name ) ; $ this -> tokens [ $ name ] = $ this -> getUniqueToken ( ) ; if ( ! isset ( $ _SESSION [ $ this -> key ] ) || ! is_array ( $ _SESSION [ $ this -> key ] ) ) { $ _SESSION [ $ this -> key ] = [ ] ; } $ _... | Regenerate a CSRF token |
59,214 | protected function getUniqueToken ( ) { $ length = 64 ; if ( function_exists ( 'random_bytes' ) ) { return base64_encode ( random_bytes ( $ length ) ) ; } if ( function_exists ( 'openssl_random_pseudo_bytes' ) ) { return base64_encode ( openssl_random_pseudo_bytes ( $ length ) ) ; } if ( function_exists ( 'password_has... | Generate a unique token using the best pseudo random generation for the current system |
59,215 | protected function initialize ( ) { if ( $ this -> initialized ) { return true ; } if ( session_status ( ) !== PHP_SESSION_NONE ) { if ( isset ( $ _SESSION [ $ this -> key ] ) && is_array ( $ _SESSION [ $ this -> key ] ) ) { $ this -> tokens = $ _SESSION [ $ this -> key ] ; } $ this -> initialized = true ; } else { thr... | Get current session tokens if there are any . |
59,216 | public function addCustomServiceAccount ( $ account , $ nickName , $ password ) { $ url = sprintf ( self :: CS_ACCOUNT_ADD_URL , $ this -> getAccessTokenString ( ) ) ; $ client = $ this -> getHttpClient ( ) ; $ client -> setUrl ( $ url ) ; $ client -> setHeaderArray ( [ 'Content-Type: application/json' ] ) ; $ client -... | add custom service account |
59,217 | public function getCustomServiceAccountList ( ) { $ url = sprintf ( self :: CS_ACCOUNT_LISTS_URL , $ this -> getAccessTokenString ( ) ) ; $ client = $ this -> getHttpClient ( ) ; $ client -> setUrl ( $ url ) ; $ client -> setHeaderArray ( [ 'Content-Type: application/json' ] ) ; if ( ! $ client -> exec ( ) ) { throw ne... | get custom service account list |
59,218 | public function sendCustomServiceMessage ( WxSendMsg $ msg ) { $ url = sprintf ( self :: CS_SEND_MESSAGE_URL , $ this -> getAccessTokenString ( ) ) ; $ client = $ this -> getHttpClient ( ) ; $ client -> setUrl ( $ url ) ; $ client -> setHeaderArray ( [ 'Content-Type: application/json' ] ) ; $ client -> setMethod ( Clie... | send custom service message |
59,219 | protected function createQRCodeTicket ( $ value , $ type ) { $ url = sprintf ( self :: QR_CODE_URL , $ this -> getAccessTokenString ( ) ) ; $ client = $ this -> getHttpClient ( ) ; $ client -> setUrl ( $ url ) ; $ client -> setHeaderArray ( [ 'Content-Type: application/json' ] ) ; $ client -> setMethod ( Client :: METH... | create qr code ticket |
59,220 | function createTemplate ( $ class = NULL , callable $ latteFactory = NULL ) { $ template = $ this -> getTemplateFactory ( ) -> createTemplate ( $ this ) ; $ latte = $ template -> getLatte ( ) ; $ macroSet = new Latte \ Macros \ MacroSet ( $ latte -> getCompiler ( ) ) ; $ macroSet -> addMacro ( 'url' , function ( ) { } ... | Template factory . |
59,221 | public function fetchAll ( ) { $ result = $ this -> statement -> fetchAll ( \ PDO :: FETCH_ASSOC ) ; $ rows = array ( ) ; if ( $ this -> model !== null ) { foreach ( $ result as $ row ) { $ model = $ this -> model ; $ rows [ ] = new $ model ( $ row , false ) ; } } else { foreach ( $ result as $ row ) { $ rows [ ] = $ r... | Fetches all the rows . |
59,222 | public function get_response ( ) { Kohana_Exception :: log ( $ this ) ; if ( Kohana :: $ environment >= Kohana :: DEVELOPMENT ) { return parent :: get_response ( ) ; } else { return self :: _handler ( $ this ) ; $ params = array ( 'action' => $ this -> getCode ( ) , 'message' => rawurlencode ( $ this -> getMessage ( ) ... | Generate a Response for all Exceptions without a more specific override |
59,223 | public function generateImage ( DiagrammInterface $ diagramm ) { $ dslText = $ this -> generateDslText ( $ diagramm ) ; $ diagramm -> setAsText ( $ dslText ) ; return $ this -> getProxy ( ) -> requestDiagramm ( $ diagramm -> getType ( ) , $ dslText ) ; } | Generates an image of the diagramm |
59,224 | public function generateDslText ( DiagrammInterface $ diagramm ) { $ dslText = '' ; foreach ( $ diagramm -> getNodes ( ) as $ node ) { $ dslText .= $ this -> nodeToDslText ( $ node ) ; $ dslText .= ',' ; $ dslText .= $ this -> noteFromNodeToDslText ( $ node ) ; foreach ( $ node -> getDependencies ( ) as $ dependency ) ... | Generates dsl text for the diagramm |
59,225 | public function nodeToDslText ( NodeInterface $ node ) { switch ( $ node -> getNodeType ( ) ) { case Node :: TYPE_USE_CASE : return $ this -> useCaseNodeToDslText ( $ node ) ; break ; default : throw new \ InvalidArgumentException ( 'Unknown node type "' . $ node -> getNodeType ( ) . '"' ) ; break ; } } | Converts a node to dsl text |
59,226 | public function noteFromNodeToDslText ( NodeInterface $ node ) { if ( ! $ node instanceof NoteProviderInterface ) { throw new \ InvalidArgumentException ( 'Node must implement NoteProviderInterface' ) ; } $ note = $ node -> getNote ( ) ; $ noteBg = $ node -> getNoteBg ( ) ; if ( ! is_string ( $ note ) || strlen ( $ not... | Converts a note of a node to dsl text |
59,227 | public function dependencyToDslText ( DependencyInterface $ dependency ) { $ type = $ dependency -> getType ( ) ; if ( ! array_key_exists ( $ type , $ this -> dependncyTypeToDslText ) ) { throw new \ InvalidArgumentException ( 'Unknown dependncy type "' . $ type . '"' ) ; } $ dslText = $ this -> nodeToDslText ( $ depen... | Converts a dependency to dsl text |
59,228 | protected function useCaseNodeToDslText ( NodeInterface $ node ) { $ dslText = sprintf ( $ this -> nodeTypeToDslText [ Node :: TYPE_USE_CASE ] , $ this -> getFilter ( ) -> filter ( $ node -> getNodeName ( ) ) ) ; return $ dslText ; } | Converts a node of type use case to dsl text |
59,229 | protected static function __classSort ( ClassReflection $ a , ClassReflection $ b ) { if ( $ a -> getSort ( ) > $ b -> getSort ( ) ) { return - 1 ; } if ( $ a -> getSort ( ) < $ b -> getSort ( ) ) { return 1 ; } return 0 ; } | Callback for trait sort |
59,230 | public static function get ( string $ channel , array $ handlers ) { $ logger = new static ( ) ; return $ logger -> setUid ( static :: generateUid ( ) ) -> setHandlers ( $ handlers ) -> setChannel ( $ channel ) ; } | Construye un logger |
59,231 | public function log ( $ level , $ message , array $ context = array ( ) ) : Logger { $ msg = $ this -> formatMessage ( $ level , $ message , $ context ) ; foreach ( $ this -> handlers as $ handler ) { $ handler ( $ level , $ msg ) ; } return $ this ; } | Publica un mensaje |
59,232 | public function formatMessage ( $ level , string $ message , array $ context = array ( ) ) : string { $ dateTime = new \ DateTime ( ) ; $ dateTime -> setTimezone ( static :: timezone ( ) ) ; return $ dateTime -> format ( '[c]' ) . " " . $ this -> getLogLevelName ( $ level ) . " @" . $ this -> channel . " uid:" . $ this... | Renderiza el formato del mensaje |
59,233 | protected function getPhpRequiredVersion ( ) { if ( ! file_exists ( $ path = $ this -> rootPath . '/composer.lock' ) ) { return self :: LEGACY_REQUIRED_PHP_VERSION ; } $ composerLock = json_decode ( file_get_contents ( $ path ) , true ) ; foreach ( $ composerLock [ 'packages' ] as $ package ) { if ( $ package [ 'name' ... | Finds the PHP required version from Bolt version . |
59,234 | public function where ( $ parameter , $ value ) { if ( ! $ this -> verify ( $ parameter , $ value ) ) { return true ; } $ this -> search = $ this -> search -> where ( $ parameter , 'LIKE' , '%' . $ value . '%' ) ; } | Search a column on the model . |
59,235 | public function whereHas ( $ parameter , $ value ) { if ( ! $ this -> verify ( $ parameter , $ value ) ) { return true ; } $ this -> search = $ this -> search -> whereHas ( $ parameter , function ( $ query ) use ( $ value ) { $ query -> where ( 'rbac_roles.id' , $ value ) ; } ) ; } | Search the model for a particular relationship . This method expects to be passed the ID but the parameter name should be the relationship name . |
59,236 | protected function verify ( $ parameter , $ value ) { $ type = array_get ( $ this -> model -> getSearchParameters ( ) , $ parameter ) ; switch ( $ type ) { case 'array' : $ typeCheck = is_array ( $ value ) && ! empty ( array_filter ( $ value ) ) ; break ; case 'string' : $ typeCheck = ! is_numeric ( $ value ) && is_str... | Check if the given value is actually empty . This aims to help with discrepancies caused by form submission . |
59,237 | public function register ( $ customizeManager ) { $ customizeManager -> add_section ( 'clean_document_head' , [ 'title' => __ ( 'Clean Document Head' , 'novusopress' ) , 'description' => __ ( 'Allows you to remove extra HTML tags from the document head' , 'novusopress' ) , 'capability' => 'edit_theme_options' , 'priori... | Registers theme customizations |
59,238 | public static function gravatarHasher ( string $ string ) { $ string = strtolower ( $ string ) ; $ string = md5 ( $ string ) ; return $ string ; } | Hashes strings for Gravatar . |
59,239 | public function getConfiguration ( Request $ request ) { $ this -> request = $ request ; return [ 'headers' => $ request -> getHeaders ( ) -> all ( ) , 'query' => $ request -> getParameters ( ) -> all ( ) , ] ; } | Format the request for Guzzle . |
59,240 | public function interactiveGetAccessToken ( $ reason = null , $ redirectURL = null , $ errorURL = null ) { $ redirectURL = ( empty ( $ redirectURL ) ? $ _SERVER [ 'REQUEST_URI' ] : $ redirectURL ) ; $ errorURL = ( empty ( $ errorURL ) ? DataUtilities :: URLfromPath ( __DIR__ . '/../error.php' ) : $ errorURL ) ; $ canva... | Interactively acquire an API access token |
59,241 | public function interactiveConsumersControlPanel ( ) { $ name = ( empty ( $ _POST [ 'name' ] ) ? null : trim ( $ _POST [ 'name' ] ) ) ; $ key = ( empty ( $ _POST [ 'key' ] ) ? null : trim ( $ _POST [ 'key' ] ) ) ; $ secret = ( empty ( $ _POST [ 'secret' ] ) ? null : trim ( $ _POST [ 'secret' ] ) ) ; $ enabled = ( empty... | Handle tool consumer management interactively |
59,242 | public function getCache ( ) { if ( empty ( $ this -> cache ) ) { $ this -> cache = new HierarchicalSimpleCache ( $ this -> getMySQL ( ) , basename ( __FILE__ , '.php' ) ) ; } return $ this -> cache ; } | Get the cache manager |
59,243 | public function getSmarty ( ) { if ( empty ( $ this -> smarty ) ) { $ this -> smarty = StMarksSmarty :: getSmarty ( ) ; $ this -> smarty -> prependTemplateDir ( realpath ( __DIR__ . '/../templates' ) , __CLASS__ ) ; $ this -> smarty -> setFramed ( true ) ; } return $ this -> smarty ; } | Get the HTML templating engine |
59,244 | public function smarty_assign ( $ varname , $ var = null , $ noCache = false ) { return $ this -> getSmarty ( ) -> assign ( $ varname , $ var , $ noCache ) ; } | Assign a value to a template variables |
59,245 | public function smarty_addTemplateDir ( $ template , $ key = null , $ isConfig = false ) { return $ this -> getSmarty ( ) -> addTemplateDir ( $ template , $ key , $ isConfig ) ; } | Register another template directory |
59,246 | public function smarty_addMessage ( $ title , $ content , $ class = NotificationMessage :: INFO ) { return $ this -> getSmarty ( ) -> addMessage ( $ title , $ content , $ class ) ; } | Add a message to be displayed to the user |
59,247 | public function smarty_display ( $ template = 'page.tpl' , $ cache_id = null , $ compile_id = null , $ parent = null ) { return $ this -> getSmarty ( ) -> display ( $ template , $ cache_id , $ compile_id , $ parent ) ; } | Display an HTML template |
59,248 | public static function Tcbtdb ( $ tcb1 , $ tcb2 , & $ tdb1 , & $ tdb2 ) { $ t77td = DJM0 + DJM77 ; $ t77tf = TTMTAI / DAYSEC ; $ tdb0 = TDB0 / DAYSEC ; $ d ; if ( $ tcb1 > $ tcb2 ) { $ d = $ tcb1 - $ t77td ; $ tdb1 = $ tcb1 ; $ tdb2 = $ tcb2 + $ tdb0 - ( $ d + ( $ tcb2 - $ t77tf ) ) * ELB ; } else { $ d = $ tcb2 - $ t7... | - - - - - - - - - - i a u T c b t d b - - - - - - - - - - |
59,249 | private function addStackContext ( Exception $ exceptionRoot , array $ context ) { $ exception = $ exceptionRoot ; do { $ context = $ this -> processExceptionContext ( $ exception , $ context ) ; } while ( $ exception = $ exception -> getPrevious ( ) ) ; return $ context ; } | Add the context of each exception in the stack . |
59,250 | public function switchLocale ( $ locale ) { if ( in_array ( $ locale , $ this -> config [ 'locales' ] ) ) { app ( 'session' ) -> put ( 'administrator_locale' , $ locale ) ; } return redirect ( ) -> back ( ) ; } | POST method for switching a user s locale . |
59,251 | public function useStructureNodeQuery ( $ relationAlias = null , $ joinType = Criteria :: INNER_JOIN ) { return $ this -> joinStructureNode ( $ relationAlias , $ joinType ) -> useQuery ( $ relationAlias ? $ relationAlias : 'StructureNode' , '\gossi\trixionary\model\StructureNodeQuery' ) ; } | Use the StructureNode relation StructureNode object |
59,252 | public function useSkillRelatedBySkillIdQuery ( $ relationAlias = null , $ joinType = Criteria :: INNER_JOIN ) { return $ this -> joinSkillRelatedBySkillId ( $ relationAlias , $ joinType ) -> useQuery ( $ relationAlias ? $ relationAlias : 'SkillRelatedBySkillId' , '\gossi\trixionary\model\SkillQuery' ) ; } | Use the SkillRelatedBySkillId relation Skill object |
59,253 | public function useRootSkillQuery ( $ relationAlias = null , $ joinType = Criteria :: LEFT_JOIN ) { return $ this -> joinRootSkill ( $ relationAlias , $ joinType ) -> useQuery ( $ relationAlias ? $ relationAlias : 'RootSkill' , '\gossi\trixionary\model\SkillQuery' ) ; } | Use the RootSkill relation Skill object |
59,254 | public function setMaxRuntime ( $ maxRuntime ) { if ( ! is_numeric ( $ maxRuntime ) ) { throw new InvalidArgumentException ( 'Expected numeric $$maxRuntime argument' ) ; } $ this -> maxRuntime = ( int ) $ maxRuntime ; return $ this ; } | Set the maximum runtime in seconds . |
59,255 | protected function registerGatekeeper ( ) { $ parent = $ this ; $ this -> app -> singleton ( GatekeeperContract :: class , function ( ) use ( $ parent ) { return $ parent -> createGatekeeper ( ) ; } ) ; } | Register the gatekeeper |
59,256 | public function attachByScope ( CakeEventListener $ subscriber , $ manager = null , $ scope = null ) { if ( ! ( $ manager instanceof CakeEventManager ) ) { $ scope = $ manager ; $ _this = $ this ; } else { $ _this = $ manager ; } if ( empty ( $ scope ) ) { $ _this -> attach ( $ subscriber ) ; return ; } foreach ( $ sub... | Attach listeners for a specific scope only . |
59,257 | protected function registerBlockBladeDirective ( ) { Blade :: directive ( 'block' , function ( $ expression ) { $ expression = $ this -> sanitizeExpression ( $ expression ) ; list ( $ module , $ component ) = explode ( '::' , $ expression ) ; if ( view ( ) -> exists ( "$module::blocks.$component" ) ) { return "<?php ec... | Register the Blade directive for Blocks . |
59,258 | protected function bootModuleComponents ( ) { foreach ( $ this -> app [ 'modules' ] -> enabled ( ) as $ module ) { if ( $ this -> moduleHasBlocks ( $ module ) ) { $ this -> bootModuleBlocks ( $ module ) ; } } } | Boot components for all enabled modules . |
59,259 | public function shouldProcess ( $ filename ) { $ destination = $ this -> getFinalName ( $ filename ) ; if ( ! File :: exists ( $ destination ) ) { return true ; } $ destinationChanged = File :: lastModified ( $ destination ) ; $ currentChanged = File :: lastModified ( $ filename ) ; if ( $ currentChanged > $ destinatio... | Determines whether or not we need to reprocess the file . |
59,260 | protected function write ( $ contents , $ assetFileName ) { $ directory = $ this -> getOutputDirectory ( $ assetFileName ) ; $ filename = self :: getOutputFileName ( $ assetFileName ) ; $ fullpath = $ directory . $ filename ; if ( ! file_exists ( $ directory ) ) { mkdir ( $ directory , 0777 , true ) ; } file_put_conten... | Used internally in order to write the current version of the file to disk . |
59,261 | protected function getLayoutData ( $ reload = false ) { if ( $ reload || ! isset ( $ this -> layoutData [ __CLASS__ ] ) ) { $ this -> layoutData [ __CLASS__ ] = $ this -> loadLayoutData ( ) ; } return $ this -> layoutData [ __CLASS__ ] ; } | Get the data that will be sent to the layout . |
59,262 | public function insert ( $ element , $ priority = 0 ) { $ data = [ ] ; $ inserted = false ; $ priority = $ priority === 0 ? $ this -> lastPriority : $ priority ; foreach ( $ this -> data as $ datum ) { $ inserted = $ this -> tryToInsert ( $ element , $ priority , $ data , $ datum ) ; $ data [ ] = [ 'element' => $ datum... | Inserts the provided element in the right order given the priority |
59,263 | private function tryToInsert ( $ element , $ priority , & $ data , $ datum ) { $ inserted = false ; if ( $ datum [ 'priority' ] > $ priority ) { $ data [ ] = [ 'element' => $ element , 'priority' => $ priority ] ; $ inserted = true ; } return $ inserted ; } | Tries to insert the provided element in the passed data array |
59,264 | private function sanitizeHTML ( $ str ) { $ htmlValue = Injector :: inst ( ) -> create ( 'HTMLValue' , $ str ) ; $ santiser = Injector :: inst ( ) -> create ( 'HtmlEditorSanitiser' , HtmlEditorConfig :: get_active ( ) ) ; $ santiser -> sanitise ( $ htmlValue ) ; return $ htmlValue -> getContent ( ) ; } | Strips out not allowed tags mainly this is to remove the kapost beacon script so it doesn t conflict with the cms |
59,265 | public function getKeys ( ) : MList { $ list = new MList ( ) ; $ list -> appendArray ( array_keys ( $ this -> map ) ) ; return $ list ; } | Returns a list containing all the keys associated with value value in ascending order . |
59,266 | public function & getValue ( string $ key , $ defaultValue = null ) { if ( $ this -> isValidType ( $ defaultValue ) === false ) { throw new MWrongTypeException ( "\$value" , $ this -> getType ( ) , $ defaultValue ) ; } if ( isset ( $ this -> map [ $ key ] ) === false ) { return $ defaultValue ; } return $ this -> map [... | Returns the value associated with the key key . |
59,267 | public static function make ( ) { $ resolver = new TemplateResolver ( ) ; $ services = Provider :: getServices ( ) ; $ config = $ services -> get ( 'Config' ) ; if ( isset ( $ config [ 'error' ] [ 'html' ] [ 'templates' ] ) ) { $ templates = ( array ) $ config [ 'error' ] [ 'html' ] [ 'templates' ] ; foreach ( $ templa... | Makes the resolver . |
59,268 | public function set ( $ key , $ value ) { $ key = trim ( $ key , '.' ) ; if ( strpos ( $ key , '.' ) !== false ) { $ array = & $ this -> _items ; foreach ( explode ( '.' , $ key ) as $ v ) $ array = & $ array [ $ v ] ; $ array = $ value ; } else { $ this -> _items [ $ key ] = $ value ; } } | Add new item . |
59,269 | public function has ( $ key ) { $ key = trim ( $ key , '.' ) ; if ( strpos ( $ key , '.' ) !== false ) { $ array = & $ this -> _items ; foreach ( explode ( '.' , $ key ) as $ v ) { if ( ! isset ( $ array [ $ v ] ) ) return false ; else $ array = & $ array [ $ v ] ; } return true ; } else { return array_key_exists ( $ k... | Check if item exist . |
59,270 | private function delete ( array & $ array , $ key ) { $ key = trim ( $ key , '.' ) ; if ( strpos ( $ key , '.' ) !== false ) { $ explode = explode ( '.' , $ key ) ; $ this -> delete ( $ array [ $ explode [ 0 ] ] , $ explode [ 1 ] ) ; } else { unset ( $ array [ $ key ] ) ; } } | Delete item from an array . |
59,271 | public function rename ( $ from , $ to ) { $ from = trim ( $ from , '.' ) ; $ to = trim ( $ to , '.' ) ; if ( $ this -> has ( $ from ) ) { $ value = $ this -> get ( $ from ) ; $ this -> remove ( $ from ) ; $ this -> set ( $ to , $ value ) ; return true ; } return false ; } | Rename item . |
59,272 | public function pulse ( string $ command , bool $ force = false ) { return $ this -> run ( 'php pulse ' . $ command . ( $ force ? ' --force' : '' ) ) ; } | Run registered console command . Artisan commands will running too . |
59,273 | public function render ( Path $ path ) { $ html = null ; $ t = new TemplateLocator ( $ path ) ; foreach ( $ t -> next ( ) as $ template ) { $ context = $ this -> buildContext ( $ path , $ template ) ; if ( $ context === null ) continue ; $ html = $ this -> renderOrAbort ( $ template , $ context ) ; if ( $ html !== null... | Finds the appropriate way to render the requested page and returns a Response object . |
59,274 | public function getLocations ( ) { static $ _cwd = null ; static $ _paths = array ( 'public' , 'web' , ) ; if ( $ _cwd === null ) { $ _cwd = getcwd ( ) ; foreach ( $ _paths as $ _path ) { if ( is_dir ( $ _cwd . '/' . $ _path ) ) { $ this -> locations [ 'app' ] = $ _path . '/{$name}/' ; break ; } } } return parent :: ge... | DSP v1 uses web for HTML . DSP v2 will use public . This method checks to see which version we have and install to the proper directory . |
59,275 | public function getHostGroupsByHost ( Host $ host ) { return array_values ( array_filter ( $ this -> hostGroups , function ( $ g ) use ( $ host ) { return $ g -> hasHost ( $ host ) ; } ) ) ; } | Get the groups of which the supplied host is a member . |
59,276 | public static function validName ( string $ name ) : bool { $ enumerables = self :: getCache ( ) ; $ keys = array_keys ( $ enumerables ) ; return \ in_array ( $ name , $ keys , true ) ; } | Is a given name valid . |
59,277 | public static function validValue ( $ value ) : bool { $ enumerables = self :: getCache ( ) ; $ values = array_values ( $ enumerables ) ; return \ in_array ( $ value , $ values , true ) ; } | Does a given value exist in the cache . |
59,278 | public static function getName ( $ value ) { $ enumerables = self :: getCache ( ) ; $ result = array_search ( $ value , $ enumerables , true ) ; if ( $ result === false ) { throw EnumerableException :: valueNotFound ( ) ; } return $ result ; } | Return the name of the first constant to match a given value . |
59,279 | public static function getAllMatchingNames ( $ value ) : array { $ enumerables = self :: getCache ( ) ; $ result = array_keys ( $ enumerables , $ value , true ) ; if ( [ ] === $ result ) { throw EnumerableException :: valueNotFound ( ) ; } return $ result ; } | Return the names of all constants that match a given value . |
59,280 | public static function getValue ( string $ name ) { $ enumerables = self :: getCache ( ) ; if ( ! array_key_exists ( $ name , $ enumerables ) ) { throw EnumerableException :: nameInvalid ( $ name ) ; } return $ enumerables [ $ name ] ; } | Get value of a constant . |
59,281 | public static function getAllValues ( ) : array { $ enumerables = self :: getCache ( ) ; $ result = [ ] ; foreach ( $ enumerables as $ enumerable => $ value ) { $ result [ ] = $ value ; } return $ result ; } | Returns all enumerable values . |
59,282 | public static function getCache ( ) : array { $ caller = static :: class ; if ( ! array_key_exists ( $ caller , self :: $ cache ) ) { try { $ reflected_caller = new \ ReflectionClass ( $ caller ) ; self :: $ cache [ $ caller ] = $ reflected_caller -> getConstants ( ) ; } catch ( \ ReflectionException $ re ) { throw Enu... | Returns all constants of a class extending Enumerable . |
59,283 | public function __isset ( $ name ) { if ( isset ( $ this -> instances [ $ name ] ) ) { return true ; } elseif ( isset ( $ this -> autoloader ) ) { try { $ this -> $ name ; return true ; } catch ( InvalidModuleException $ e ) { } } return false ; } | Whether a module exists . |
59,284 | public function required ( $ name , $ class = null ) { if ( ! isset ( $ this -> $ name ) ) { throw new InvalidModuleException ( 'Undefined module: ' . $ name . ', required by ' . Utilities :: getCaller ( ) ) ; } if ( isset ( $ class ) and ! Utilities :: isSubclassOf ( $ this -> $ name , $ class ) ) { throw new InvalidM... | Expect a module to be loaded . |
59,285 | public function loadClassMetadata ( EventArgs $ eventArgs ) { if ( ! $ eventArgs instanceof CommonEventArgs && ! $ eventArgs instanceof OrmEventArgs ) { throw InvalidArgumentException :: create ( 'Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs' , $ eventArgs ) ; } $ ea = $ this -> getEventAdapter ( $ even... | Mapps additional metadata |
59,286 | public function setRichs ( $ richs ) { foreach ( $ richs as $ _rich ) { $ _rich -> setRichList ( $ this ) ; } $ this -> richs = $ richs ; return $ this ; } | Set richs . |
59,287 | public function addRich ( WidgetRichListItem $ rich ) { $ rich -> setRichList ( $ this ) ; $ this -> richs [ ] = $ rich ; return $ this ; } | Add richs . |
59,288 | public function add ( string $ email , string $ name = null ) : void { $ ccRecipient = $ this -> make ( ) ; $ ccRecipient -> email = $ email ; if ( $ name !== null ) { $ ccRecipient -> name = $ name ; } $ this -> set ( $ ccRecipient ) ; } | Add a cc recipient . |
59,289 | public function getLastRequest ( $ _asDomDocument = false ) { if ( self :: getSoapClient ( ) ) return self :: getFormatedXml ( self :: getSoapClient ( ) -> __getLastRequest ( ) , $ _asDomDocument ) ; return null ; } | Returns the last request content as a DOMDocument or as a formated XML String |
59,290 | public function getLastResponse ( $ _asDomDocument = false ) { if ( self :: getSoapClient ( ) ) return self :: getFormatedXml ( self :: getSoapClient ( ) -> __getLastResponse ( ) , $ _asDomDocument ) ; return null ; } | Returns the last response content as a DOMDocument or as a formated XML String |
59,291 | public function getLastRequestHeaders ( $ _asArray = false ) { $ headers = self :: getSoapClient ( ) ? self :: getSoapClient ( ) -> __getLastRequestHeaders ( ) : null ; if ( is_string ( $ headers ) && $ _asArray ) return self :: convertStringHeadersToArray ( $ headers ) ; return $ headers ; } | Returns the last request headers used by the SoapClient object as the original value or an array |
59,292 | public function getLastResponseHeaders ( $ _asArray = false ) { $ headers = self :: getSoapClient ( ) ? self :: getSoapClient ( ) -> __getLastResponseHeaders ( ) : null ; if ( is_string ( $ headers ) && $ _asArray ) return self :: convertStringHeadersToArray ( $ headers ) ; return $ headers ; } | Returns the last response headers used by the SoapClient object as the original value or an array |
59,293 | public function initInternArrayToIterate ( $ _array = array ( ) , $ _internCall = false ) { if ( stripos ( $ this -> __toString ( ) , 'array' ) !== false ) { if ( is_array ( $ _array ) && count ( $ _array ) ) { $ this -> setInternArrayToIterate ( $ _array ) ; $ this -> setInternArrayToIterateOffset ( 0 ) ; $ this -> se... | Method initiating internArrayToIterate |
59,294 | public function run ( Request $ request , Closure $ last = null ) { if ( is_null ( $ last ) ) { $ last = function ( $ request ) { return true ; } ; } $ middleares = $ this -> getMiddlewares ( ) ; for ( $ i = count ( $ middleares ) - 1 ; $ i >= 0 ; $ i -- ) { $ middleware = $ middleares [ $ i ] ; $ atual = function ( $ ... | Executar os middlewares . |
59,295 | public function getLimitClause ( $ limit = 0 ) { $ query = NULL ; $ page = $ this -> getState ( "currentpage" , 0 ) ; $ limit = empty ( $ limit ) ? ( int ) $ this -> getListLimit ( ) : $ limit ; $ offset = $ this -> getListOffset ( $ page , 0 ) ; if ( ! empty ( $ limit ) ) : $ this -> setListLimit ( $ limit ) ; $ this ... | Returns a limit clause based on datamodel limit and limitoffset states |
59,296 | public function getState ( $ state , $ default = NULL ) { $ state = isset ( $ this -> states [ $ state ] ) ? $ this -> states [ $ state ] : $ default ; return $ state ; } | Returns a data model state |
59,297 | public function getListLimit ( $ default = 0 ) { $ limit = $ this -> getState ( "limit" , intval ( $ default ) ) ; $ limit = empty ( $ limit ) ? $ this -> config -> get ( "content.lists.length" , 20 ) : $ limit ; return $ limit ; } | Gets lists limit for page d lists |
59,298 | public function getListOffset ( $ page = 1 , $ default = 0 ) { $ limit = $ this -> getListLimit ( ) ; $ offset = $ this -> getState ( "limitoffset" , intval ( $ default ) ) ; $ offset = empty ( $ offset ) ? ( empty ( $ page ) || ( int ) $ page <= 1 ) ? intval ( $ default ) : intval ( $ page - 1 ) * $ limit : $ offset ;... | Get list start for page d lists |
59,299 | public function setPagination ( ) { $ total = $ this -> getListTotal ( ) ; if ( empty ( $ total ) ) return null ; $ limit = $ this -> getListLimit ( ) ; $ current = $ this -> getState ( "currentpage" , 1 ) ; $ pages = array ( ) ; $ pages [ 'total' ] = ceil ( $ total / $ limit ) ; $ pages [ 'limit' ] = $ limit ; $ route... | Sets the pagination for the current output if any |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.