idx
int64
0
60.3k
question
stringlengths
64
4.24k
target
stringlengths
5
618
58,800
public function delete ( $ file_name ) { if ( ! \ Entrust :: can ( 'delete-backups' ) ) { abort ( 403 , 'Unauthorized access - you do not have the necessary permission to delete backups.' ) ; } $ disk = Storage :: disk ( config ( 'dick.backupmanager.disk' ) ) ; if ( $ disk -> exists ( 'backups/' . $ file_name ) ) { $ d...
Deletes a backup file .
58,801
protected function _validateEnumValue ( $ arg ) { parent :: _validateEnumValue ( $ arg ) ; $ enum = strtoupper ( trim ( $ arg ) ) ; if ( $ enum !== 'ASC' && $ enum !== 'DESC' ) { throw new \ InvalidArgumentException ( 'argument has to be a string of asc or desc!' ) ; } $ this -> enum = $ enum ; }
Validate the enum value and set the enum property to the validated value .
58,802
public function set ( $ params1 , $ params2 = null ) { if ( is_string ( $ params1 ) ) { $ this -> variables [ $ params1 ] = $ params2 ; } elseif ( is_array ( $ params1 ) ) { $ this -> variables = $ params1 + $ this -> variables ; } }
Set a value to be substituted later into either the template or the layout . Variables assigned are accessible to both the layout and the template .
58,803
public static function getSafe ( string $ fileName = '' , bool $ allowMixedCase = true ) : string { $ fileName = \ iconv ( 'UTF-8' , 'ASCII//TRANSLIT' , \ trim ( $ fileName ) ) ; if ( ! $ allowMixedCase ) { $ fileName = \ strtolower ( $ fileName ) ; } $ fileName = \ preg_replace ( '/[^a-z0-9\-\ \.]/i' , '' , $ fileName...
Returns filesystem - safe file names .
58,804
public function orderByField ( $ column , array $ params = [ ] ) { if ( count ( $ params ) <= 0 ) return $ this ; $ this -> order -> addByField ( $ column , $ params ) ; return $ this ; }
order by field .
58,805
public function page ( $ page ) { if ( ! $ this -> limit ) return ; $ offset = $ this -> limit * ( $ page - 1 ) ; $ this -> offset ( $ offset ) ; return $ this ; }
Set page .
58,806
public function import ( $ criteria ) { if ( $ criteria instanceof WhereCondition ) { $ criteria = $ criteria -> parent ; } if ( $ criteria instanceof Criteria ) { if ( $ criteria -> where -> has ( ) ) { foreach ( $ criteria -> where -> conditions as $ condition ) { $ condition -> parent = $ this -> where ; $ this -> w...
import from other criteria .
58,807
public function getOne ( ) { $ sql = $ this -> toSQL ( ) ; return $ this -> table -> getOne ( $ sql , $ this -> getParams ( ) ) ; }
bridge to getOne .
58,808
public function getRow ( ) { $ sql = $ this -> toSQL ( ) ; return $ this -> table -> getRow ( $ sql , $ this -> getParams ( ) ) ; }
bridge to getRow .
58,809
public function getCol ( $ column = 0 ) { $ sql = $ this -> toSQL ( ) ; return $ this -> table -> getCol ( $ sql , $ this -> getParams ( ) , $ column ) ; }
bridge to getCol .
58,810
public function toUpdateSQL ( $ attributes = array ( ) ) { $ sql = [ ] ; $ this -> params = [ ] ; $ sql [ ] = sprintf ( 'UPDATE %s SET' , $ this -> table -> getTableName ( ) ) ; $ setts = [ ] ; foreach ( $ attributes as $ key => $ value ) { $ setts [ ] = sprintf ( '%s = ?' , $ key ) ; $ this -> addParam ( $ value ) ; }...
convert to update SQL .
58,811
public function toInsertSQL ( $ attributes = array ( ) ) { $ sql = [ ] ; $ this -> params = [ ] ; $ sql [ ] = sprintf ( 'INSERT INTO %s' , $ this -> table -> getTableName ( ) ) ; $ keys = [ ] ; $ values = [ ] ; foreach ( $ attributes as $ key => $ value ) { $ keys [ ] = $ key ; $ values [ ] = '?' ; $ this -> addParam (...
convert to insert SQL .
58,812
public function toDeleteSQL ( ) { $ sql = [ ] ; $ this -> params = [ ] ; $ sql [ ] = sprintf ( 'DELETE FROM %s' , $ this -> table -> getTableName ( ) ) ; $ sql [ ] = $ this -> where -> toSQL ( ) ; $ this -> bind ( $ this -> where -> getParams ( ) ) ; return join ( ' ' , $ sql ) ; }
convert to delete SQL .
58,813
public function set ( string $ name , string $ value ) : void { $ this -> parameters [ $ name ] = $ value ; }
Sets a parameter value by parameter name .
58,814
protected function _containerGet ( $ container , $ key ) { $ origKey = $ key ; $ key = $ this -> _normalizeKey ( $ key ) ; $ origKey = is_string ( $ origKey ) || $ origKey instanceof Stringable ? $ origKey : $ key ; if ( $ container instanceof BaseContainerInterface ) { try { return $ container -> get ( $ key ) ; } cat...
Retrieves a value from a container or data set .
58,815
protected function parse ( ) { $ this -> media = array ( ) ; $ this -> extras = array ( ) ; $ this -> sheet -> resetContents ( ) ; $ this -> acceptBom ( ) ; while ( ! empty ( $ this -> buffer ) ) { $ this -> acceptEntry ( ) ; } $ extraContent = '' ; foreach ( $ this -> extras as $ media => $ extra ) { if ( empty ( $ me...
Parse css content
58,816
protected function appendExtra ( $ data ) { $ media = end ( $ this -> media ) ; if ( ! isset ( $ this -> extras [ $ media ] ) ) { $ this -> extras [ $ media ] = '' ; } $ this -> extras [ $ media ] .= $ data ; }
Append extra data
58,817
protected function acceptSafeValue ( $ until = '};' ) { $ result = '' ; while ( ! empty ( $ this -> buffer ) && false === strpos ( $ until , $ first = $ this -> buffer [ 0 ] ) ) { $ matches = array ( ) ; if ( '"' == $ first ) { $ result .= '"' ; $ this -> buffer = substr ( $ this -> buffer , 1 ) ; if ( $ this -> buffer...
Accept safe value
58,818
protected function assertValidCode ( $ code ) { if ( $ code instanceof Money ) { $ code = $ code -> getCurrency ( ) ; } if ( $ code instanceof Currency ) { return ( string ) $ code ; } if ( ! is_string ( $ code ) ) { throw new Exception \ InvalidArgumentException ( sprintf ( 'Currency code should be a string; %s given'...
Ensure the given code is a known valid code
58,819
public function setLogger ( $ logger , $ checkifexists = false ) { if ( $ checkifexists && is_object ( $ this -> logger ) ) { return false ; } $ this -> logger = $ logger ; return true ; }
Set logger instance of \ Psr \ Log \ AbstractLogger
58,820
public function getLogger ( ) { if ( is_object ( $ this -> logger ) ) { return $ this -> logger ; } if ( property_exists ( $ this , 'application' ) && is_object ( $ this -> application ) ) { return $ this -> application -> getLogger ( ) ; } return null ; }
Returns logger used in a class
58,821
public function getSourceFiles ( ) { $ sourceFiles = array ( ) ; $ ignore = $ this -> configuration -> get ( 'ignore' ) ; if ( is_dir ( $ this -> get ( 'source' ) ) ) { $ recursiveIterator = new \ RecursiveIteratorIterator ( new \ RecursiveDirectoryIterator ( $ this -> get ( 'source' ) ) ) ; foreach ( $ recursiveIterat...
Get the source files as an associative array .
58,822
public function getSources ( ) { if ( null === $ this -> sources ) { $ sources = array ( ) ; foreach ( $ this -> getSourceFiles ( ) as $ sourcePath ) { $ sources [ ] = new Pinocchio ( $ sourcePath ) ; } $ this -> sources = $ sources ; } return $ this -> sources ; }
Get the set of source Pinocchios that represent the source files for the current instance .
58,823
protected function initialize ( ) { $ this -> configuration = new ValueHolder ( $ this -> loadConfiguration ( ) ) ; $ this -> defaults = new ValueHolder ( $ this -> getDefaults ( ) ) ; return $ this ; }
Initialize the non - customizable part of the configuration .
58,824
protected function loadConfiguration ( ) { $ configuration = null ; if ( file_exists ( self :: CONFIGURATION_FILENAME ) ) { $ configuration = json_decode ( file_get_contents ( self :: CONFIGURATION_FILENAME ) , true ) ; } return $ configuration ? : array ( ) ; }
Load the configuration from the file - if any - and return it .
58,825
public function getMenu ( $ menuTypeId , $ language = null ) { if ( is_null ( $ language ) ) { $ language = app ( ) -> getLocale ( ) ; } if ( $ this -> cacheEnabled ) { $ cacheName = self :: getCacheName ( $ menuTypeId , $ language ) ; if ( Cache :: has ( $ cacheName ) ) { return Cache :: get ( $ cacheName ) ; } } retu...
Get cached menu or cache it
58,826
protected function formatMenuItems ( & $ items ) { foreach ( $ items as $ key => $ item ) { $ itemData = array_only ( $ item -> toArray ( ) , $ this -> selectFields ) ; if ( ! $ item -> children -> isEmpty ( ) ) { $ itemData [ 'children' ] = $ this -> sortByField ( $ this -> formatMenuItems ( $ item -> children ) ) ; }...
Format menu items
58,827
public function getMenuByGroup ( $ language = null ) { if ( is_null ( $ language ) ) $ language = app ( ) -> getLocale ( ) ; $ this -> menuClass :: $ customAppends = [ 'item_url' , 'item_label' ] ; $ this -> pagesClass :: $ customAppends = [ 'page_url' ] ; $ items = $ this -> menuGroupsClass :: select ( 'id' , 'name' ,...
Get menu by groups
58,828
public static function clearCache ( $ menuTypeId , $ lang ) { $ name = self :: getCacheName ( $ menuTypeId , $ lang ) ; Cache :: forget ( $ name ) ; }
Clear menu item cache
58,829
public function register ( string $ name , ServiceManager $ service_manager ) { $ this -> service_managers [ $ name ] = $ service_manager ; if ( Core :: i ( ) -> log ) { Core :: i ( ) -> log -> debug ( 'Registered service manager: ' . $ name ) ; } }
Add a service manager
58,830
public function get ( $ name ) { if ( isset ( $ this -> service_managers [ $ name ] ) ) { return $ this -> service_managers [ $ name ] ; } else { throw new ServiceManagerNotFoundException ( 'No service manager has been registered as ' . $ name ) ; } }
Returns the specified service manager
58,831
public function build ( ) { $ this -> _checkConditionArray ( ) ; $ this -> _processConditionArray ( ) ; $ this -> conditionString = trim ( $ this -> conditionString ) ; return $ this -> conditionString . ' ' ; }
Build the condition expression string . Processing the passed condition expression and return it in form of a string .
58,832
private function _processConditionArray ( ) { foreach ( $ this -> conditionArray as $ conditions ) { foreach ( $ conditions as $ operator => $ condition ) { if ( ! is_string ( $ operator ) ) { $ this -> conditionString .= $ condition . ' ' ; } else { $ this -> conditionString .= strtoupper ( $ operator ) . ' ' . $ cond...
Processing the condition array and build the condition string .
58,833
public function hydrate ( array $ objects , array $ fields = array ( ) ) { return $ this -> modelBuilder -> buildAll ( $ objects , $ this -> class -> getManagerIdentifier ( ) , $ fields ) ; }
Multiple hydration model .
58,834
protected function getQueryBuilderResult ( $ qb , $ count = null , $ hydrate = true , array $ fields = array ( ) , $ except = false ) { $ result = $ qb -> execute ( ) ; if ( $ except ) { foreach ( $ result as $ key => $ value ) { foreach ( $ value as $ field => $ data ) { if ( is_int ( $ field ) ) { $ result [ $ key ] ...
Return the result for given query builder object .
58,835
public function findByUid ( $ id , $ columns = [ '*' ] ) { $ this -> applyCriteria ( ) ; $ this -> applyScope ( ) ; $ model = $ this -> model -> where ( 'uid' , '=' , $ id ) -> firstOrFail ( $ columns ) ; $ this -> resetModel ( ) ; return $ this -> parserResult ( $ model ) ; }
Find data by id .
58,836
public static function buildFromJSON ( $ json ) { $ jsonObject = json_decode ( $ json ) ; if ( ! property_exists ( $ jsonObject , 'platformGID' ) ) throw new SocialRecordFormatException ( 'SocialRecord: Property platformGID missing!' ) ; if ( ! property_exists ( $ jsonObject , 'globalID' ) ) throw new SocialRecordForma...
Creates a SocialRecord object from a JSON String
58,837
public function keyRevocationList ( $ krl = NULL ) { if ( $ krl == NULL ) $ this -> keyRevocationList = array ( ) ; else $ this -> keyRevocationList = $ krl ; return $ this ; }
Set the key revocation list
58,838
public function build ( ) { if ( $ this -> displayName == NULL ) throw new SocialRecordFormatException ( 'SocialRecord: displayName must be specified for instantiation' ) ; if ( $ this -> profileLocation == NULL ) throw new SocialRecordFormatException ( 'SocialRecord: profileLocation must be specified for instantiation...
Builder method that creates the actual SocialRecord object
58,839
public static function Ttut1 ( $ tt1 , $ tt2 , $ dt , & $ ut11 , & $ ut12 ) { $ dtd ; $ dtd = $ dt / DAYSEC ; if ( $ tt1 > $ tt2 ) { $ ut11 = $ tt1 ; $ ut12 = $ tt2 - $ dtd ; } else { $ ut11 = $ tt1 - $ dtd ; $ ut12 = $ tt2 ; } return 0 ; }
- - - - - - - - - i a u T t u t 1 - - - - - - - - -
58,840
public function get ( int $ row , int $ column ) { $ this -> assertIndexesAreValid ( $ row , $ column ) ; return $ this -> cells [ $ row ] [ $ column ] ; }
Get the value at a given row and column .
58,841
public function isEmpty ( int $ row , int $ column ) { $ this -> assertIndexesAreValid ( $ row , $ column ) ; return $ this -> get ( $ row , $ column ) === null ; }
Determine whether a cell is empty .
58,842
public function set ( int $ row , int $ column , Tile $ tile ) { $ this -> assertEmptyTileSlot ( $ row , $ column , $ tile ) ; switch ( $ tile -> getValue ( ) ) { case Tile :: SMALL : $ this -> cells [ $ row ] [ $ column ] = Cell :: SMALL ( ) ; $ this -> small += 1 ; break ; case Tile :: TALL : $ this -> cells [ $ row ...
Set a cell values at a given row and column for a given tile .
58,843
public function getData ( bool $ flatten = false , callable $ cellToValue = null ) { $ copy = array ( ) ; for ( $ row = 0 ; $ row < $ this -> rows ; $ row ++ ) { if ( ! $ flatten ) { $ copy [ $ row ] = array ( ) ; } foreach ( $ this -> cells [ $ row ] as $ cell ) { $ value = $ cellToValue ? $ cellToValue ( $ cell ) : $...
Get a copy of the cells array .
58,844
public function getCells ( bool $ flatten = false , bool $ raw = false ) { return $ this -> getData ( $ flatten , $ raw ? null : function ( $ cell ) { return Cell :: toValue ( $ cell ) ; } ) ; }
Get a copy of the grid cells .
58,845
public function getTiles ( bool $ flatten = false , bool $ raw = false ) { return $ this -> getData ( $ flatten , $ raw ? function ( $ cell ) { return Tile :: fromCell ( $ cell ) ; } : function ( $ cell ) { return Cell :: toValue ( Tile :: fromCell ( $ cell ) ) ; } ) ; }
Get a copy of the grid cells as an array of tiles .
58,846
public static function factory ( $ key , $ secret , $ from ) { $ sms = new Sms ( new GuzzleHttp \ Client ( ) ) ; $ sms -> setKey ( $ key ) -> setSecret ( $ secret ) -> setFrom ( $ from ) ; return $ sms ; }
Creates and returns a new Sms instance
58,847
public function text ( $ to , $ message , $ client_ref = null ) { return $ this -> send ( [ "to" => $ to , "type" => "text" , "text" => $ this -> mbstring ( $ message ) , "client-ref" => $ this -> mbstring ( $ client_ref ) ] ) ; }
Sends a text message
58,848
protected function send ( array $ query ) { if ( ! $ this -> key || ! $ this -> secret || ! $ this -> from ) { throw new Exception \ ConfigurationException ( "Invalid configuration. Missing key, secret, or from." ) ; } $ query [ "api_key" ] = $ this -> key ; $ query [ "api_secret" ] = $ this -> secret ; $ query [ "from...
Sends a request to the Nexmo API
58,849
protected function hasContentForKey ( $ key , $ content ) : bool { foreach ( $ content as $ item ) { foreach ( $ this -> getMatchingKeys ( $ key , $ item ) as $ matchedKey ) { if ( parent :: hasContentForKey ( $ matchedKey , $ item ) ) { return true ; } } } return false ; }
Overrides the parent method . When checking to see if valid content exists this will scan all of the current content to see if any have content located with the key .
58,850
protected function getMatchingKeys ( $ key , $ content ) : array { if ( ! is_string ( $ key ) || ! self :: isStringRegex ( $ key ) ) { return [ $ key ] ; } if ( $ content instanceof Treadable ) { $ allKeys = $ content -> getChildKeys ( ) ; } if ( is_object ( $ content ) && ! ( $ content instanceof Treadable ) ) { $ con...
Given a key and a piece of content check to see if that content has any child content located based off of that provided key . This will also check for regex strings as well .
58,851
public function get ( $ id ) { if ( $ this -> parent === null && ! array_key_exists ( $ id , $ this -> instances ) ) { try { return $ this -> instantiate ( $ id ) ; } catch ( \ Exception $ e ) { throw new RefNotFound ( $ id ) ; } } return array_key_exists ( $ id , $ this -> instances ) ? $ this -> instances [ $ id ] : ...
Retrieve an instance from the injector .
58,852
public function has ( $ id ) { if ( array_key_exists ( $ id , $ this -> instances ) ) { return true ; } return $ this -> parent !== null ? $ this -> parent -> has ( $ id ) : false ; }
Check for the existence of an instance from the injector .
58,853
public function annotate ( callable $ callable ) { $ fn = null ; $ invoke = function ( ) { } ; if ( is_array ( $ callable ) ) { $ cls = new ReflectionClass ( $ callable [ 0 ] ) ; $ fn = $ cls -> getMethod ( $ callable [ 1 ] ) ; $ invoke = function ( $ args ) use ( $ fn , $ callable ) { return function ( ) use ( $ fn , ...
Annotate a function so that it is dependency injected .
58,854
protected function addColumnElementToForm ( Form $ form , Property $ property ) { $ annotationType = $ property -> getAnnotation ( ) -> type ; $ label = $ property -> getName ( ) ; switch ( $ annotationType ) { case 'datetime' : $ element = new DateTime ( $ property -> getName ( ) ) ; break ; case 'date' : $ element = ...
Adds a property depending column - element to the form
58,855
protected function addSingleSelecterElementToForm ( Form $ form , Property $ property ) { if ( $ this -> toOneElement == $ this :: REF_ONE_ELEMENT_SELECT ) { $ element = new Select ( $ property -> getName ( ) ) ; } else { $ element = new Radio ( $ property -> getName ( ) ) ; } $ options = [ 0 => '-none-' ] + $ this -> ...
Adds a property depending single - selecter - element to the form
58,856
protected function addMultiSelecterElementToForm ( Form $ form , Property $ property ) { if ( $ this -> toManyElement == $ this :: REF_MANY_ELEMENT_MULTISELECT ) { $ element = new Select ( $ property -> getName ( ) ) ; $ element -> setAttribute ( 'multiple' , true ) ; } else { $ element = new MultiCheckbox ( $ property...
Adds a property depending multi - selecter - element to the form
58,857
protected function getValueOptionsFromEntity ( $ entityNamespace ) { $ targets = $ this -> objectManager -> getRepository ( $ entityNamespace ) -> findBy ( [ ] , [ 'id' => 'ASC' ] ) ; $ displayNameGetter = 'get' . ucfirst ( $ entityNamespace :: DISPLAY_NAME_PROPERTY ) ; $ options = [ ] ; foreach ( $ targets as $ target...
Get ValueOptions for Form - Elements by entity
58,858
public function getCategoriesUsed ( array $ titles ) { $ path = '?action=query&generator=categories&prop=info' ; $ path .= '&titles=' . $ this -> buildParameter ( $ titles ) ; $ response = $ this -> client -> get ( $ this -> fetchUrl ( $ path ) ) ; return $ this -> validateResponse ( $ response ) ; }
Method to get information about all categories used .
58,859
public function getCategoriesInfo ( array $ titles , $ clcontinue = false ) { $ path = '?action=query&prop=categoryinfo' ; $ path .= '&titles=' . $ this -> buildParameter ( $ titles ) ; if ( $ clcontinue ) { $ path .= '&clcontinue=' ; } $ response = $ this -> client -> get ( $ this -> fetchUrl ( $ path ) ) ; return $ t...
Method to get information about the given categories .
58,860
public function getCategoryMembers ( $ cmtitle = null , $ cmpageid = null , $ cmlimit = null , array $ cmprop = null , array $ cmnamespace = null , array $ cmtype = null , $ cmstart = null , $ cmend = null , $ cmstartsortkey = null , $ cmendsortkey = null , $ cmstartsortkeyprefix = null , $ cmendsortkeyprefix = null , ...
Method to get information about the pages within a category
58,861
public function enumerateCategories ( $ acfrom = null , $ acto = null , $ acprefix = null , $ acdir = null , $ acmin = null , $ acmax = null , $ aclimit = null , array $ acprop = null ) { $ path = '?action=query&list=allcategories' ; if ( isset ( $ acfrom ) ) { $ path .= '&acfrom=' . $ acfrom ; } if ( isset ( $ acto ) ...
Method to enumerate all categories .
58,862
public function getChangeTags ( array $ tgprop = null , $ tglimit = null ) { $ path = '?action=query&list=tags' ; if ( isset ( $ tgprop ) ) { $ path .= '&tgprop=' . $ this -> buildParameter ( $ tgprop ) ; } if ( isset ( $ tglimit ) ) { $ path .= '&tglimit=' . $ tglimit ; } $ response = $ this -> client -> get ( $ this ...
Method to list change tags .
58,863
public function create ( Pubsub_Subscription $ postBody , $ optParams = array ( ) ) { $ params = array ( 'postBody' => $ postBody ) ; $ params = array_merge ( $ params , $ optParams ) ; return $ this -> call ( 'create' , array ( $ params ) , "Pubsub_Subscription" ) ; }
Creates a subscription on a given topic for a given subscriber . If the subscription already exists returns ALREADY_EXISTS . If the corresponding topic doesn t exist returns NOT_FOUND .
58,864
public function make ( ) { $ menuClasses = [ 'dropdown-menu' ] ; if ( $ this -> right ) { $ menuClasses [ ] = 'dropdown-menu-right' ; } return new Div ( [ 'class' => 'dropdown' ] , [ new Anchor ( [ 'id' => $ this -> hash , 'data-toggle' => 'dropdown' , 'aria-haspopup' => 'true' , 'aria-expanded' => 'false' , ] , new It...
Build the dropdown element .
58,865
protected function getComposePsrNamespaceList ( ) : array { $ jsonFilePath = $ this -> annotationConfig -> getConfig ( ) [ 'composerFilePath' ] ; if ( ! file_exists ( $ jsonFilePath ) ) throw new AnnotationException ( 'Build Annotation error , composer.json file not found ' . $ jsonFilePath ) ; return json_decode ( fil...
load composer . json file return composer . json psr - 4 setting
58,866
protected function namespaceCreateAllDir ( string $ namespace ) { if ( is_dir ( $ namespace ) ) return ; $ dirList = explode ( '\\' , str_replace ( '/' , '\\' , $ namespace ) ) ; $ path = $ this -> annotationConfig -> getConfig ( ) [ 'buildPath' ] ; foreach ( $ dirList as $ k => $ dir ) { $ path .= '/' . $ dir ; if ( !...
create namespace of needed all dir
58,867
protected function fileToBuildPath ( $ path ) { $ configService = ServiceFactory :: getInstance ( AnnotationConfigServiceImpl :: class ) ; $ list = $ configService -> getConfig ( ) [ 'scanNamespace' ] ; foreach ( $ list as $ namespace => $ filePath ) { if ( strpos ( $ path , $ filePath ) !== false ) { return str_replac...
file path to build path
58,868
public static function getService ( ArrayObject $ config , Loops $ loops ) { $ logger = parent :: getService ( $ config , $ loops ) ; $ plugin = $ config -> offsetExists ( "plugin" ) ? $ config -> offsetGet ( "plugin" ) : "stderr" ; foreach ( array_filter ( is_array ( $ plugin ) ? $ plugin : explode ( "," , $ plugin ) ...
Creates the logging service .
58,869
public static function php_error_handler ( $ errno , $ errstr , $ errfile , $ errline , $ errcontext ) { if ( $ errno & error_reporting ( ) ) { foreach ( self :: $ error_handling_instances as list ( $ logger , $ level , $ with_line , $ with_trace ) ) { if ( ! ( $ errno & $ level ) ) { continue ; } switch ( $ errno ) { ...
Converts PHP errors to a Loops \ Messages \ Message and passes it to all Loops \ Service \ Logger instances .
58,870
public function logMessage ( Message $ message ) { foreach ( $ this -> logger as $ logger ) { $ logger -> logMessage ( $ message ) ; } }
Forwards the log message to all attached logger interfaces
58,871
public function detach ( LoggerInterface $ logger ) { $ key = array_search ( $ logger , $ this -> logger , TRUE ) ; if ( $ key === FALSE ) { return FALSE ; } unset ( $ this -> logger [ $ key ] ) ; return TRUE ; }
Removes an attached logger instance
58,872
public function createTelerivetDriver ( ) { $ config = $ this -> app [ 'config' ] -> get ( 'sms.telerivet' , [ ] ) ; $ driver = new Telerivet ( $ config [ 'api_key' ] , $ config [ 'project_id' ] ) ; return $ driver ; }
Create an instance of the telerivet driver
58,873
public function createSmartDriver ( ) { $ config = $ this -> app [ 'config' ] -> get ( 'sms.smart' , [ ] ) ; $ driver = new Smart ( $ config [ 'token' ] , $ config [ 'wsdl' ] , $ config [ 'service' ] ) ; return $ driver ; }
Create an instance of the smart driver
58,874
public function createSunDriver ( ) { $ config = $ this -> app [ 'config' ] -> get ( 'sms.sun' , [ ] ) ; $ driver = new Sun ( $ config [ 'user' ] , $ config [ 'pass' ] , $ config [ 'mask' ] , $ config [ 'login_url' ] ) ; return $ driver ; }
Create an instance of the sun driver
58,875
public static function createFromServer ( $ serv ) { $ scheme = isset ( $ serv [ 'HTTPS' ] ) ? 'https://' : 'http://' ; $ host = ! empty ( $ serv [ 'HTTP_HOST' ] ) ? $ serv [ 'HTTP_HOST' ] : $ serv [ 'SERVER_NAME' ] ; $ port = empty ( $ serv [ 'SERVER_PORT' ] ) ? $ serv [ 'SERVER_PORT' ] : null ; $ path = ( string ) pa...
Create uri Instance from header .
58,876
private function parseDocument ( ) { $ doc = $ this -> getDocument ( ) ; if ( $ doc === null ) { $ this -> isParsed = true ; return ; } $ errors = new ErrorCollection ( ) ; if ( ( $ data = $ doc -> getData ( ) ) === false ) { $ errors -> addDataError ( "Invalid element" ) ; throw new JsonApiException ( $ errors ) ; } $...
Parse JSON API document
58,877
public function spracuj ( $ config , $ text , $ time ) { $ text = '<meta http-equiv="content-type" content="text/html; charset=utf-8"/>' . $ text ; $ from_enc = "ISO-8859-2" ; if ( $ config [ "from_encoding" ] ) $ from_enc = $ config [ "from_encoding" ] ; $ text = str_replace ( $ from_enc , "utf-8" , $ text ) ; $ this ...
Config by mal obsahovat xpath upmiestnenie tabulky a pocet tr ktore preskocit
58,878
public function doRender ( $ rawContent , array $ attributes = [ ] ) { $ renderer = $ this -> renderer ; if ( $ renderer === null ) { $ rendered = $ rawContent ; } elseif ( $ renderer instanceof Renderer ) { $ rendered = $ renderer -> render ( $ rawContent , $ attributes ) ; } elseif ( $ renderer instanceof \ Closure )...
Render the page using the provided Renderer .
58,879
public function createService ( ServiceLocatorInterface $ serviceLocator ) { $ configuration = $ serviceLocator -> get ( 'ApplicationConfig' ) ; if ( $ serviceLocator -> has ( 'ServiceListenerInterface' ) ) { $ serviceListener = $ serviceLocator -> get ( 'ServiceListenerInterface' ) ; if ( ! $ serviceListener instanceo...
Create the service listener service
58,880
public function setLogLevel ( $ level ) { $ this -> logLevelSet = true ; if ( $ level != $ this -> getLogLevel ( ) ) { $ this -> logLevel = $ level ; $ this -> info ( "Setting loglevel to $level" ) ; } }
Setter for loglevel .
58,881
private function log ( $ priority , $ msg , $ fileHandle = null ) { if ( $ priority [ 0 ] < $ this -> logLevel && $ fileHandle === null ) { return ; } $ logTime = time ( ) ; $ this -> logQueue [ ] = new Logger \ Message ( $ priority [ 1 ] , $ logTime , $ msg ) ; $ prioritystr = '[' . $ priority [ 1 ] . ']' ; $ timestr ...
Add a new log message to the logger queue .
58,882
public function error ( $ msg , $ fileHandle = null ) { $ this -> log ( self :: $ logLevelError , $ msg , $ fileHandle ) ; }
Log a message with priority error .
58,883
public function warn ( $ msg , $ fileHandle = null ) { $ this -> log ( self :: $ logLevelWarn , $ msg , $ fileHandle = null ) ; }
Log a message with priority warn .
58,884
public function info ( $ msg , $ fileHandle = null ) { $ this -> log ( self :: $ logLevelInfo , $ msg , $ fileHandle = null ) ; }
Log a message with priority info .
58,885
public function debug ( $ msg , $ fileHandle = null ) { $ this -> log ( self :: $ logLevelDebug , $ msg , $ fileHandle ) ; }
Log a message with priority debug .
58,886
public function verbose ( $ msg , $ fileHandle = null ) { $ this -> log ( self :: $ logLevelVerbose , $ msg , $ fileHandle = null ) ; }
Log a message with priority verbose .
58,887
public function flush ( ) { if ( null == $ this -> buildLogFile ) { $ this -> resetLogQueue ( ) ; return ; } $ messageElements = array ( ) ; for ( $ i = count ( $ this -> logQueue ) - 1 ; $ i >= 0 ; -- $ i ) { $ message = $ this -> logQueue [ $ i ] ; $ messageString = '<message priority="' . $ message -> priority . '" ...
Flush the log queue to the log file .
58,888
public function save ( IEvent $ event ) { if ( null !== $ event -> getId ( ) ) { return $ event ; } $ event -> setId ( ( string ) Uuid :: uuid4 ( ) ) ; $ this -> events [ ] = $ event ; return $ event ; }
Save event .
58,889
private function CheckPublished ( ) { return PublishDateUtil :: IsPublishedNow ( $ this -> article -> GetPublish ( ) , $ this -> article -> GetPublishFrom ( ) , $ this -> article -> GetPublishTo ( ) ) ; }
Checks if current article is published at this moment
58,890
protected function triggerBeforeSave ( $ query , EntityInterface $ entity , array $ data ) { $ save = $ query instanceof Insert ? ( new Save ( $ entity , $ data ) ) -> setAction ( Save :: ACTION_BEFORE_INSERT ) : ( new Save ( $ entity , $ data ) ) -> setAction ( Save :: ACTION_BEFORE_UPDATE ) ; return Orm :: getEmitter...
Triggers the before save event
58,891
protected function triggerAfterSave ( Save $ saveEvent , EntityInterface $ entity ) { $ afterSave = clone $ saveEvent ; $ action = $ afterSave -> getName ( ) == Save :: ACTION_BEFORE_INSERT ? Save :: ACTION_AFTER_INSERT : Save :: ACTION_AFTER_UPDATE ; $ afterSave -> setEntity ( $ entity ) -> setAction ( $ action ) ; re...
Triggers the after save event
58,892
protected function triggerDelete ( EntityInterface $ entity , $ action = Delete :: ACTION_BEFORE_DELETE ) { $ event = new Delete ( $ entity ) ; $ event -> setAction ( $ action ) ; return Orm :: getEmitter ( $ this -> getEntityClassName ( ) ) -> emit ( $ event ) ; }
Triggers the delete event with provided action
58,893
public function actionIndex ( ) { $ languageForm = Yii :: createObject ( [ 'class' => Language :: className ( ) , 'scenario' => 'create' ] ) ; $ filterModel = Yii :: createObject ( [ 'class' => Language :: className ( ) , 'scenario' => 'search' ] ) ; Yii :: $ app -> view -> title = Yii :: t ( 'multilang' , 'Languages' ...
Show list of blacklisted words
58,894
public function actionCreate ( ) { $ languageForm = Yii :: createObject ( [ 'class' => Language :: className ( ) , 'scenario' => 'create' ] ) ; if ( $ languageForm -> load ( Yii :: $ app -> request -> post ( ) ) && $ languageForm -> save ( ) ) { Yii :: $ app -> getSession ( ) -> setFlash ( 'success' , Yii :: t ( 'multi...
Add new language
58,895
protected function findLanguage ( $ code ) { $ language = Language :: findOne ( $ code ) ; if ( $ language === null ) { throw new \ yii \ web \ NotFoundHttpException ( 'The requested language does not exist' ) ; } return $ language ; }
Finds the Language model based on its code value . If the model is not found a 404 HTTP exception will be thrown .
58,896
public function persist ( object $ entity ) : self { $ identity = $ this -> extractIdentity ( $ entity ) ; if ( ! $ this -> container -> contains ( $ identity ) ) { $ meta = ( $ this -> metadata ) ( get_class ( $ entity ) ) ; $ this -> container -> push ( $ identity , $ entity , State :: new ( ) ) ; $ this -> generator...
Add the given entity to the ones to be persisted
58,897
public function get ( string $ class , Identity $ identity ) : object { $ meta = ( $ this -> metadata ) ( $ class ) ; $ generator = $ this -> generators -> get ( $ meta -> identity ( ) -> type ( ) ) ; if ( $ generator -> knows ( $ identity -> value ( ) ) ) { $ identity = $ generator -> for ( $ identity -> value ( ) ) ;...
Return the entity with the given identifier
58,898
public function remove ( object $ entity ) : self { $ identity = $ this -> extractIdentity ( $ entity ) ; try { $ state = $ this -> container -> stateFor ( $ identity ) ; switch ( $ state ) { case State :: new ( ) : $ this -> container -> push ( $ identity , $ entity , State :: removed ( ) ) ; break ; case State :: man...
Plan the given entity to be removed
58,899
public function detach ( object $ entity ) : self { $ this -> container -> detach ( $ this -> extractIdentity ( $ entity ) ) ; return $ this ; }
Detach the given entity from the unit of work