idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
13,500 | final protected static function validateOrder ( string $ order = "DESC" ) : string { $ order = strtoupper ( $ order ) ; return ( ! in_array ( $ order , [ "DESC" , "ASC" ] ) ) ? "DESC" : $ order ; } | Validates the order for sqlQuery |
13,501 | final protected static function generateKeyValue ( array $ associativeArray , string $ expressionOperator = "AND" ) : array { $ generatedArray = [ ] ; $ dbObject = Database :: getInstance ( ) ; foreach ( $ associativeArray as $ column => $ operatorValues ) : $ column = $ dbObject -> escapeValue ( $ column ) ; $ generat... | Generates keys and thier values for sqlQuery |
13,502 | final protected static function generateValue ( string $ column , array $ operatorValues , string $ expressionOperator = "AND" ) : string { $ dbObject = Database :: getInstance ( ) ; $ column = $ dbObject -> escapeValue ( $ column ) ; $ operator = static :: validateOperator ( array_shift ( $ operatorValues ) ) ; $ valu... | Generate values for sqlQuery based on the operator |
13,503 | final protected static function validateOperator ( string $ operator , string $ defaultOperator = "=" ) : string { return static :: isOperatorValid ( $ operator ) ? $ operator : ( $ defaultOperator ? : '=' ) ; } | Validates operator . |
13,504 | final protected static function isOperatorValid ( string $ operator ) : bool { $ operators1 = [ '+' , '-' , '*' , '/' , '%' ] ; $ operators2 = [ '&' , '|' , '^' ] ; $ operators3 = [ '=' , '<' , '>' , '>=' , '<=' , '<>' ] ; $ operators4 = [ '+=' , '-=' , '*=' , '/=' , '%=' , '&=' , '^-=' , '|*=' ] ; $ operators5 = [ 'AL... | Checks if operator is valid . |
13,505 | public function encrypt ( string $ request , string $ publicKey , int $ version = 2 , string $ nonce = null ) : string { $ this -> nonce = $ nonce ?? \ random_bytes ( SODIUM_CRYPTO_BOX_NONCEBYTES ) ; if ( \ strlen ( $ publicKey ) !== SODIUM_CRYPTO_BOX_PUBLICKEYBYTES ) { throw new InvalidArgumentException ( sprintf ( "R... | Encrypts a request body |
13,506 | private function encryptBody ( string $ request , string $ publicKey , string $ nonce ) : string { if ( \ strlen ( $ publicKey ) !== SODIUM_CRYPTO_BOX_PUBLICKEYBYTES ) { throw new InvalidArgumentException ( sprintf ( "Public key should be %d bytes." , SODIUM_CRYPTO_BOX_PUBLICKEYBYTES ) ) ; } if ( \ strlen ( $ nonce ) !... | Encrypts a request |
13,507 | public function sign ( string $ request ) : string { try { return \ sodium_crypto_sign_detached ( $ request , $ this -> signatureSecretKey ) ; } catch ( SodiumException $ e ) { throw new InvalidArgumentException ( $ e -> getMessage ( ) ) ; } } | Creates a detached signature for the keypair |
13,508 | public function get ( ) { $ result = null ; switch ( $ this -> format ) { case 'nvp' : $ result = http_build_query ( $ this -> data ) ; break ; case 'json' : default : $ result = json_encode ( $ this -> data , JSON_PRETTY_PRINT ) ; break ; } return $ result ; } | Get API response . |
13,509 | public function set ( $ data ) { $ this -> error = [ ] ; $ result = null ; switch ( $ this -> format ) { case 'nvp' : parse_str ( $ data , $ this -> data ) ; $ result = ! empty ( $ this -> data ) ; break ; case 'json' : default : $ this -> data = empty ( $ data ) ? [ ] : ( json_decode ( $ data , true ) ? : [ ] ) ; $ re... | Set API response - decode from JSON . |
13,510 | private function setMeta ( $ where , $ data ) { return $ this -> setInData ( self :: KEY_META , $ this -> methodToKey ( $ where ) , $ data ) ; } | Set some type of meta data into response . |
13,511 | private function getFromData ( $ type , $ key ) { return $ this -> hasData ( $ type , $ key ) ? $ this -> data [ $ type ] [ $ key ] : null ; } | Get specific type of data from specific key from response . |
13,512 | private function hasData ( $ type , $ key ) { return isset ( $ this -> data [ $ type ] ) && isset ( $ this -> data [ $ type ] [ $ key ] ) ; } | Check existence of specific type of data from specific key from response . |
13,513 | public function verify ( ) { if ( is_null ( $ this -> verified ) ) { try { $ this -> verified = ( bool ) $ this -> verifyEnvironment ( ) ; if ( ! $ this -> verified ) { throw new Exception \ EnvironmentException ( "The adapter did not properly verify." ) ; } } catch ( \ Exception $ e ) { $ this -> verificationError = $... | Called by the Transcoder to make the Adapter verify it s current status in the environment . |
13,514 | private function message ( $ msg , $ level ) { if ( $ this -> transcoder ) { $ this -> transcoder -> dispatch ( TranscodeEvents :: MESSAGE , new MessageEvent ( $ msg , $ level , $ this ) ) ; } } | Used internally by the Adapter to dispatch sent messages via the Transcoder |
13,515 | public function callFromScopeOn ( $ context , array $ arguments = [ ] ) { $ scopeWrapper = function ( $ context , $ methodName , array $ arguments ) { return call_user_func_array ( [ $ context , $ methodName ] , $ arguments ) ; } ; if ( is_object ( $ context ) ) { $ scopeWrapper = $ scopeWrapper -> bindTo ( $ context ,... | Call the method represented by the the current instance in the specified context from the scope of that context |
13,516 | public function forwardStaticCallTo ( $ context , array $ arguments = [ ] ) { $ methodName = $ this -> name ( ) ; return forward_static_call_array ( [ $ context , $ methodName ] , $ arguments ) ; } | Forward the call to the static method represented by the current instance in the specified context for late static binding |
13,517 | public function throwException ( $ message = null ) { if ( $ message === null ) { $ message = 'The method [' . $ this -> name ( ) . '] does not exist.' ; } throw new BadMethodCallException ( $ message ) ; } | Throw a BadMethodCallException . The default exception message assumes that the exception is thrown because the method doesn t exist |
13,518 | public function throwExceptionIfMissingOn ( $ context , $ message = null ) { if ( $ message === null ) { $ message = 'The method [' . $ this -> name ( ) . '] does not exist on [' . static :: getClassName ( $ context ) . '].' ; } if ( ! $ this -> existsOn ( $ context ) ) { $ this -> throwException ( $ message ) ; } retu... | Throw a BadMethodCallException if the method represented by this instance does not exist |
13,519 | public function Start ( ) { foreach ( $ this -> symbols -> headers as $ header_name => $ header_object ) { if ( ! $ header_object -> enabled ) { $ this -> RemoveHeader ( $ header_name ) ; continue ; } $ header_content = $ this -> GenerateHeader ( $ header_name ) ; $ this -> AddHeader ( $ header_name , $ header_content ... | Generate all the files that are needed to build a zend php extension . |
13,520 | public function GenerateHeader ( $ header_name ) { $ authors = \ Peg \ Lib \ Settings :: GetAuthors ( ) ; $ contributors = \ Peg \ Lib \ Settings :: GetContributors ( ) ; $ extension = \ Peg \ Lib \ Settings :: GetExtensionName ( ) ; $ version = \ Peg \ Lib \ Settings :: GetVersion ( ) ; $ header_object = $ this -> sym... | Generates a specific header file . |
13,521 | public function GenerateClassesHeader ( $ header_name ) { $ authors = \ Peg \ Lib \ Settings :: GetAuthors ( ) ; $ contributors = \ Peg \ Lib \ Settings :: GetContributors ( ) ; $ extension = \ Peg \ Lib \ Settings :: GetExtensionName ( ) ; $ version = \ Peg \ Lib \ Settings :: GetVersion ( ) ; $ header_object = $ this... | Generates a specific header file for classes . |
13,522 | public function GenerateArgInfo ( \ Peg \ Lib \ Definitions \ Element \ FunctionElement $ function_object ) { $ namespace_name = $ function_object -> namespace -> name ; if ( $ namespace_name == "\\" ) $ namespace_name = "" ; $ namespace_name_cpp = str_replace ( "\\" , "::" , $ namespace_name ) ; $ namespace_name_var =... | Generates an arginfo php C structure which is basically used for reflection to work properly . |
13,523 | public function GenerateConfigs ( ) { $ authors = \ Peg \ Lib \ Settings :: GetAuthors ( ) ; $ contributors = \ Peg \ Lib \ Settings :: GetContributors ( ) ; $ extension = \ Peg \ Lib \ Settings :: GetExtensionName ( ) ; $ version = \ Peg \ Lib \ Settings :: GetVersion ( ) ; $ content = "" ; $ source_files = array ( "s... | Generates config . m4 and config . w32 . |
13,524 | public function GenerateCustomSources ( ) { $ authors = \ Peg \ Lib \ Settings :: GetAuthors ( ) ; $ contributors = \ Peg \ Lib \ Settings :: GetContributors ( ) ; $ extension = \ Peg \ Lib \ Settings :: GetExtensionName ( ) ; $ version = \ Peg \ Lib \ Settings :: GetVersion ( ) ; $ content = "" ; $ custom_sources = $ ... | Generates sources from the custom_sources templates directory . |
13,525 | public function GetProtoHeader ( \ Peg \ Lib \ Definitions \ Element \ FunctionElement $ function ) { $ proto = "/* {{{ " ; foreach ( $ function -> overloads as $ overload ) { $ proto .= "proto " ; $ proto .= $ this -> symbols -> GetPHPStandardType ( $ overload -> return_type ) ; $ proto .= " " . $ overload -> function... | Generates proto doc comments header for a function . |
13,526 | public function GetRegisterConstantTemplate ( $ name , $ namespace = "" , $ type = "" ) { if ( $ namespace ) { $ namespace = str_replace ( array ( "\\" , "::" ) , "_" , $ namespace ) . "_" ; } $ override = $ this -> templates_path . "constants/overrides/" . "define_{$name}" . ".php" ; if ( file_exists ( $ override ) ) ... | Retrieve the template path for registering constants also checks if a valid override exists and returns that instead . |
13,527 | public function GetRegisterVarConstantTemplate ( \ Peg \ Lib \ Definitions \ Element \ GlobalVariable $ variable , $ namespace = "" ) { if ( $ namespace ) { $ namespace = str_replace ( array ( "\\" , "::" ) , "_" , $ namespace ) . "_" ; } $ ptr = "" ; if ( $ variable -> is_pointer ) { for ( $ i = 0 ; $ i < $ variable -... | Retrieve the template path for registering constants registered as global variables also checks if a valid override exists and returns that instead . |
13,528 | public function set ( $ key , $ value ) { DotArray :: set ( $ this -> getStorage ( ) , $ key , $ value ) ; return $ this ; } | Set a session by the given key . |
13,529 | public function get ( $ key , $ default = null ) { $ data = DotArray :: get ( $ this -> getStorage ( ) , $ key ) ; return $ data === null ? $ default : $ data ; } | Get the session by the given key . Default on null |
13,530 | public function append ( $ name , $ value ) { if ( is_array ( $ this -> _data [ $ name ] ) ) { $ this -> _data [ $ name ] [ ] = $ value ; } else { $ this -> _data [ $ name ] .= $ value ; } return $ this ; } | Appends or concats a value to a template global data if type is array or string respectively |
13,531 | protected function _find_view ( $ view ) { $ view = str_replace ( '.' , '/' , $ view ) ; $ full_path = APPPATH . 'views/' . $ view . $ this -> blade_ext ; if ( method_exists ( $ this -> router , 'fetch_module' ) ) { $ module = $ this -> router -> fetch_module ( ) ; list ( $ path , $ _view ) = Modules :: find ( $ view .... | Find the full path to a view file . Shows an error if file not found . |
13,532 | protected function _compile ( $ template ) { $ view_path = $ this -> _find_view ( $ template ) ; $ cache_id = 'blade-' . md5 ( $ view_path ) ; if ( $ compiled = $ this -> cache -> file -> get ( $ cache_id ) ) { if ( ENVIRONMENT == 'production' ) { return $ compiled ; } $ meta = $ this -> cache -> file -> get_metadata (... | Compiles a template and stores it in the cache . |
13,533 | protected function _run ( $ template , $ data = NULL ) { if ( is_array ( $ data ) ) { extract ( $ data ) ; } ob_start ( ) ; eval ( ' ?>' . $ template . '<?php ' ) ; $ content = ob_get_clean ( ) ; return $ content ; } | Runs a compiled template with its variables |
13,534 | protected function _include ( $ template , $ data = NULL ) { $ data = isset ( $ data ) ? array_merge ( $ this -> _data , $ data ) : $ this -> _data ; $ compiled = $ this -> _compile ( $ template ) ; return $ this -> _run ( $ compiled , $ data ) ; } | Get a template content for use inside the current template . Inherits all global data combined with local data passed as second argument . |
13,535 | protected function _section_end ( ) { $ last = array_pop ( $ this -> _last_section ) ; $ this -> _section_extend ( $ last , ob_get_clean ( ) ) ; return $ last ; } | Stops buffering section content . Returns the current section name . |
13,536 | public function init ( ) { $ services = $ this -> getServices ( ) ; foreach ( $ services as $ alias => $ service ) { $ this -> add ( $ service , $ alias ) ; } $ this -> initConfigs ( ) ; $ this -> registerComponents ( ) ; } | Initialize all components . |
13,537 | public function add ( $ service , $ alias = '' , $ args = [ ] ) { if ( ! empty ( $ args ) ) { if ( empty ( $ alias ) ) { $ this -> container -> add ( $ service ) -> withArgument ( $ args ) ; } else { $ this -> container -> add ( $ alias , $ service ) -> withArgument ( $ args ) ; } } else { if ( empty ( $ alias ) ) { $ ... | Register a service . |
13,538 | public function get ( $ service ) { return $ this -> has ( $ service ) ? $ this -> container -> get ( $ service ) : null ; } | Get the asked service . |
13,539 | public function getComponents ( ) { $ components = [ 'Base' => 'GetOlympus\Zeus\Base\Controller\Base' , 'BaseWidget' => 'GetOlympus\Zeus\Base\Controller\BaseWidget' , 'Helpers' => 'GetOlympus\Zeus\Helpers\Controller\Helpers' , 'AdminPage' => 'GetOlympus\Zeus\AdminPage\Controller\AdminPage' , 'Ajax' => 'GetOlympus\Zeus\... | Get default components . |
13,540 | public function initConfigs ( ) { if ( empty ( $ this -> configurations ) ) { return ; } $ available = $ this -> getConfigurations ( ) ; foreach ( $ this -> configurations as $ component => $ file ) { if ( ! array_key_exists ( $ component , $ available ) ) { continue ; } $ service = $ this -> get ( $ component ) ; if (... | Initialize configs files containing theme definitions . |
13,541 | public function setParamsPattern ( $ pattern ) { $ this -> paramsPattern = ( string ) $ pattern ; $ this -> paramExpression = null ; return $ this ; } | Set the parameters definition pattern |
13,542 | protected function choosePlural ( $ number , $ rule , $ locale ) { $ variants = explode ( $ this -> pluralRuleDelimiter , $ rule ) ; $ variants = array_map ( 'trim' , $ variants ) ; return $ this -> getPluralChooser ( ) -> choose ( $ number , $ variants , $ locale ) ; } | Choose the plural |
13,543 | protected function getParamExpression ( ) { if ( $ this -> paramExpression === null ) { $ expr = sprintf ( preg_quote ( $ this -> paramsPattern , '~' ) , '(.*?)' ) ; $ this -> paramExpression = '~' . $ expr . '~' ; } return $ this -> paramExpression ; } | Get search expression |
13,544 | public function setBBCodeCallback ( $ code , Closure $ callback ) { if ( is_array ( $ code ) ) { foreach ( $ code as $ part ) { $ this -> actions [ $ part ] = $ callback ; } return $ this ; } $ this -> actions [ $ code ] = $ callback ; return $ this ; } | Set the callback action for the code |
13,545 | public function import ( array $ data ) { $ this -> validate ( $ data , $ this -> getStructureDefinition ( ) ) ; $ this -> data = $ data ; } | Import data from an array . |
13,546 | protected function getValue ( $ name , $ default = null ) { if ( array_key_exists ( $ name , $ this -> data ) ) { return $ this -> data [ $ name ] ; } return $ default ; } | Return structure member . |
13,547 | private function init ( ) { $ this -> module = mcrypt_module_open ( $ this -> algorithm , '' , MCRYPT_MODE_ECB , '' ) ; $ iv = mcrypt_create_iv ( mcrypt_enc_get_iv_size ( $ this -> module ) , MCRYPT_RAND ) ; $ ks = mcrypt_enc_get_key_size ( $ this -> module ) ; $ key = substr ( md5 ( $ this -> secretKey ) , 0 , $ ks ) ... | init encryption module |
13,548 | public function setTheme ( ? string $ key = null , bool $ overrideKey = false ) : Theme { if ( $ this -> useTheme !== null && ( $ key === null || $ this -> useTheme === $ key ) ) { return $ this -> useTheme ; } if ( $ overrideKey ) { return $ this -> useTheme = $ this -> getTheme ( $ key ) ; } if ( $ this -> themes -> ... | Set theme to use |
13,549 | public function themeIsDefault ( $ key = null ) : bool { if ( $ key instanceof Theme ) { return $ key -> getKey ( ) === $ this -> getDefaultTheme ( ) -> getKey ( ) ; } return $ this -> getTheme ( $ key ) -> getKey ( ) === $ this -> getDefaultTheme ( ) -> getKey ( ) ; } | Check if active theme is default theme |
13,550 | public function getClient ( array $ options = [ ] ) { if ( $ this -> client ) { return $ this -> client ; } $ this -> client = new Client ( [ 'base_url' => $ this -> baseUrl , 'defaults' => [ 'headers' => [ 'Authorization' => 'Bearer ' . $ this -> accessToken , ] ] ] ) ; return $ this -> client ; } | Return an HTTP client instance |
13,551 | public function correctQuery ( $ query = null , $ queryCorrect = null , $ target = null , $ optUrl = null ) { $ result = '' ; if ( ! is_array ( $ optUrl ) ) { $ optUrl = [ ] ; } if ( empty ( $ query ) || empty ( $ queryCorrect ) ) { return $ result ; } $ correct = true ; $ correctQueryMsg = $ this -> Html -> tag ( 'p' ... | Return information about correction query of search . |
13,552 | public function addElement ( $ element , $ title = null , $ name = null , $ attrs = null ) { if ( ! $ element instanceof Element && ! $ element instanceof Divider ) { if ( $ element === self :: DIVIDER ) { $ element = new Divider ( null , $ attrs ) ; } else { if ( $ title === null ) { $ title = $ element ; } $ element ... | Add an element to the navigation |
13,553 | public function setActive ( $ name ) { $ element = $ this -> getElement ( $ name ) ; if ( $ element instanceof Element ) { $ element -> setActive ( ) ; } return $ this ; } | Set an element to active |
13,554 | public function setInactive ( $ name ) { $ element = $ this -> getElement ( $ name ) ; if ( $ element instanceof Element ) { $ element -> setInactive ( ) ; } return $ this ; } | Set an element to inactive |
13,555 | public function setInactiveAll ( ) { foreach ( $ this -> getElements ( ) as $ element ) { if ( $ element instanceof Element ) { $ element -> setInactive ( ) ; } } return $ this ; } | Set all element to inactive |
13,556 | public function getContainedFiles ( ) { if ( $ this -> isDir ( ) ) { $ files = array ( ) ; $ basePath = rtrim ( $ this -> _realpath , DIRECTORY_SEPARATOR ) ; foreach ( scandir ( $ this -> _realpath ) as $ fileName ) { if ( ! in_array ( $ fileName , array ( '.' , '..' ) ) ) { $ files [ ] = new File ( $ basePath . DIRECT... | Returns an array of contained file objects if this file is a directory otherwise false |
13,557 | protected function getConfirmationQuestion ( string $ questionName , bool $ defaultValue = false ) : ConfirmationQuestion { return new ConfirmationQuestion ( sprintf ( '<info>%s</info> [<comment>%s</comment>]? ' , $ questionName , $ defaultValue ? 'yes' : 'no' ) , $ defaultValue ) ; } | Instantiates and returns the confirmation question . |
13,558 | protected function writeSection ( array $ messages , string $ style = 'bg=blue;fg=white' ) : void { $ this -> output -> writeln ( [ '' , $ this -> getHelper ( 'formatter' ) -> formatBlock ( $ messages , $ style , true ) , '' , ] ) ; } | Writes a section of text to the output . |
13,559 | public function actionList ( ) { if ( ! Yii :: $ app -> user -> isGuest ) { $ searchModel = new SearchViewedProduct ( ) ; $ dataProvider = $ searchModel -> search ( Yii :: $ app -> request -> queryParams ) ; return $ this -> render ( 'list' , [ 'searchModel' => $ searchModel , 'dataProvider' => $ dataProvider , ] ) ; }... | Shows list of all user viewed products . |
13,560 | public function actionDelete ( $ id ) { if ( ! Yii :: $ app -> user -> isGuest ) { if ( ! empty ( $ id ) ) { $ viewedProduct = ViewedProduct :: find ( ) -> where ( [ 'product_id' => $ id , 'user_id' => Yii :: $ app -> user -> id ] ) -> one ( ) ; if ( $ viewedProduct -> user_id == Yii :: $ app -> user -> id ) { $ viewed... | Deletes an existing ViewedProduct model . If deletion is successful the browser will be redirected to the index page . |
13,561 | public function actionClearList ( ) { if ( ! Yii :: $ app -> user -> isGuest ) { ViewedProduct :: deleteAll ( [ 'user_id' => \ Yii :: $ app -> user -> id ] ) ; return $ this -> redirect ( [ 'list' ] ) ; } else throw new NotFoundHttpException ( ) ; } | Deletes all user viewed products . |
13,562 | public function manageEditColumns ( $ columns ) { $ current = Request :: get ( 'post_type' ) ; if ( empty ( $ current ) ) { return $ columns ; } return apply_filters ( 'ol_zeus_posttypehook_manage_edit-' . $ current . '_columns' , $ columns ) ; } | Hook to change columns on post type list page . |
13,563 | public function managePostsCustomColumn ( $ column , $ post_id ) { $ current = Request :: get ( 'post_type' ) ; if ( empty ( $ current ) ) { return ; } do_action ( 'ol_zeus_posttypehook_manage_' . $ current . '_custom_column' , $ column , $ post_id ) ; } | Hook to add featured image to column . |
13,564 | public function postTypeMetaboxesDisplay ( ) { if ( empty ( $ this -> metaboxes ) ) { return ; } $ slug = Request :: getCurrentSlug ( ) ; if ( empty ( $ slug ) || $ slug !== $ this -> slug ) { return ; } foreach ( $ this -> metaboxes as $ metabox ) { if ( ! $ metabox ) { continue ; } $ id = ( integer ) $ metabox -> get... | Hook building custom metaboxes for Post types . |
13,565 | public function postTypeSave ( ) { global $ post ; if ( ! isset ( $ post ) ) { return false ; } if ( defined ( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return $ post -> ID ; } $ slug = $ post -> post_type ; if ( empty ( $ this -> metaboxes ) || $ slug !== $ this -> slug ) { return ; } remove_action ( 'save_post' , [ & ... | Hook saving custom fields for Post types . |
13,566 | public function postTypeSettings ( ) { add_settings_section ( 'olympus-permalinks' , Translate :: t ( 'posttypehook.custom_permalinks' ) , [ & $ this , 'postTypeSettingTitle' ] , 'permalink' ) ; if ( isset ( $ _POST [ 'flushpermalink' ] ) ) { flush_rewrite_rules ( ) ; } if ( in_array ( $ this -> slug , $ this -> reserv... | Hook building custom options in Permalink settings page . |
13,567 | public function postTypeSettingFunc ( $ vars ) { if ( empty ( $ vars ) ) { return ; } $ vars [ 't_description' ] = Translate :: t ( 'posttypehook.description' ) ; $ vars [ 't_home' ] = OL_ZEUS_HOME ; Render :: view ( 'permalinks.html.twig' , $ vars , 'posttype' ) ; } | Hook to display input value on Permalink settings page . |
13,568 | function editor ( $ name , $ value = "" , $ config = array ( ) , $ events = array ( ) ) { $ attr = "" ; foreach ( $ this -> textareaAttributes as $ key => $ val ) { $ attr .= " " . $ key . '="' . str_replace ( '"' , '"' , $ val ) . '"' ; } $ out = "<textarea name=\"" . $ name . "\"" . $ attr . ">" . htmlspecialcha... | Creates a %CKEditor instance . In incompatible browsers %CKEditor will downgrade to plain HTML < ; textarea> ; element . |
13,569 | public function getResourceStream ( DatabaseResource $ resource ) : StreamInterface { switch ( $ this -> conn -> getDriverName ( ) ) { case DB :: DRIVER_MYSQL : case DB :: DRIVER_SQLITE : $ stmt = $ this -> conn -> prepare ( "SELECT `data` FROM `#__webdav_file_data` WHERE `resource_id` = :id ORDER BY `resource_id`, `ch... | Load resource contents as stream . |
13,570 | public function getAnyPartFlag ( $ target = null ) { $ anyPart = false ; if ( empty ( $ target ) ) { $ anyPart = $ this -> _modelConfigSearchInfo -> getFlagDefaultSearchAnyPart ( ) ; } elseif ( is_array ( $ target ) && in_array ( CAKE_SEARCH_INFO_TARGET_FIELD_ANY_PART , $ target ) ) { $ anyPart = true ; } return $ anyP... | Get state of flag any part search from list of target fields |
13,571 | public function getQueryStr ( $ queryData = null ) { $ query = ( string ) $ queryData ; if ( ! empty ( $ query ) ) { $ query = trim ( $ query ) ; } return $ query ; } | Get query string from string data |
13,572 | public function getQueryConfig ( $ target = null ) { $ targetModels = $ this -> _modelConfigSearchInfo -> getTargetModels ( ) ; $ cachePath = null ; $ result = [ 'anyPart' => $ this -> getAnyPartFlag ( $ target ) , 'modelConfig' => [ ] ] ; if ( empty ( $ target ) ) { $ result [ 'modelConfig' ] = $ targetModels ; return... | Get configuration for query |
13,573 | protected function _setSchemaCache ( $ modelName = null , $ schema = null ) { if ( empty ( $ modelName ) ) { return false ; } $ modelName = ( string ) $ modelName ; $ this -> _schemaCache [ $ modelName ] = $ schema ; return true ; } | Set schema information of model in cache |
13,574 | protected function _getSchemaCache ( $ modelName = null ) { if ( empty ( $ modelName ) ) { return null ; } $ modelName = ( string ) $ modelName ; if ( ! isset ( $ this -> _schemaCache [ $ modelName ] ) ) { return null ; } return $ this -> _schemaCache [ $ modelName ] ; } | Get schema information of model from cache |
13,575 | protected function _getSchemaForModel ( $ modelName = null ) { if ( empty ( $ modelName ) ) { return null ; } $ modelName = ( string ) $ modelName ; $ cached = $ this -> _getSchemaCache ( $ modelName ) ; if ( $ cached !== null ) { return $ cached ; } $ modelObj = ClassRegistry :: init ( $ modelName , true ) ; if ( $ mo... | Get schema information of model |
13,576 | protected function _checkFieldType ( $ modelFieldName = null ) { if ( empty ( $ modelFieldName ) || ! is_string ( $ modelFieldName ) ) { return false ; } if ( strpos ( $ modelFieldName , '.' ) === false ) { return false ; } list ( $ modelName , $ fieldName ) = pluginSplit ( $ modelFieldName ) ; $ schema = $ this -> _ge... | Check the model field to support search |
13,577 | protected function _getTargetFields ( $ isList = false ) { $ result = [ ] ; $ targetModels = $ this -> _modelConfigSearchInfo -> getTargetModels ( ) ; $ targetDeep = $ this -> _modelConfigSearchInfo -> getTargetDeep ( ) ; $ cachePath = null ; if ( empty ( $ targetModels ) ) { return $ result ; } $ language = ( string )... | Get target fields information |
13,578 | public function paginate ( $ conditions , $ fields , $ order , $ limit , $ page = 1 , $ recursive = null , $ extra = [ ] ) { if ( empty ( $ order ) ) { $ order = [ ] ; } elseif ( ! is_array ( $ order ) ) { $ order = [ $ order ] ; } $ sort = null ; $ direction = null ; if ( ! empty ( $ extra ) ) { $ sort = Hash :: get (... | Return data for pagination |
13,579 | protected function _getFieldsFromConfig ( $ fields = null ) { $ result = [ ] ; if ( empty ( $ fields ) ) { return $ result ; } if ( ! is_array ( $ fields ) ) { $ result = [ $ fields ] ; } else { $ result = array_keys ( $ fields ) ; } return $ result ; } | Get list of fields from query config fields |
13,580 | protected function getProcess ( string $ style , LoggerInterface $ logger ) : ProcessInterface { switch ( $ style ) { case self :: LINUX_STYLE : $ process = new Linux \ LinuxProcess ( $ logger ) ; break ; default : $ msg = "System style '" . $ style . "' is not supported" ; throw new UnsupportedSystemException ( $ msg ... | Create internal styled process . |
13,581 | public function format ( $ value , $ params = null , $ locale = null ) { if ( $ locale === null ) { $ locale = 'en' ; } $ formatter = $ this -> getFormatter ( $ locale ) ; if ( isset ( $ params [ 'primary' ] ) ) { return $ formatter -> formatCurrency ( $ value , $ params [ 'primary' ] ) ; } if ( isset ( $ params [ 'cur... | Format the currency |
13,582 | public static function build ( $ title , $ fields = [ ] ) { $ metabox = self :: getInstance ( ) ; if ( empty ( $ fields ) ) { throw new FieldException ( Translate :: t ( 'metabox.errors.no_fields' ) ) ; } $ id = Helpers :: urlize ( $ title ) ; $ metabox -> getModel ( ) -> setTitle ( $ title ) ; $ metabox -> getModel ( ... | Build Metabox component . |
13,583 | public function addMetabox ( ) { $ fields = $ this -> getModel ( ) -> getFields ( ) ; add_meta_box ( $ this -> getModel ( ) -> getId ( ) , $ this -> getModel ( ) -> getTitle ( ) , [ $ this , 'callback' ] , $ this -> getModel ( ) -> getSlug ( ) , $ this -> getModel ( ) -> getContext ( ) , $ this -> getModel ( ) -> getPr... | Add metabox . |
13,584 | public function callback ( $ post , $ args ) { if ( defined ( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return isset ( $ post -> ID ) ? $ post -> ID : null ; } $ fields = isset ( $ args [ 'args' ] ) ? $ args [ 'args' ] : null ; if ( ! $ fields || empty ( $ fields ) ) { throw new MetaboxException ( Translate :: t ( 'meta... | Callback function . |
13,585 | static public function registerDefaults ( ) { if ( self :: $ registeredStatic ) { require_once __DIR__ . '/Exceptions/RegisterationFailed.php' ; throw new RegistrationFailed ( 'Is already registered' ) ; } $ loader = new static ( ) ; $ loader -> registerNamespace ( 'ZExt' , __DIR__ . '/..' ) ; $ loader -> register ( ) ... | Register autloader with default namespaces |
13,586 | public function registerDirs ( array $ dirs , $ prepend = false ) { foreach ( $ dirs as $ path ) { $ this -> registerDir ( $ path , $ prepend ) ; } return $ this ; } | Register the directories |
13,587 | public function registerDir ( $ path , $ prepend = false ) { $ path = $ this -> normalizePath ( $ path ) ; if ( $ prepend ) { $ this -> dirs -> shift ( $ path ) ; } else { $ this -> dirs [ ] = $ path ; } return $ this ; } | Register the directory |
13,588 | public function registerComposerNamespaces ( array $ namespaces ) { foreach ( $ namespaces as $ namespace => $ dirs ) { $ namespaceDir = trim ( $ namespace , '\ ' ) ; $ namespaceDir = str_replace ( '\\' , DIRECTORY_SEPARATOR , $ namespaceDir ) ; foreach ( $ dirs as $ dir ) { $ dir .= DIRECTORY_SEPARATOR . $ namespaceDi... | Register namespaces by the Composer s autoload_namespaces list |
13,589 | protected function loadClass ( $ class , SplStack $ dirs ) { $ script = str_replace ( [ '_' , '\\' ] , DIRECTORY_SEPARATOR , $ class ) . '.php' ; foreach ( $ dirs as $ dir ) { $ path = $ dir . $ script ; if ( is_file ( $ path ) ) { include $ path ; return true ; } } return false ; } | Load the class |
13,590 | private function saveObjectDataToCache ( ) { Cacher :: getInstance ( ) -> getDefaultCacher ( ) -> set ( $ this -> getCacheKey ( ) , $ this -> getAsArray ( ) , 3600 ) ; return $ this ; } | Set data of current object in cache |
13,591 | public function flipBoolValue ( $ field ) { $ this -> setField ( $ field , ( int ) ! $ this -> getField ( $ field ) ) ; return $ this ; } | Change bool value to opposite |
13,592 | public function findAndLoadPossibleDuplicateEntityByFields ( array $ check_fields ) { $ class_name = \ get_class ( $ this ) . self :: CLASS_RELATION_NAME_REPOSITORY ; $ repo = new $ class_name ; $ params = [ ] ; foreach ( $ check_fields as $ field ) { $ method = 'get' . ucfirst ( $ field ) ; $ params [ $ field ] = $ th... | If possible to find existing entry by all this fields than update but not save new Make sure to first load data before calling that method |
13,593 | public function processOrderAction ( $ parent_column_name = '' ) { if ( $ parent_column_name ) { SQL :: orderCat ( $ this -> getId ( ) , $ this -> getDbTableName ( ) , $ this -> getPid ( ) , $ parent_column_name , $ _GET [ 'direct' ] ) ; } else { SQL :: order ( $ this -> getId ( ) , $ this -> getDbTableName ( ) , $ _GE... | Action to call fron _item_order functions |
13,594 | function cssSelector ( $ append = '' , $ nestingLevel = null ) { return parent :: cssSelector ( ( $ this -> parent -> quickDelete ? '.ajax' : '.lightbox' ) . $ append , $ nestingLevel ) ; } | function cssSelector - this function specifies the correct css selector for this data |
13,595 | public function offsetGet ( $ offset ) { if ( strpos ( $ offset , '.' ) === false ) return $ this -> findObject ( $ offset ) ; else return $ this -> findNestedObject ( $ offset , $ this -> description ) ; } | Return child resource or action . |
13,596 | public function branding_admin_footer ( ) { if ( Config :: get ( 'admin.footer_text' ) ) { echo Config :: get ( 'admin.footer_text' ) ; return ; } echo \ sprintf ( '%s <a href="https://wordpress.org" target="_blank">WordPress</a> %s <a href="%s" target="_blank">SnapWP</a>' , \ __ ( 'Built using' , 'snap' ) , \ __ ( 'an... | Outputs the SnapWP footer in WordPress admin . |
13,597 | public static function run ( $ event ) { static :: $ io = $ event -> getIO ( ) ; static :: $ composer = $ event -> getComposer ( ) ; static :: set_root ( ) ; static :: write_intro ( ) ; $ strategy = static :: $ io -> select ( "\n<comment>Please choose a templating system for your theme:</comment>" , static :: $ strateg... | Install a theme after create - project used in Composer . |
13,598 | private static function install_blade ( ) { $ install = new Process ( 'composer require snapwp/snap-blade -n' ) ; static :: $ io -> write ( "\n<comment>Downloading latest snapwp/snap-blade package.\nPlease wait...</comment>" ) ; try { $ install -> mustRun ( function ( $ type , $ buffer ) { echo ">>> $buffer" ; } ) ; st... | Install the Blade package and publish . |
13,599 | private static function add_blade_to_config ( ) { $ config = \ file_get_contents ( static :: $ root . '/config/services.php' ) ; if ( \ strpos ( $ config , 'Blade_Service_Provider' ) !== false ) { return ; } $ providers = \ preg_replace ( '/(\'providers\'\s*\=>\s*\[)([^]]*)(\])/m' , "$1$2\tSnap\Blade\Blade_Service_Prov... | Add the provider to the services config . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.