idx int64 0 60.3k | question stringlengths 99 4.85k | target stringlengths 5 718 |
|---|---|---|
57,100 | public function getConfig ( ) { if ( $ this -> config === null ) { $ path = $ this -> getInputDirectory ( ) . '/makedocs.json' ; if ( ! is_file ( $ path ) ) { throw new \ RuntimeException ( 'The input directory does not contain a makedocs.json file.' ) ; } $ data = json_decode ( file_get_contents ( $ path ) ) ; if ( ! ... | Gets the configuration of the project to generate the documentation for . |
57,101 | public function generate ( ) { if ( ! is_dir ( $ this -> getInputDirectory ( ) ) ) { throw new \ RuntimeException ( 'The MakeDocs input directory does not exist.' ) ; } if ( ! $ this -> builders ) { throw new \ RuntimeException ( 'No MakeDocs builders present.' ) ; } $ workingDirectory = getcwd ( ) ; chdir ( $ this -> ... | Generates the documentation for all the renderers . |
57,102 | public function cmdGetEvent ( ) { $ result = $ this -> getListEvent ( ) ; $ this -> outputFormat ( $ result ) ; $ this -> outputFormatTableEvent ( $ result ) ; $ this -> output ( ) ; } | Callback for event - get command |
57,103 | public function cmdDeleteEvent ( ) { if ( $ this -> getParam ( 'expired' ) ) { $ this -> report -> deleteExpired ( ) ; } else { $ this -> report -> delete ( ) ; } $ this -> output ( ) ; } | Callback for event - delete command |
57,104 | protected function getListEvent ( ) { $ options = array ( 'order' => 'desc' , 'sort' => 'created' , 'limit' => $ this -> getLimit ( ) , 'severity' => $ this -> getParam ( 'severity' ) ) ; return ( array ) $ this -> report -> getList ( $ options ) ; } | Returns an array of events |
57,105 | protected function outputFormatTableEvent ( array $ events ) { $ header = array ( $ this -> text ( 'Text' ) , $ this -> text ( 'Type' ) , $ this -> text ( 'Severity' ) , $ this -> text ( 'Created' ) ) ; $ rows = array ( ) ; foreach ( $ events as $ item ) { $ text = empty ( $ item [ 'translatable' ] ) ? $ item [ 'text' ... | Output events in a table |
57,106 | public function toSQL ( Parameters $ params , bool $ inner_clause ) { $ name = $ this -> getTable ( ) ; $ alias = $ this -> getAlias ( ) ; $ prefix_disabled = $ this -> getDisablePrefixing ( ) ; $ drv = $ params -> getDriver ( ) ; list ( $ tname , $ talias ) = $ params -> resolveTable ( $ name ) ; if ( ! empty ( $ tali... | Write an function as SQL query syntax |
57,107 | public function readFile ( string $ file_name ) { $ data = array ( ) ; $ this -> file_handle = fopen ( $ file_name , "r" ) ; foreach ( $ this as $ row ) $ data [ ] = $ row ; return $ data ; } | Read CSV data from a file |
57,108 | public function readFileHandle ( $ file_handle ) { if ( ! is_resource ( $ file_handle ) ) throw new \ InvalidArgumentException ( "No file handle was provided" ) ; $ data = array ( ) ; $ this -> file_handle = $ file_handle ; foreach ( $ this as $ row ) $ data [ ] = $ row ; return $ data ; } | Read CSV from a stream . |
57,109 | public function readString ( string $ data ) { $ this -> file_handle = fopen ( 'php://temp' , 'rw' ) ; fwrite ( $ this -> file_handle , $ data ) ; $ data = array ( ) ; foreach ( $ this as $ row ) $ data [ ] = $ row ; return $ data ; } | Read CSV from a string . This will write the data to a temporary stream |
57,110 | public function rewind ( ) { rewind ( $ this -> file_handle ) ; $ this -> line_number = 0 ; $ this -> current_line = null ; $ this -> header = null ; } | Rewind the file handle to the start |
57,111 | public function loadJson ( $ filename ) { $ result = false ; if ( file_exists ( $ filename ) && is_file ( $ filename ) ) { $ json = file_get_contents ( $ filename ) ; $ data = json_decode ( $ json , true ) ; if ( is_array ( $ data ) ) { foreach ( $ data as $ name => $ value ) { $ this -> __set ( $ name , $ value ) ; } ... | Load options from filename . json |
57,112 | protected function getDefault ( $ name ) { if ( is_null ( $ this -> _defaultData ) ) { $ subject = $ this -> getSubject ( ) ; if ( ! is_null ( $ subject ) && $ subject instanceof Options_Subject ) { $ this -> _defaultData = $ subject -> getDefaultOptions ( ) ; } else { $ this -> _defaultData = array ( ) ; } } if ( isse... | Return default value |
57,113 | protected function getLocaleFromUrl ( string $ url ) { $ locale = trim ( substr ( $ url , 0 , 3 ) , '/' ) ; if ( strlen ( $ locale ) > 2 || strlen ( $ locale ) < 2 ) { return false ; } return $ locale ; } | Gets the locale out of the url if it s in |
57,114 | protected function isUARouted ( string $ url ) { $ exploded = explode ( '/' , $ url ) ; $ uaRoute = $ exploded [ 0 ] ; $ routingData = $ this -> getParameter ( 'field_cito.routing.user_agent_routing' ) ; foreach ( $ routingData as $ route => $ browsers ) { if ( $ route === $ uaRoute ) { return true ; } } return false ;... | Checks if UserAgent is Routed |
57,115 | protected static function getBrowserData ( $ userAgent ) { $ matches = [ ] ; if ( strpos ( $ userAgent , 'Opera' ) !== false ) { $ browserName = 'Opera' ; preg_match_all ( '/Version\/([\d]+)/' , $ _SERVER [ 'HTTP_USER_AGENT' ] , $ matches ) ; } elseif ( strpos ( $ userAgent , 'OPR/' ) !== false ) { $ browserName = 'Ope... | Gets the browser data |
57,116 | protected function render ( Template $ template ) { $ presenter = $ this -> createPresenter ( $ template -> getPresenter ( ) ) ; try { $ arguments = $ this -> getArguments ( $ presenter , $ template ) ; $ this -> logger -> debug ( $ arguments ) ; $ result = call_user_func_array ( $ presenter , $ arguments ) ; } catch (... | Loads a presenter calls its method and returns the result . |
57,117 | protected function createPresenter ( $ presenter ) { if ( false === strpos ( $ presenter , '::' ) ) { throw new TemplateEngineException ( sprintf ( 'Presenter must be in the format class|service::method' , $ presenter ) ) ; } list ( $ class , $ method ) = explode ( '::' , $ presenter , 2 ) ; $ presenter = $ this -> app... | Returns a callable for the given presenter . |
57,118 | public function generate ( $ length ) { $ realPool = $ this -> mergePools ( $ this -> characterPools ) ; $ max = ( count ( $ realPool ) - 1 ) ; mt_srand ( ) ; $ randomString = '' ; for ( $ i = 0 ; $ i < $ length ; $ i ++ ) { $ randomString .= $ realPool [ mt_rand ( 0 , $ max ) ] ; } return $ randomString ; } | Generates a random string with the given length based on the character pools . |
57,119 | protected function mergePools ( $ pools ) { $ mergedPool = [ ] ; foreach ( $ pools as $ pool ) { foreach ( $ pool -> getCharacters ( ) as $ character ) { $ mergedPool [ ] = $ character ; } } return $ mergedPool ; } | Merges all characters from the registered pools into one array . |
57,120 | protected function _validateParams ( $ args , $ spec ) { $ errors = $ this -> _getArgsListErrors ( $ args , $ spec ) ; if ( $ this -> _countIterable ( $ errors ) ) { throw $ this -> _createValidationFailedException ( null , null , null , null , $ args , $ errors ) ; } } | Validates a function or method s arguments according to the method s parameter specification . |
57,121 | public static function construct ( $ minMatches = .7 , $ maxDistance = .2 ) { $ fuzzy = new static ( ) ; $ fuzzy -> minMatches = $ minMatches ; $ fuzzy -> maxDistance = $ maxDistance ; return $ fuzzy ; } | Creates a new instance of NyaaMatcher \ Fuzzy |
57,122 | public function calculatePrecedence ( ) { $ this -> precedence = 0 ; if ( ! $ this -> hasContextRules ( ) ) { return ; } foreach ( $ this -> context as $ token_name => $ rules ) { foreach ( $ rules as $ context_key => $ rule_key ) { if ( $ rule_key == "other" ) $ this -> precedence += 1 ; } } } | the precedence is based on the number of fallback rules in the context . a fallback rule is indicated by the keyword other the more others are used the lower the precedence will be |
57,123 | public function scanDirectory ( string $ path ) : array { $ files = [ ] ; $ rdi = new \ RecursiveDirectoryIterator ( $ path , \ FilesystemIterator :: SKIP_DOTS | \ FilesystemIterator :: KEY_AS_FILENAME | \ FilesystemIterator :: CURRENT_AS_FILEINFO ) ; $ rii = new \ RecursiveIteratorIterator ( $ rdi ) ; foreach ( $ rii ... | Scans the given directory and its sub - directories and returns a list of all the files |
57,124 | public function markdownToText ( string $ markdown ) : string { if ( empty ( $ markdown ) ) { return '' ; } $ pattern = array ( '/(\.|)#/' , '/(\.|)\*/' , '/(\.|)~/' ) ; return preg_replace ( $ pattern , '' , $ markdown ) ; } | Strips the given text of the markdown but not \ n . |
57,125 | public function startswith ( string $ haystack , string $ needle ) : bool { return ( substr ( $ haystack , 0 , strlen ( $ needle ) ) === $ needle ) ; } | String startswith . |
57,126 | public function endswith ( string $ haystack , string $ needle ) : bool { return ( substr ( $ haystack , - 1 * strlen ( $ needle ) ) === $ needle ) ; } | String endswith . |
57,127 | function getSource ( $ name ) { if ( isset ( $ this -> site -> pages [ $ name ] ) ) { $ content = $ this -> site -> pages [ $ name ] ; } else { throw new \ Exception ( "Cannot find content \"$name\"." ) ; } if ( ! $ content -> template ) { throw new \ Exception ( "Content does not have a template" ) ; } if ( $ content ... | Generates the template for a given page path . |
57,128 | public function write ( Iterator $ dataIterator ) { $ this -> initialize ( ) ; foreach ( $ dataIterator as $ item ) { $ this -> writeItem ( $ item ) ; } $ this -> finish ( ) ; } | Write the feed . |
57,129 | public function validateIdentity ( $ attributes , $ params ) { $ metadata = UserMetadata :: model ( ) -> findByAttributes ( array ( 'key' => $ this -> provider . 'Provider' , 'value' => $ this -> adapter -> identifier ) ) ; if ( $ metadata == NULL ) { $ this -> addError ( 'adapter' , Yii :: t ( 'HybridAuth.main' , 'Una... | Validates that we have an identity on file for this user |
57,130 | public function login ( ) { if ( ! $ this -> authenticate ( ) ) return false ; if ( $ this -> _identity -> errorCode === RemoteUserIdentity :: ERROR_NONE ) { Yii :: app ( ) -> user -> logout ( ) ; return Yii :: app ( ) -> user -> login ( $ this -> _identity , 3600 * 24 ) ; } else return false ; } | Logins the user in using their Remote user information |
57,131 | public function roles ( ) : BelongsToMany { $ pivotTable = config ( 'lia.database.role_users_table' ) ; $ relatedModel = config ( 'lia.database.roles_model' ) ; return $ this -> belongsToMany ( $ relatedModel , $ pivotTable , 'user_id' , 'role_id' ) ; } | A user has and belongs to many roles . |
57,132 | public function permissions ( ) : BelongsToMany { $ pivotTable = config ( 'lia.database.user_permissions_table' ) ; $ relatedModel = config ( 'lia.database.permissions_model' ) ; return $ this -> belongsToMany ( $ relatedModel , $ pivotTable , 'user_id' , 'permission_id' ) ; } | A User has and belongs to many permissions . |
57,133 | public function register ( $ method , $ url , $ action ) { if ( in_array ( $ method , $ this -> _methods ) ) { if ( is_array ( $ action ) ) { if ( ! empty ( $ action ) ) { $ exp = explode ( '@' , $ action [ 'uses' ] ) ; $ this -> _routes [ ] = [ 'controller' => $ exp [ 0 ] , 'action' => $ exp [ 1 ] , 'method' => $ meth... | Registers each route . |
57,134 | public static function make ( $ uri , array $ queryParameters = [ ] ) { $ uri = ( $ uri instanceof UriInterface ) ? $ uri : new Uri ( $ uri ) ; if ( $ queryParameters ) { $ uri = static :: addQueryParameters ( $ uri , $ queryParameters ) ; } return $ uri ; } | Makes PSR - 7 compliant Uri object |
57,135 | protected function execLoginForm ( ) { $ this -> loadTranslations ( 'form' , sprintf ( 'private/global/locales/%s/form.ini' , LANGUAGE ) ) ; $ this -> templateParameters [ 'translations' ] = $ this -> translations ; $ this -> renderTemplate ( ) ; } | displays login form |
57,136 | private function getUserData ( ) { $ auth = $ this -> authFactory -> newInstance ( ) ; return null !== $ auth -> getUserData ( ) ? $ auth -> getUserData ( ) : false ; } | gets current user |
57,137 | private function setUserData ( $ property , $ value ) { $ auth = $ this -> authFactory -> newInstance ( ) ; $ userData = $ auth -> getUserData ( ) ; if ( ! $ userData ) { return ; } $ userData [ $ property ] = $ value ; $ auth -> setUserData ( $ userData ) ; } | Sets a property for current user |
57,138 | private function hasUniqueConstraint ( ClassMetadata $ metadata , array $ columns ) { if ( ! isset ( $ metadata -> table [ 'uniqueConstraints' ] ) ) { return false ; } foreach ( $ metadata -> table [ 'uniqueConstraints' ] as $ constraint ) { if ( ! array_diff ( $ constraint [ 'columns' ] , $ columns ) ) { return true ;... | Check if an unique constraint has been defined . |
57,139 | public function postLoad ( LifecycleEventArgs $ args ) { $ entity = $ args -> getEntity ( ) ; if ( ! $ entity instanceof TranslatableInterface ) { return ; } $ entity -> initializeTranslations ( ) ; $ entity -> setCurrentLocale ( $ this -> localeProvider -> getCurrentLocale ( ) ) ; $ entity -> setFallbackLocale ( $ thi... | Translatable post load event handler . |
57,140 | public function onTranslatablePreFlush ( TranslatableInterface $ translatable , PreFlushEventArgs $ event ) { if ( null === $ config = $ this -> registry -> findConfiguration ( $ translatable , false ) ) { return ; } $ accessor = $ this -> getPropertyAccessor ( ) ; foreach ( $ translatable -> getTranslations ( ) as $ t... | Translatable pre flush event handler . |
57,141 | public function onMenuConfigure ( ConfigureMenuEvent $ event ) { if ( $ this -> permissionResolver -> hasAccess ( 'uisites' , 'read' ) ) { $ menu = $ event -> getMenu ( ) ; $ menu -> addChild ( self :: ITEM_SITES , [ ] ) ; } } | Add Sites entry menu . |
57,142 | protected function composeViews ( ) { View :: composer ( 'app' , function ( $ view ) { $ view -> getFactory ( ) -> inject ( 'account' , view ( 'user::menu' , [ 'guest' => Auth :: guest ( ) , 'user' => Auth :: user ( ) ] ) ) ; } ) ; View :: composer ( 'admin' , function ( $ view ) { $ view -> getFactory ( ) -> inject ( ... | composes admin views . |
57,143 | public function splitName ( $ name , $ firstOrSurname = "surname" ) { $ name = trim ( $ name ) ; $ positionOfFinalSpace = strrpos ( $ name , " " ) ; if ( $ firstOrSurname == "surname" ) { return substr ( $ name , $ positionOfFinalSpace + 1 , strlen ( $ name ) ) ; } return substr ( $ name , 0 , $ positionOfFinalSpace ) ... | First name and surnames are combined during registration . Split em and return either the first name or the suranme |
57,144 | private function setDefaultLocale ( $ lang ) { if ( $ lang === null ) { $ this -> defaultLanguage = $ this -> languages [ 0 ] ; return ; } if ( ! $ this -> hasLocale ( $ lang ) ) { if ( ! is_string ( $ lang ) ) { $ lang = is_object ( $ lang ) ? get_class ( $ lang ) : gettype ( $ lang ) ; } throw new InvalidArgumentExce... | Set the default language . |
57,145 | public function setCurrentLocale ( $ lang ) { if ( $ lang === null ) { $ this -> currentLanguage = null ; return ; } if ( ! $ this -> hasLocale ( $ lang ) ) { if ( ! is_string ( $ lang ) ) { $ lang = is_object ( $ lang ) ? get_class ( $ lang ) : gettype ( $ lang ) ; } throw new InvalidArgumentException ( sprintf ( 'Uns... | Set the current language . |
57,146 | private function setLocales ( array $ locales ) { $ locales = $ this -> filterLocales ( $ locales ) ; uasort ( $ locales , [ $ this , 'sortLocalesByPriority' ] ) ; $ this -> locales = [ ] ; $ this -> languages = [ ] ; foreach ( $ locales as $ langCode => $ locale ) { $ this -> locales [ $ langCode ] = $ locale ; $ this... | Set the available languages . |
57,147 | private function filterLocales ( array $ locales ) { $ z = self :: DEFAULT_SORT_PRIORITY ; $ filteredLocales = [ ] ; foreach ( $ locales as $ langCode => $ locale ) { if ( isset ( $ locale [ 'active' ] ) && ! $ locale [ 'active' ] ) { continue ; } if ( ! isset ( $ locale [ 'priority' ] ) ) { $ locale [ 'priority' ] = $... | Filter the available languages . |
57,148 | private function tokenize ( ) { $ this -> tokenizeTitle ( ) ; $ this -> tokenizeFields ( ) ; $ this -> tokenizeBricks ( ) ; $ this -> tokenizeDynamicBricks ( ) ; $ this -> tokenVector = array_filter ( $ this -> tokenVector ) ; arsort ( $ this -> tokenVector ) ; } | Execute tokenization of all document fields |
57,149 | private function addTokenToVector ( $ token , $ field , $ count = 1 ) { if ( ! empty ( $ token ) ) { if ( isset ( $ this -> tokenVector [ $ field ] [ $ token ] ) ) { $ this -> tokenVector [ $ field ] [ $ token ] += $ count ; } else { $ this -> tokenVector [ $ field ] [ $ token ] = $ count ; } } } | Add a token to the existing tokenvector |
57,150 | private function addTokenVectorToVector ( $ tokenVector , $ field ) { foreach ( $ tokenVector as $ token => $ count ) { $ this -> addTokenToVector ( $ token , $ field , $ count ) ; } } | Add a complete token vector to the existing one . |
57,151 | private function getFieldType ( $ fieldName , $ documentDefinition ) { foreach ( $ documentDefinition -> fields as $ fieldTypeDefinition ) { if ( $ fieldTypeDefinition -> slug === $ fieldName ) { return $ fieldTypeDefinition -> type ; } } throw new \ Exception ( 'Unknown field type for field' . $ fieldName . ' in docum... | Get the type for a field |
57,152 | public function isDifferentEmail ( ExecutionContextInterface $ context ) { if ( $ this -> getEmail ( ) == $ this -> getFrom ( ) -> getEmail ( ) ) { $ context -> buildViolation ( 'You can\'t invite yourself!' ) -> atPath ( 'email' ) -> addViolation ( ) ; } } | Callback to check the if is a different email from it self |
57,153 | final protected static function callErrorLogger ( $ level , $ message ) { if ( is_null ( static :: $ errorLoggerInstance ) ) { static :: $ errorLoggerInstance = new self ; } static :: $ errorLoggerInstance -> { static :: $ errorLoggerInstance -> errorToLogLevel ( $ level ) } ( $ message ) ; } | Passes the error to logger as an exception converting error level to Logger level . |
57,154 | public function setLogLevel ( $ logLevel ) { if ( ! is_string ( $ logLevel ) || '' === ( $ level = strtolower ( $ logLevel ) ) || ! isset ( $ this -> levelMap [ $ level ] ) ) { throw new \ InvalidArgumentException ( sprintf ( '%s - Log level must be one of the following values: ["%s"]. %s seen.' , get_called_class ( )... | setLogLevel will limit what is written to a level greater than or equal to value passed in . |
57,155 | protected function tryLog ( $ msg , $ tries = 0 ) { if ( ( bool ) @ fwrite ( $ this -> stream , $ msg ) ) return ; if ( 0 < $ tries ) { trigger_error ( sprintf ( '%s - Unable to log message: "%s"' , get_called_class ( ) , $ tries , $ msg ) ) ; return ; } $ this -> attemptStreamRecovery ( ) ; $ this -> tryLog ( $ msg , ... | tryLog will attempt to write output to local stream . If unable will kick - off re - open attempt |
57,156 | protected function attemptStreamRecovery ( ) { if ( 'resource' === gettype ( $ this -> stream ) ) { @ fflush ( $ this -> stream ) ; @ fclose ( $ this -> stream ) ; } $ this -> stream = fopen ( $ this -> streamURI , $ this -> streamMode ) ; if ( false === $ this -> stream ) { trigger_error ( sprintf ( '%s - Unable to wr... | Will attempt to re - open stream in the event that it was closed unexpectedly . Will use default if unable to re - open custom |
57,157 | protected function insertEntry ( MenuEntry $ entry , $ ndx = NULL ) { if ( $ entry instanceof DynamicMenuEntry ) { $ this -> dynamicEntries [ ] = $ entry ; } if ( ! isset ( $ ndx ) || $ ndx >= count ( $ this -> entries ) ) { $ this -> entries [ ] = $ entry ; } else { array_splice ( $ this -> entries , $ ndx , 0 , [ $ e... | insert or append menu entry |
57,158 | public function insertEntries ( array $ entries , $ ndx ) { foreach ( $ entries as $ e ) { $ this -> insertEntry ( $ e , $ ndx ++ ) ; } return $ this ; } | insert or append several MenuEntry objects |
57,159 | public function insertBeforeEntry ( MenuEntry $ new , MenuEntry $ pos ) { foreach ( $ this -> entries as $ k => $ e ) { if ( $ e === $ pos ) { $ this -> insertEntry ( $ new , $ k ) ; break ; } } return $ this ; } | insert a MenuEntry before an existing MenuEntry |
57,160 | public function replaceEntry ( MenuEntry $ new , MenuEntry $ toReplace ) { foreach ( $ this -> entries as $ k => $ e ) { if ( $ e === $ toReplace ) { $ this -> insertEntry ( $ new , $ k ) ; $ this -> removeEntry ( $ toReplace ) ; break ; } } return $ this ; } | replace a MenuEntry by another one |
57,161 | public function removeEntry ( MenuEntry $ toRemove ) { foreach ( $ this -> entries as $ k => $ e ) { if ( $ e === $ toRemove ) { array_splice ( $ this -> entries , $ k , 1 ) ; if ( $ toRemove instanceof DynamicMenuEntry ) { $ ndx = array_search ( $ toRemove , $ this -> dynamicEntries , TRUE ) ; if ( $ ndx !== FALSE ) {... | remove a MenuEntry |
57,162 | public function isSecondaryLocal ( ) { if ( ! $ this -> isSecondary ( ) ) { return false ; } $ hashKey = $ this -> getHashKey ( ) -> getPropertyMetadata ( ) -> name ; $ hashKeyPrimary = $ this -> class -> getIndex ( ) -> getHashKey ( ) -> getPropertyMetadata ( ) -> name ; return $ hashKey === $ hashKeyPrimary ; } | Is this a local secondary index? |
57,163 | static function LastPageModLog ( Page $ page , Interfaces \ IContainerReferenceResolver $ resolver ) { $ lastLog = self :: LastPageLog ( $ page ) ; $ pageContents = PageContent :: Schema ( ) -> FetchByPage ( false , $ page ) ; foreach ( $ pageContents as $ pageContent ) { $ content = $ pageContent -> GetContent ( ) ; $... | Gets the last page modification log item |
57,164 | static function LastContainerModLog ( Container $ container ) { $ lastLog = self :: LastContainerLog ( $ container ) ; $ containerContents = ContainerContent :: Schema ( ) -> FetchByContainer ( false , $ container ) ; foreach ( $ containerContents as $ containerContent ) { $ content = $ containerContent -> GetContent (... | Gets the last container modification log item |
57,165 | static function LastLayoutModLog ( Layout $ layout ) { $ lastLog = $ this -> LastLayoutLog ( $ layout ) ; $ areas = Area :: Schema ( ) -> FetchByLayout ( false , $ layout ) ; foreach ( $ areas as $ area ) { $ areaLog = self :: LastAreaModLog ( $ area ) ; if ( self :: IsAfter ( $ areaLog , $ lastLog ) ) { $ lastLog = $ ... | Gets the last layout modification log item |
57,166 | static function LastAreaModLog ( Area $ area , Interfaces \ IContainerReferenceResolver $ resolver ) { $ lastLog = $ this -> LastAreaLog ( $ area ) ; $ areaContents = LayoutContent :: Schema ( ) -> FetchByArea ( false , $ area ) ; foreach ( $ areaContents as $ areaContent ) { $ content = $ areaContent -> GetContent ( )... | Gets the last area modification log item |
57,167 | function LastContentModLog ( Content $ content , Interfaces \ IContainerReferenceResolver $ resolver = null ) { $ lastLog = self :: LastContentLog ( $ content ) ; $ container = $ resolver ? $ resolver -> GetReferencedContainer ( $ content ) : null ; if ( $ container ) { $ containerLog = self :: LastContainerModLog ( $ ... | Gets the last content modification log item |
57,168 | static function IsAfter ( LogItem $ lhs = null , LogItem $ rhs = null ) { if ( ! $ lhs ) { return false ; } if ( ! $ rhs ) { return true ; } return $ lhs -> GetChanged ( ) -> IsAfter ( $ rhs -> GetChanged ( ) ) ; } | Compares two log item by date |
57,169 | static function LastPageLog ( Page $ page ) { $ tblLogPage = LogPage :: Schema ( ) -> Table ( ) ; $ tblLogItem = LogItem :: Schema ( ) -> Table ( ) ; $ sql = Access :: SqlBuilder ( ) ; $ orderBy = $ sql -> OrderList ( $ sql -> OrderDesc ( $ tblLogItem -> Field ( 'Changed' ) ) ) ; $ joinCond = $ sql -> Equals ( $ tblLog... | The last log item that is directly related to the page |
57,170 | static function LastContentLog ( Content $ content ) { $ tblLogContent = LogContent :: Schema ( ) -> Table ( ) ; $ tblLogItem = LogItem :: Schema ( ) -> Table ( ) ; $ sql = Access :: SqlBuilder ( ) ; $ orderBy = $ sql -> OrderList ( $ sql -> OrderDesc ( $ tblLogItem -> Field ( 'Changed' ) ) ) ; $ joinCond = $ sql -> Eq... | The last log item that is directly related to the content |
57,171 | static function LastLayoutLog ( Layout $ layout ) { $ tblLogLayout = LogLayout :: Schema ( ) -> Table ( ) ; $ tblLogItem = LogItem :: Schema ( ) -> Table ( ) ; $ sql = Access :: SqlBuilder ( ) ; $ orderBy = $ sql -> OrderList ( $ sql -> OrderDesc ( $ tblLogItem -> Field ( 'Changed' ) ) ) ; $ joinCond = $ sql -> Equals ... | The last log item that is directly related to the layout |
57,172 | static function LastAreaLog ( Area $ area ) { $ tblLogArea = LogArea :: Schema ( ) -> Table ( ) ; $ tblLogItem = LogItem :: Schema ( ) -> Table ( ) ; $ sql = Access :: SqlBuilder ( ) ; $ orderBy = $ sql -> OrderList ( $ sql -> OrderDesc ( $ tblLogItem -> Field ( 'Changed' ) ) ) ; $ joinCond = $ sql -> Equals ( $ tblLog... | The last log item that is directly related to the area |
57,173 | static function LastContainerLog ( Container $ container ) { $ tblLogContainer = LogContainer :: Schema ( ) -> Table ( ) ; $ tblLogItem = LogItem :: Schema ( ) -> Table ( ) ; $ sql = Access :: SqlBuilder ( ) ; $ orderBy = $ sql -> OrderList ( $ sql -> OrderDesc ( $ tblLogItem -> Field ( 'Changed' ) ) ) ; $ joinCond = $... | The last log item that is directly related to the container |
57,174 | static function LastTemplateLog ( $ moduleType , $ template ) { $ tblLogTemplate = \ App \ Phine \ Database \ Core \ LogTemplate :: Schema ( ) -> Table ( ) ; $ tblLogItem = LogItem :: Schema ( ) -> Table ( ) ; $ sql = Access :: SqlBuilder ( ) ; $ orderBy = $ sql -> OrderList ( $ sql -> OrderDesc ( $ tblLogItem -> Field... | The last log item that is directly related to the template |
57,175 | private function getDrupalEntityPath ( $ type , $ entity ) { $ uri = entity_uri ( $ type , $ entity ) ; if ( ! $ uri ) { throw new \ InvalidArgumentException ( sprintf ( "%s: entity type is not supported yet" ) ) ; } return $ uri [ 'path' ] ; } | Uses drupal 7 API to generate the entity URL |
57,176 | public function getEntityPath ( $ type , $ id ) { $ event = new EntityGetPathEvent ( $ type , $ id ) ; $ this -> eventDispatcher -> dispatch ( EntityGetPathEvent :: EVENT_GET_PATH , $ event ) ; if ( $ path = $ event -> getPath ( ) ) { return $ path ; } if ( 'node' === $ type ) { return 'node/' . $ id ; } $ entity = $ t... | Get entity internal path |
57,177 | public function getEntityPathFromURI ( $ uri ) { if ( $ parts = $ this -> decomposeURI ( $ uri ) ) { return $ this -> getEntityPath ( $ parts [ 'type' ] , $ parts [ 'id' ] ) ; } throw new \ InvalidArgumentException ( sprintf ( "%s: invalid entity URI scheme or malformed URI" , $ uri ) ) ; } | Get entity internal path from internal URI |
57,178 | public function decomposeURI ( $ uri , & $ type = null ) { $ elements = [ ] ; if ( ! self :: URIIsCandidate ( $ uri ) ) { return $ elements ; } foreach ( $ this -> getURIPatterns ( ) as $ name => $ pattern ) { if ( preg_match ( $ pattern , $ uri , $ matches ) ) { $ type = $ name ; $ elements = [ 'type' => $ matches [ '... | Extract entity type and id from the given URI . |
57,179 | public function formatURI ( $ type , $ id , $ uriType = self :: SCHEME_TYPE ) { switch ( $ uriType ) { case self :: SCHEME_TYPE : return 'entity://' . $ type . '/' . $ id ; case self :: STACHE_TYPE : return '{{' . $ type . '/' . $ id . '}}' ; } throw new \ InvalidArgumentException ( sprintf ( "%s: invalid URI type" , $... | Format an URI . |
57,180 | public function replaceAllInText ( $ text ) { $ uriInfo = [ ] ; foreach ( $ this -> getURIPatterns ( ) as $ pattern ) { $ matches = [ ] ; if ( preg_match_all ( $ pattern , $ text , $ matches , PREG_SET_ORDER | PREG_OFFSET_CAPTURE ) ) { foreach ( $ matches as $ match ) { list ( $ uri , $ offset ) = $ match [ 0 ] ; $ uri... | Replace all occurences of entity URIs in text by the generated URLs . |
57,181 | private function saveCacheFile ( $ path , $ data ) { if ( ! is_writable ( $ this -> dir ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The directory "%s" is not writable. Both, the webserver and the console user need access. You can manage access rights for multiple users with "chmod +a". If your system does n... | Saves the cache file . |
57,182 | public static function getLanguage ( ) { if ( ! self :: $ language ) { self :: $ language = Language :: findByCode ( App :: getLocale ( ) ) ; } if ( ! self :: $ language ) { abort ( 404 , 'Language could not be found' ) ; } return self :: $ language ; } | Get application Language instance |
57,183 | public static function setLanguage ( $ language ) { if ( ! ( $ language instanceof Language ) ) { $ language = Language :: findByCode ( $ language ) ; } if ( ! $ language ) { return false ; } App :: setLocale ( $ language -> code ) ; request ( ) -> setDefaultLocale ( $ language -> code ) ; self :: $ language = $ langua... | Set application Language instance |
57,184 | public function actionTheme ( ) { $ theme = Cii :: getConfig ( 'theme' , 'default' ) ; if ( ! file_exists ( Yii :: getPathOfAlias ( 'base.themes.' . $ theme ) . DS . 'Theme.php' ) ) throw new CHttpException ( 400 , Yii :: t ( 'Dashboard.main' , 'The requested theme type is not set. Please set a theme before attempting ... | Provides control for Theme management |
57,185 | function get ( $ action , $ params = array ( ) , $ options = array ( ) ) { $ options [ "method" ] = "GET" ; return $ this -> _doRequest ( $ action , $ params , $ options ) ; } | Performs HTTP GET call |
57,186 | function post ( $ action , $ params = array ( ) , $ options = array ( ) ) { $ options [ "method" ] = "POST" ; return $ this -> _doRequest ( $ action , $ params , $ options ) ; } | Performs HTTP POST call |
57,187 | function put ( $ action , $ params = array ( ) , $ options = array ( ) ) { $ options [ "method" ] = "PUT" ; return $ this -> _doRequest ( $ action , $ params , $ options ) ; } | Performs HTTP PUT call |
57,188 | function delete ( $ action , $ params = array ( ) , $ options = array ( ) ) { $ options [ "method" ] = "DELETE" ; return $ this -> _doRequest ( $ action , $ params , $ options ) ; } | Performs HTTP DELETE call |
57,189 | function postFile ( $ action , $ file , $ params = array ( ) , $ options = array ( ) ) { if ( is_string ( $ file ) ) { $ file = array ( "path" => $ file ) ; } $ file += array ( "path" => "" , "postname" => null , "name" => null , "mime_type" => null , ) ; if ( ! $ file [ "name" ] ) { $ file [ "name" ] = preg_replace ( ... | Sends a single file into the specific action |
57,190 | function postRawData ( $ action , $ content , $ params = array ( ) , $ options = array ( ) ) { $ options += array ( "mime_type" => "application/data" ) ; $ options [ "method" ] = "POST" ; $ options [ "raw_post_data" ] = $ content ; return $ this -> _doRequest ( $ action , $ params , $ options ) ; } | Sends raw data to the specific action |
57,191 | function postJson ( $ action , $ json , $ options = array ( ) ) { if ( ! is_string ( $ json ) ) { $ json = json_encode ( $ json ) ; } $ options += array ( "mime_type" => "application/json" , "params" => array ( ) , ) ; $ params = $ options [ "params" ] ; unset ( $ options [ "params" ] ) ; return $ this -> postRawData (... | Sends JSON to the specific action |
57,192 | public function get ( $ key , $ configFile = '' ) { $ config = $ this -> load ( ( empty ( $ configFile ) ) ? $ this -> _configFile : $ configFile ) ; return $ this -> sift ( $ config , explode ( '.' , $ key ) ) ; } | Gets the config value . |
57,193 | private function load ( $ file , $ dir = '' ) { $ path = config_path ( ) . '/' . $ dir ; $ handle = opendir ( $ path ) ; $ ignore = [ '.' , '..' ] ; while ( $ f = readdir ( $ handle ) ) { if ( ! in_array ( $ f , $ ignore ) ) { if ( is_dir ( $ path . $ f ) ) { if ( file_exists ( $ path . $ f . '/' . $ file . '.php' ) ) ... | Loads a configuration script . |
57,194 | public function bindService ( $ controllerName , $ methodName , $ argumentName , $ serviceName ) { $ this -> bindings [ $ controllerName ] [ $ methodName ] [ $ argumentName ] = $ serviceName ; return $ this ; } | Bind Service to method argument |
57,195 | public function setArgumentValue ( $ controllerName , $ methodName , $ argumentName , $ value ) { $ this -> argumentBindings [ $ controllerName ] [ $ methodName ] [ $ argumentName ] = $ value ; return $ this ; } | Set value of method argument |
57,196 | protected function getMethodArguments ( $ controllerClass , $ methodName ) { $ actionArguments = array ( ) ; $ reflectionAction = new \ ReflectionMethod ( $ controllerClass , $ methodName ) ; $ actionParametersReflections = $ reflectionAction -> getParameters ( ) ; foreach ( $ actionParametersReflections as $ actionPar... | Get arguments of Controller s Action or constructor |
57,197 | public function process ( \ ReflectionProperty $ property , TestCase $ test ) { $ propertyDocComment = $ property -> getDocComment ( ) ; if ( preg_match ( self :: REGEX_MOCK , $ propertyDocComment , $ matches ) ) { $ isPrivate = $ property -> isPrivate ( ) ; if ( $ isPrivate ) { $ property -> setAccessible ( true ) ; }... | Property processing Generate and assign mock object to property if it has |
57,198 | private function getMediasPermissions ( ) { return [ [ 'name' => 'Medias - List all medias' , 'description' => 'Allow to list all the medias.' , 'slug' => MediasPolicy :: PERMISSION_LIST , ] , [ 'name' => 'Medias - View a media' , 'description' => 'Allow to display a media.' , 'slug' => MediasPolicy :: PERMISSION_SHOW ... | Get the Medias permissions . |
57,199 | public function exportMarkdown ( $ fragmentLevel = 0 ) { $ output = "" ; if ( $ this instanceof BlockElementInterface || $ this -> getPreviousSibling ( ) instanceof BlockElementInterface ) { $ output .= "\n\n" ; } $ output .= ltrim ( $ this -> generateMarkdown ( $ fragmentLevel ) , "\n" ) ; return $ output ; } | Convert the DOM to Markdown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.