idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
238,100 | 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 |
238,101 | 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 |
238,102 | 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 |
238,103 | 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 |
238,104 | 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 |
238,105 | 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 |
238,106 | 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 |
238,107 | 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 |
238,108 | 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 . |
238,109 | 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 . |
238,110 | 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 . |
238,111 | 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 . |
238,112 | 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 |
238,113 | 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 |
238,114 | 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 |
238,115 | function get ( $ action , $ params = array ( ) , $ options = array ( ) ) { $ options [ "method" ] = "GET" ; return $ this -> _doRequest ( $ action , $ params , $ options ) ; } | Performs HTTP GET call |
238,116 | function post ( $ action , $ params = array ( ) , $ options = array ( ) ) { $ options [ "method" ] = "POST" ; return $ this -> _doRequest ( $ action , $ params , $ options ) ; } | Performs HTTP POST call |
238,117 | function put ( $ action , $ params = array ( ) , $ options = array ( ) ) { $ options [ "method" ] = "PUT" ; return $ this -> _doRequest ( $ action , $ params , $ options ) ; } | Performs HTTP PUT call |
238,118 | function delete ( $ action , $ params = array ( ) , $ options = array ( ) ) { $ options [ "method" ] = "DELETE" ; return $ this -> _doRequest ( $ action , $ params , $ options ) ; } | Performs HTTP DELETE call |
238,119 | 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 |
238,120 | 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 |
238,121 | 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 |
238,122 | public function get ( $ key , $ configFile = '' ) { $ config = $ this -> load ( ( empty ( $ configFile ) ) ? $ this -> _configFile : $ configFile ) ; return $ this -> sift ( $ config , explode ( '.' , $ key ) ) ; } | Gets the config value . |
238,123 | 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 . |
238,124 | public function bindService ( $ controllerName , $ methodName , $ argumentName , $ serviceName ) { $ this -> bindings [ $ controllerName ] [ $ methodName ] [ $ argumentName ] = $ serviceName ; return $ this ; } | Bind Service to method argument |
238,125 | public function setArgumentValue ( $ controllerName , $ methodName , $ argumentName , $ value ) { $ this -> argumentBindings [ $ controllerName ] [ $ methodName ] [ $ argumentName ] = $ value ; return $ this ; } | Set value of method argument |
238,126 | 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 |
238,127 | 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 |
238,128 | 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 . |
238,129 | 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 |
238,130 | public function handleRequest ( $ request ) { list ( $ route , $ params ) = $ request -> resolve ( ) ; $ this -> requestedRoute = $ route ; $ result = $ this -> runAction ( $ route , $ params ) ; if ( $ result instanceof Response ) { return $ result ; } else { $ response = $ this -> getResponse ( ) ; $ response -> exit... | Handles the specified request . |
238,131 | public function getAllByNode ( PuppetDbModel \ NodeInterface $ node ) { $ environment = $ this -> environmentService -> getByNode ( $ node ) ; $ revision = $ environment -> getCurrentRevision ( ) ; $ groups [ $ environment -> getNormalizedName ( ) ] = $ revision -> getGroupsMatchingHostname ( $ node -> getName ( ) ) ; ... | Get all groups assigned to specified node group by environment name . |
238,132 | private function getResources ( ) { $ resources = [ ] ; foreach ( $ this -> getClassAnnotations ( ) as $ annotation ) { if ( 0 === strpos ( $ annotation , "resource" ) ) { $ resources [ ] = explode ( ' ' , $ annotation ) [ 1 ] ; } } return $ resources ; } | list of files to load as configuration . should be set to empty list if none needed |
238,133 | public function deleteImageByName ( $ filename ) { $ destinationPath = $ this -> getDestinationPath ( ) ; $ images = $ this -> getImages ( ) ; foreach ( $ images as $ key => $ image ) { if ( $ image -> file == $ filename ) { foreach ( $ image -> set as $ imageSetFilename ) { $ destination = $ destinationPath . '/' . $ ... | Delete image by name |
238,134 | public function generateNewId ( $ table ) { if ( ! isset ( $ this -> idCounterByTable [ $ table ] ) ) { $ this -> idCounterByTable [ $ table ] = $ this -> getSQLBuilder ( ) -> select ( $ table ) -> field ( 'id' ) -> orderDesc ( 'id' ) -> limit ( 0 , 1 ) -> fetchResult ( ) ; } for ( $ i = 0 ; $ i < 50 ; $ i ++ ) { $ thi... | Generate new id for insert |
238,135 | public function readAction ( ) { $ result = parent :: readAction ( ) ; if ( ! is_array ( $ result ) ) { return $ result ; } $ em = $ this -> getEntityManager ( ) ; $ status = $ this -> getFieldsConfig ( ) -> getConfigItem ( 'status' ) ; $ statuses = $ status [ 'dataSource' ] -> getData ( ) ; $ entity = $ em -> find ( $... | View user page |
238,136 | public function usePreviewTables ( $ bEnabled ) { if ( ! empty ( $ bEnabled ) ) { $ this -> isPreviewMode = true ; $ this -> table = NAILS_DB_PREFIX . 'blog_post_preview' ; $ this -> tableAlias = 'bp' ; $ this -> tableCat = NAILS_DB_PREFIX . 'blog_post_preview_category' ; $ this -> tableCatPrefix = 'bpc' ; $ this -> ta... | Sets the table names to use either the normal tables or the preview tables . |
238,137 | private function validateSlug ( $ sSlug , $ sTitle , $ iId = null ) { if ( $ this -> isPreviewMode ) { return 'slug' ; } if ( empty ( $ sSlug ) ) { $ sSlug = $ this -> generateSlug ( $ sTitle ) ; } else { $ oDb = Factory :: service ( 'Database' ) ; if ( ! empty ( $ iId ) ) { $ oDb -> where ( 'id !=' , $ iId ) ; } $ oDb... | Validates a slug if supplied generates one from the title if not |
238,138 | public function getById ( $ id , $ data = null ) { $ data = $ this -> includeEverything ( $ data ) ; return parent :: getById ( $ id , $ data ) ; } | Fetch a pst by it s ID |
238,139 | public function getBySlug ( $ id , $ data = null ) { $ data = $ this -> includeEverything ( $ data ) ; return parent :: getBySlug ( $ id , $ data ) ; } | Fetch a post by it s slug |
238,140 | protected function getCountCommon ( $ data = [ ] ) { $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> select ( [ $ this -> tableAlias . '.id' , $ this -> tableAlias . '.blog_id' , 'b.label blog_label' , $ this -> tableAlias . '.slug' , $ this -> tableAlias . '.title' , $ this -> tableAlias . '.image_id' , $ this ->... | Applies common conditionals |
238,141 | protected function includeEverything ( $ data ) { if ( is_null ( $ data ) ) { $ data = [ ] ; } if ( ! isset ( $ data [ 'include_body' ] ) ) { $ data [ 'include_body' ] = true ; } if ( ! isset ( $ data [ 'include_categories' ] ) ) { $ data [ 'include_categories' ] = true ; } if ( ! isset ( $ data [ 'include_tags' ] ) ) ... | Sets the data array to include everything |
238,142 | public function getWithCategory ( $ categoryIdSlug , $ page = null , $ perPage = null , $ data = null , $ includeDeleted = false ) { $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> join ( $ this -> tableCat . ' ' . $ this -> tableCatPrefix , $ this -> tableCatPrefix . '.post_id = ' . $ this -> tableAlias . '.id' )... | Gets posts which are in a particular category |
238,143 | public function countWithCategory ( $ categoryIdSlug , $ data = null , $ includeDeleted = false ) { $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> join ( $ this -> tableCat . ' ' . $ this -> tableCatPrefix , $ this -> tableCatPrefix . '.post_id = ' . $ this -> tableAlias . '.id' ) ; $ oDb -> join ( NAILS_DB_PREFI... | Count the number of posts in a particular category |
238,144 | public function getWithTag ( $ tagIdSlug , $ page = null , $ perPage = null , $ data = null , $ includeDeleted = false ) { $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> join ( $ this -> tableTag . ' ' . $ this -> tableTagPrefix , $ this -> tableTagPrefix . '.post_id = ' . $ this -> tableAlias . '.id' ) ; $ oDb -... | Gets posts which are in a particular tag |
238,145 | public function countWithTag ( $ tagIdSlug , $ data = null , $ includeDeleted = false ) { $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> join ( $ this -> tableTag . ' ' . $ this -> tableTagPrefix , $ this -> tableTagPrefix . '.post_id = ' . $ this -> tableAlias . '.id' ) ; $ oDb -> join ( NAILS_DB_PREFIX . 'blog_... | Count the number of posts in a particular tag |
238,146 | public function getWithAssociation ( $ associationIndex , $ associatedId ) { $ oConfig = Factory :: service ( 'Config' ) ; $ oConfig -> load ( 'blog/blog' ) ; $ associations = $ oConfig -> item ( 'blog_post_associations' ) ; if ( ! isset ( $ associations [ $ associationIndex ] ) ) { return [ ] ; } $ oDb = Factory :: se... | Get posts with a particular association |
238,147 | public function addHit ( $ id , $ data = [ ] ) { if ( ! $ id ) { $ this -> setError ( 'Post ID is required.' ) ; return false ; } $ oDate = Factory :: factory ( 'DateTime' ) ; $ hitData = [ ] ; $ hitData [ 'post_id' ] = $ id ; $ hitData [ 'user_id' ] = empty ( $ data [ 'user_id' ] ) ? null : $ data [ 'user_id' ] ; $ hi... | Add a hit to a post |
238,148 | public function getTypes ( ) { $ oDb = Factory :: service ( 'Database' ) ; $ oResult = $ oDb -> query ( 'SHOW COLUMNS FROM `' . $ this -> table . '` LIKE "type"' ) -> row ( ) ; $ sTypes = $ oResult -> Type ; $ sTypes = preg_replace ( '/enum\((.*)\)/' , '$1' , $ sTypes ) ; $ sTypes = str_replace ( "'" , '' , $ sTypes ) ... | Parses the type column and returns an array of potential post types |
238,149 | public function formatUrl ( $ slug , $ blogId ) { $ this -> load -> model ( 'blog/blog_model' ) ; return $ this -> blog_model -> getBlogUrl ( $ blogId ) . '/' . $ slug ; } | Format a posts s URL |
238,150 | public function extractYoutubeId ( $ sUrl ) { preg_match ( '/^https?\:\/\/www\.youtube\.com\/watch\?v=([a-zA-Z0-9_\-]+)$/' , $ sUrl , $ aMatches ) ; if ( ! empty ( $ aMatches [ 1 ] ) ) { return $ aMatches [ 1 ] ; } else { preg_match ( '/^https?\:\/\/youtu\.be\/([a-zA-Z0-9_\-]+)$/' , $ sUrl , $ aMatches ) ; if ( ! empty... | Extracts the ID from a YouTube URL |
238,151 | public function queue ( ) { $ from = $ this -> fromEmail ; $ to = $ this -> toEmail ; $ name = $ this -> toName ; $ subject = $ this -> subject ; $ this -> beauty -> queue ( $ this -> view , $ this -> datas , function ( $ message ) use ( $ from , $ to , $ name , $ subject ) { $ message -> from ( $ from ) -> to ( $ to ,... | send queue mail |
238,152 | public function handlerOptions ( ) { $ this -> fromEmail = config ( 'mail.from.address' ) ; $ this -> toEmail = config ( 'laravel-modules-base.developer_mail' ) ; $ this -> toName = config ( 'laravel-modules-base.developer_name' ) ; $ this -> subject = trans ( 'laravel-modules-base::admin.email.error.subject' ) ; $ thi... | exception handler set options |
238,153 | public function move ( FilesystemFolder $ destination ) { if ( $ this -> alreadyUploaded ) { return parent :: move ( $ destination ) ; } $ oldpath = $ this -> folder -> getPath ( ) . $ this -> filename ; $ filename = self :: sanitizeFilename ( $ this -> originalName , $ destination ) ; $ newpath = $ destination -> getP... | performs an initial move of an uploaded file from its temporary folder to a destination folder and renames it to the original filename once completed a flag is set and subsequent moves are redirected to the parent method |
238,154 | protected function getFieldNameForDisplay ( $ details ) { $ tableUniqueId = $ details [ 'TABLE_SCHEMA' ] . '.' . $ details [ 'TABLE_NAME' ] ; if ( $ details [ 'COLUMN_COMMENT' ] != '' ) { return $ details [ 'COLUMN_COMMENT' ] ; } elseif ( isset ( $ this -> advCache [ 'tableStructureLocales' ] [ $ tableUniqueId ] [ $ de... | Returns the name of a field for displaying |
238,155 | protected function getFieldOutputTextFK ( $ foreignKeysArray , $ value , $ iar ) { $ query = $ this -> sQueryGenericSelectKeyValue ( [ '`' . $ value [ 'COLUMN_NAME' ] . '`' , $ foreignKeysArray [ $ value [ 'COLUMN_NAME' ] ] [ 2 ] , $ foreignKeysArray [ $ value [ 'COLUMN_NAME' ] ] [ 0 ] ] ) ; $ inAdtnl = [ 'size' => 1 ]... | Prepares the output of text fields defined w . FKs |
238,156 | protected function getRowDataFromTable ( $ tableName , $ filtersArray ) { $ query = $ this -> sQueryRowsFromTable ( [ $ tableName , $ this -> setArrayToFilterValues ( $ filtersArray ) ] ) ; $ rawData = $ this -> setMySQLquery2Server ( $ query , 'array_pairs_key_value' ) [ 'result' ] ; if ( ! is_null ( $ rawData ) ) { $... | Reads data from table into REQUEST super global |
238,157 | private function setArrayToFilterValues ( $ entryArray , $ referenceTable = '' ) { $ filters = [ ] ; $ refTable = $ this -> correctTableWithQuotesAsFieldPrefix ( $ referenceTable ) ; foreach ( $ entryArray as $ key => $ value ) { if ( is_array ( $ value ) ) { $ filters [ ] = $ this -> setArrayLineArrayToFilter ( $ key ... | Transforms an array into usable filters |
238,158 | public static function asciify ( string $ input , string $ language = 'en' , bool $ removeUnsupported = true ) : string { $ output = S :: toAscii ( $ input , $ language , $ removeUnsupported ) ; return $ output ; } | Returns an ASCII version of the input . |
238,159 | public static function camelize ( string $ input , string $ separator = '_' , bool $ capitalizeFirstCharacter = false ) : string { $ output = $ input ; if ( ctype_upper ( $ output ) ) { $ output = mb_strtolower ( $ output ) ; } if ( strpos ( $ output , $ separator ) || strpos ( $ output , ' ' ) ) { $ output = mb_strtol... | Camelizes an input . |
238,160 | public function secureHtml ( $ data ) : ? string { return ( Any :: isArray ( $ data ) ? $ this -> purifier -> purifyArray ( $ data ) : $ this -> purifier -> purify ( $ data ) ) ; } | Secure html code |
238,161 | public function strip_tags ( $ html , $ escapeQuotes = true ) { if ( Any :: isArray ( $ html ) ) { foreach ( $ html as $ key => $ value ) { $ html [ $ key ] = $ this -> strip_tags ( $ value , $ escapeQuotes ) ; } return $ html ; } $ text = strip_tags ( $ html ) ; if ( $ escapeQuotes ) { $ text = $ this -> escapeQuotes ... | String html tags and escape quotes |
238,162 | public function strip_php_tags ( $ data ) { if ( is_array ( $ data ) ) { foreach ( $ data as $ key => $ value ) { $ data [ $ key ] = $ this -> strip_php_tags ( $ value ) ; } return $ data ; } return addslashes ( htmlspecialchars ( strip_tags ( $ data ) ) ) ; } | Strip php tags and notations in string . |
238,163 | public function setFamily ( \ Librinfo \ VarietiesBundle \ Entity \ Family $ family = null ) { $ this -> family = $ family ; return $ this ; } | Set family . |
238,164 | public function addSpeciese ( \ Librinfo \ VarietiesBundle \ Entity \ Species $ species ) { $ species -> setGenus ( $ this ) ; $ this -> specieses -> add ( $ species ) ; return $ this ; } | Alias for addSpecies . |
238,165 | public function removeSpecies ( \ Librinfo \ VarietiesBundle \ Entity \ Species $ species ) { return $ this -> specieses -> removeElement ( $ species ) ; } | Remove speciese . |
238,166 | protected function resolveClassMethodDependencies ( array $ parameters , $ instance , $ method ) { if ( ! method_exists ( $ instance , $ method ) ) return $ parameters ; return $ this -> resolveMethodDependencies ( $ parameters , new ReflectionMethod ( $ instance , $ method ) ) ; } | Resolve the object method s type - hinted dependencies . |
238,167 | public function setURL ( URL $ url ) { $ this -> domain = $ url -> host ; $ this -> path = $ url -> path ; $ this -> secure = $ url -> secure ; return $ this ; } | Set the domain and path using a URL |
238,168 | public function setExpiresIn ( DateInterval $ interval ) { $ this -> expires = new DateTime ( ) ; $ this -> expires -> add ( $ interval ) ; return $ this ; } | Set expiry date by a DateInterval relative to the current time |
238,169 | protected function getClassExtends ( ) { $ parentPlaceholderClass = sprintf ( "\\%s\\%s" , $ this -> options [ 'entityPlaceholder' ] , $ this -> pgClass -> getParent ( ) -> getEntityName ( ) ) ; $ this -> class -> addExtends ( $ parentPlaceholderClass ) ; } | Get class extends |
238,170 | public static function encode ( $ array ) { $ array = static :: asArray ( $ array ) ; if ( is_array ( $ array ) && count ( $ array ) < 1 ) { return "" ; } try { $ string = serialize ( $ array ) ; } catch ( \ Exception $ e ) { throw new PhpException ( "Serialize Error: " . $ e -> getMessage ( ) ) ; } return $ string ; } | Convert an array to a php serialized string . |
238,171 | public static function decode ( $ string ) { if ( ! $ string ) { return new ArrayObject ( ) ; } try { $ array = unserialize ( $ string ) ; } catch ( \ Exception $ e ) { throw new PhpException ( "Serialize Error: " . $ e -> getMessage ( ) ) ; } if ( ! is_array ( $ array ) ) { $ array = [ ] ; } return ArrayObject :: make... | Convert a php serialized string to an array . |
238,172 | static function ModuleUrl ( BackendModule $ module , array $ args = array ( ) ) { $ allArgs = array ( 'module' => ClassFinder :: ModuleType ( $ module ) ) + $ args ; return 'index.php?' . http_build_query ( $ allArgs ) ; } | Gets the url for a module |
238,173 | static function AjaxUrl ( ModuleBase $ module , array $ args = array ( ) ) { $ allArgs = array ( 'module' => ClassFinder :: ModuleType ( $ module ) ) + $ args ; $ guard = new UserGuard ( ) ; $ user = $ guard -> GetUser ( ) ; if ( ! $ user ) { throw new \ Exception ( 'Security breach on ajax url: no backend user logged ... | Returns the url to ab ajax module whose content is rendered as is |
238,174 | static function ContentTreeUrl ( Content $ content ) { $ args = array ( ) ; $ pageContent = $ content -> GetPageContent ( ) ; if ( $ pageContent ) { $ args [ 'page' ] = $ pageContent -> GetPage ( ) -> GetID ( ) ; $ args [ 'area' ] = $ pageContent -> GetArea ( ) -> GetID ( ) ; return self :: ModuleUrl ( new \ Phine \ Bu... | Gets the url of the content tree for a content element |
238,175 | public function setRelation ( $ relation , $ value ) { $ this -> checkInitRelations ( ) ; $ this -> relations [ $ relation ] = $ value ; return $ this ; } | Set the specific relationship in the model . |
238,176 | protected function doExecute ( \ Closure $ cb ) { try { return $ cb ( $ this -> manager ) ; } catch ( \ Exception $ e ) { throw Exception \ Translator \ Doctrine :: translate ( $ e ) ; } } | Executes something in the context of the entityManager . |
238,177 | protected function doExecuteInRepository ( \ Closure $ cb ) { try { return $ cb ( $ this -> repository ) ; } catch ( \ Exception $ e ) { throw Exception \ Translator \ Doctrine :: translate ( $ e ) ; } } | Executes something in the context of the entityRepository . |
238,178 | public function saveAs ( $ name ) { $ this -> section_data [ $ name ] = ob_get_clean ( ) ; $ this -> ob_level -- ; if ( $ this -> ob_level ) { echo $ this -> section_data [ $ name ] ; } } | end capture with name . |
238,179 | public function warm ( ) { $ warmed = [ ] ; if ( false === $ this -> mf -> hasCache ( ) ) { return $ warmed ; } $ this -> clear ( ) ; foreach ( $ this -> mf -> getAllTypeNames ( ) as $ type ) { $ metadata = $ this -> mf -> getMetadataForType ( $ type ) ; $ warmed [ ] = $ type ; } return $ warmed ; } | Warms up all metadata objects into the cache . |
238,180 | public function clear ( ) { $ cleared = [ ] ; if ( false === $ this -> mf -> hasCache ( ) ) { return $ cleared ; } $ this -> mf -> enableCache ( false ) ; foreach ( $ this -> mf -> getAllTypeNames ( ) as $ type ) { $ metadata = $ this -> mf -> getMetadataForType ( $ type ) ; $ this -> mf -> getCache ( ) -> evictMetadat... | Clears all metadata objects from the cache . |
238,181 | public function setName ( $ name = false ) { if ( $ name === false || empty ( $ name ) ) { $ this -> name = \ Nuki \ Handlers \ Core \ Assist :: randomString ( ) ; return ; } $ this -> name = $ name ; } | Set file name if name not give it will be generated |
238,182 | protected function init ( ) { $ this -> prependOptions ( [ 'path' => './cache' , 'formatAliases' => [ ] , 'format' => 'json' ] ) ; $ this -> _path = $ this -> getOption ( 'path' ) ; $ this -> _formatFactory = new Factory ( __NAMESPACE__ . '\\File\\FormatBase' , [ 'json' => __NAMESPACE__ . '\\File\\Format\\Json' , 'seri... | Initializes the file cache adapter |
238,183 | public function exists ( $ key ) { $ path = $ this -> getKeyPath ( $ key ) ; if ( ! file_exists ( $ path ) || empty ( $ this -> _lifeTimes [ $ key ] ) ) return false ; if ( time ( ) - filemtime ( $ path ) > $ this -> _lifeTimes [ $ key ] ) return false ; return true ; } | Checks if the given cache key has an existing cache file that didn t exceed the given life - time |
238,184 | public function set ( $ key , $ value , $ lifeTime ) { $ path = $ this -> getKeyPath ( $ key ) ; $ dir = dirname ( $ path ) ; if ( ! is_dir ( $ dir ) ) mkdir ( $ dir , 0777 , true ) ; $ this -> _lifeTimes [ $ key ] = intval ( $ lifeTime ) ; $ this -> _format -> save ( $ this -> _lifeTimePath , $ this -> _lifeTimes ) ; ... | Sets the value of an cache item to the given value |
238,185 | public function renderBlock ( OutputBuffer $ out , $ name ) { if ( array_key_exists ( $ name , $ this -> blocks ) ) { $ pblock = $ this -> outerContext -> set ( '@block' , $ name ) ; $ pout = $ this -> outerContext -> set ( '@out' , $ out ) ; $ pthis = $ this -> outerContext -> set ( '@this' , $ this ) ; try { $ this -... | Render contents of block taking blocks from the decorator into consideration . |
238,186 | public function renderParentBlock ( OutputBuffer $ out , $ name ) { $ method = 'block_' . $ name ; if ( method_exists ( $ this , $ method ) ) { return $ this -> $ method ( $ out ) ; } return parent :: renderParentBlock ( $ out , $ name ) ; } | Render contents of a block in the parent view taking block from the decorator into consideration . |
238,187 | private function load ( $ env = 'local' , $ file = 'config' ) { $ path = BASE_PATH . ( $ file === '.env' ? '' : '/config' ) ; $ configPath = "{$path}/{$file}.yml" ; $ envConfigPath = "{$path}/{$file}_{$env}.yml" ; if ( ! file_exists ( $ configPath ) ) { throw new \ Exception ( "Config file not found at \"{$configPath}\... | Loads and parses the config file |
238,188 | public function build ( array $ config ) { $ contentCss = [ '/css/admin-helper.css' , '/bundles/ekynacore/css/tinymce-content.css' , 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' , ] ; if ( 0 < strlen ( $ config [ 'ui' ] [ 'google_font_url' ] ) ... | Builds the tinymce configuration . |
238,189 | protected function changeCurrentId ( $ newId ) { if ( ! preg_match ( '/^[-,a-zA-Z0-9]{1,128}$/' , $ newId ) ) { throw new InvalidArgumentException ( 'Invalid Session ID String' ) ; } if ( session_id ( $ newId ) === false ) { throw new SessionRuntimeException ( 'session_id Failed' ) ; } return true ; } | Set session id |
238,190 | public static function getInstance ( ) { if ( ! isset ( self :: $ instance ) ) { self :: $ instance = new self ; } self :: $ instance -> startSession ( ) ; return self :: $ instance ; } | Returns THE instance of Session . The session is automatically initialized if it wasn t . |
238,191 | public function destroy ( ) { if ( $ this -> sessionState == self :: SESSION_STARTED ) { $ _SESSION = array ( ) ; $ this -> sessionState = ! session_destroy ( ) ; unset ( $ _SESSION ) ; return ! $ this -> sessionState ; } return FALSE ; } | Destroys the current session . |
238,192 | public static function generateByPropertyClosure ( $ property , $ direction = SORT_ASC ) { if ( $ direction === SORT_DESC ) { $ aLTb = 1 ; $ aGTb = - 1 ; } else { $ aLTb = - 1 ; $ aGTb = 1 ; } return function ( \ Bond \ Entity \ Base $ a , \ Bond \ Entity \ Base $ b ) use ( $ property , $ aLTb , $ aGTb ) { $ propertyA ... | Generate a sort by property callback |
238,193 | function Save ( ) { $ this -> contentRights -> Save ( ) ; if ( ! $ this -> rights ) { $ this -> rights = new BackendPageRights ( ) ; } $ this -> rights -> SetCreateIn ( $ this -> Value ( 'CreateIn' ) ) ; $ this -> rights -> SetEdit ( $ this -> Value ( 'Edit' ) ) ; $ this -> rights -> SetMove ( $ this -> Value ( 'Move' ... | Saves the page rights |
238,194 | protected function getErrorsFromForm ( FormInterface $ form ) { $ errors = [ ] ; if ( $ form -> getErrors ( ) -> count ( ) === 0 && $ form -> isRoot ( ) && ! $ form -> isValid ( ) ) { $ errors [ "_self" ] = "Empty post data" ; } foreach ( $ form -> getErrors ( ) as $ error ) { $ key = $ error -> getOrigin ( ) -> getNam... | Build inheritance form errors |
238,195 | public function loadConfiguration ( ConfigurationLoader $ loader , array $ params = [ ] ) { try { $ data = $ loader -> findLoader ( $ this -> source ) -> load ( $ this -> source , $ params ) ; return new Configuration ( $ this -> createBase ( $ data ) ) ; } catch ( \ Exception $ e ) { throw new ConfigurationLoadingExce... | Load configuration data from the source . |
238,196 | public function getPermalink ( ItemInterface $ item ) { if ( $ item -> getPath ( ItemInterface :: SNAPSHOT_PATH_RELATIVE_AFTER_CONVERT ) === '' ) { return new Permalink ( '' , '' ) ; } $ placeholders = $ this -> getPlacehoders ( $ item ) ; $ permalinkStyle = $ this -> getPermalinkAttribute ( $ item ) ; $ noHtmlExtensio... | Gets a permalink . This method uses the SNAPSHOT_PATH_RELATIVE_AFTER_CONVERT of Item path . |
238,197 | public function reportCount ( $ count ) { $ statName = $ this -> prefix . $ this -> statNames ; if ( $ this -> isProduction ) { stathat_ez_count ( $ this -> ezkey , $ statName , $ count ) ; } } | Reports a count to the StatHat API . |
238,198 | public function reportValue ( $ value ) { $ statName = $ this -> prefix . $ this -> statNames ; if ( $ this -> isProduction ) { stathat_ez_value ( $ this -> ezkey , $ statName , $ value ) ; } } | Reports a value to the StatHat API . |
238,199 | public static function subscribe ( string $ hook , callable $ callback , int $ precedence = 0 ) { $ parts = explode ( "." , $ hook ) ; if ( count ( $ parts ) < 2 ) throw new InvalidArgumentException ( "Hook name must consist of at least two parts" ) ; if ( $ hook === Hook :: SHUTDOWN_HOOK ) self :: registerShutdownHook... | Subscribe to a hook . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.