idx
int64
0
60.3k
question
stringlengths
64
4.24k
target
stringlengths
5
618
6,400
protected function resolve ( string $ abstract , array & $ stack = [ ] ) : Dependency { if ( isset ( $ this -> aliases [ $ abstract ] ) ) { $ alias = $ this -> aliases [ $ abstract ] ; if ( in_array ( $ alias , $ stack ) ) { $ stack [ ] = $ alias ; $ error = implode ( ' => ' , $ stack ) ; throw new BindingException ( "...
Resolves an abstract type
6,401
protected function build ( $ concrete , array $ arguments = [ ] ) { if ( is_callable ( $ concrete ) ) { return $ concrete ( $ this , $ arguments ) ; } if ( isset ( $ this -> reflectionClass [ $ concrete ] ) ) { $ reflection = $ this -> reflectionClass [ $ concrete ] ; } else { try { $ reflection = $ this -> reflectionC...
Builds an instance of a concrete type
6,402
public function parse ( ) { return $ this -> execute ( Util :: cache ( $ this -> file , $ this -> raw , 'viper' , function ( $ data ) : NodeCollection { $ tokens = $ this -> tokenize ( $ data ) ; return $ this -> formLogicalTree ( $ tokens ) ; } ) , $ this -> data ) ; }
Chief executive viper function
6,403
public function factory ( $ collection ) { if ( $ collection instanceof Collection ) { $ collectionName = $ collection -> getName ( ) ; } else { $ collectionName = $ collection ; } if ( ! isset ( $ this -> collections [ $ collectionName ] ) ) { if ( ! ( $ collection instanceof Collection ) ) { $ collection = Norm :: cr...
Factory to create new collection by its name or instance
6,404
public function unmarshall ( $ object ) { if ( isset ( $ object [ 'id' ] ) ) { $ object [ '$id' ] = $ object [ 'id' ] ; unset ( $ object [ 'id' ] ) ; } foreach ( $ object as $ key => $ value ) { if ( $ key [ 0 ] === '_' ) { $ key [ 0 ] = '$' ; $ object [ $ key ] = $ value ; } } return $ object ; }
Unmarshall single object from data source to associative array . The unmarshall process is necessary due to different data type provided by data source . Proper unmarshall will make sure data from data source that will be consumed by Norm in the accepted form of data .
6,405
public function delete ( ) { $ deleteUri = $ this -> link ( 'edit' ) ; if ( ! $ deleteUri ) { require_once 'Zend/Feed/Exception.php' ; throw new Zend_Feed_Exception ( 'Cannot delete entry; no link rel="edit" is present.' ) ; } $ client = Zend_Feed :: getHttpClient ( ) ; do { $ client -> setUri ( $ deleteUri ) ; if ( Ze...
Delete an atom entry .
6,406
public function initItems ( ) { if ( ! empty ( $ this -> items ) ) { $ links = array ( ) ; if ( $ this -> homeLabel !== false ) { $ label = $ this -> homeLabel !== null ? $ this -> homeLabel : Icon :: icon ( Enum :: ICON_HOME ) ; $ links [ $ label ] = array ( 'href' => $ this -> homeUrl !== null ? $ this -> homeUrl : \...
Initializes menu items
6,407
public function renderItem ( $ label , $ options = array ( ) ) { if ( $ this -> tagName === 'nav' ) { $ url = ArrayHelper :: removeValue ( $ options , 'href' , '#' ) ; $ htmlOptions = ArrayHelper :: removeValue ( $ options , 'options' , array ( ) ) ; echo \ CHtml :: openTag ( 'li' , $ htmlOptions ) ; echo \ CHtml :: li...
Generates the rendering of a breadcrumb item
6,408
static public function strToSlug ( $ string , $ bWithSlashes = true ) { switch ( $ GLOBALS [ 'okt' ] -> config -> slug_type ) { case 'utf8' : return self :: tidyURL ( $ string , $ bWithSlashes ) ; case 'ascii' : default : return self :: strToLowerURL ( $ string , $ bWithSlashes ) ; } }
Transform a string in slug regarding to Okatea configuration .
6,409
public static function strToUrl ( $ string , $ bWithSlashes = true ) { $ string = self :: deaccent ( $ string ) ; $ string = preg_replace ( '/[^A-Za-z0-9_\s\'\:\/[\]-]/' , '' , $ string ) ; return self :: tidyUrl ( $ string , $ bWithSlashes ) ; }
String to URL
6,410
static public function strToCamelCase ( $ string ) { $ string = self :: strToLowerUrl ( $ string , false ) ; $ string = implode ( '' , array_map ( 'ucfirst' , explode ( '_' , $ string ) ) ) ; $ string = implode ( '' , array_map ( 'ucfirst' , explode ( '-' , $ string ) ) ) ; return strtolower ( substr ( $ string , 0 , 1...
Transform a string in a camelCase style .
6,411
public static function deaccent ( $ string ) { $ pattern = [ ] ; $ pattern [ 'A' ] = '\x{00C0}-\x{00C5}' ; $ pattern [ 'AE' ] = '\x{00C6}' ; $ pattern [ 'C' ] = '\x{00C7}' ; $ pattern [ 'D' ] = '\x{00D0}' ; $ pattern [ 'E' ] = '\x{00C8}-\x{00CB}' ; $ pattern [ 'I' ] = '\x{00CC}-\x{00CF}' ; $ pattern [ 'N' ] = '\x{00D1}...
Accents replacement .
6,412
public static function tidyUrl ( $ string , $ bKeepSlashes = true , $ bKeepSpaces = false ) { $ string = strip_tags ( $ string ) ; $ string = str_replace ( [ '?' , '&' , '#' , '=' , '+' , '<' , '>' , '"' , '%' ] , '' , $ string ) ; $ string = str_replace ( "'" , ' ' , $ string ) ; $ string = preg_replace ( '/[\s]+/u' ,...
URL cleanup .
6,413
public static function init ( $ config , $ collectionConfig = array ( ) ) { $ first = null ; static :: $ collectionConfig = $ collectionConfig ; if ( empty ( $ config ) ) { return ; } foreach ( $ config as $ key => $ value ) { $ value [ 'name' ] = $ key ; if ( ! isset ( $ value [ 'driver' ] ) ) { throw new Exception ( ...
Initialize framework from configuration . First connection registered from config will be the default connection .
6,414
public static function options ( $ key , $ value = ':get:' ) { if ( is_array ( $ key ) ) { foreach ( $ key as $ k => $ v ) { static :: $ options ( $ k , $ v ) ; } return ; } if ( $ value === ':get:' ) { return isset ( static :: $ options [ $ key ] ) ? static :: $ options [ $ key ] : null ; } static :: $ options [ $ key...
Get the option of Norm configuration .
6,415
public static function createCollection ( $ options ) { $ defaultConfig = isset ( static :: $ collectionConfig [ 'default' ] ) ? static :: $ collectionConfig [ 'default' ] : array ( ) ; $ config = null ; if ( isset ( static :: $ collectionConfig [ 'mapping' ] [ $ options [ 'name' ] ] ) ) { $ config = static :: $ collec...
Create collection by configuration .
6,416
public static function getConnection ( $ connectionName = '' ) { if ( ! $ connectionName ) { $ connectionName = static :: $ defaultConnection ; } if ( isset ( static :: $ connections [ $ connectionName ] ) ) { return static :: $ connections [ $ connectionName ] ; } }
Get connection by its connection name if no connection name provided then the function will return default connection .
6,417
public static function ensureArrayKeys ( $ key ) { if ( empty ( $ key ) ) { return array ( ) ; } if ( ! is_array ( $ key ) ) { if ( strstr ( $ key , '|' ) ) { $ key = str_replace ( '|' , self :: ARRAY_DELIMITER , $ key ) ; } $ key = explode ( self :: ARRAY_DELIMITER , $ key ) ; } return $ key ; }
Converts string keys to array keys .
6,418
public static function flattenData ( array $ data , $ prefix = NULL , $ label = array ( ) ) { $ flattened_data = array ( ) ; if ( isset ( $ data [ '#label' ] ) ) { $ label [ ] = $ data [ '#label' ] ; } if ( ! empty ( $ data [ '#text' ] ) ) { $ flattened_data [ $ prefix ] = $ data ; $ flattened_data [ $ prefix ] [ '#par...
Converts a nested data array into a flattened structure with a combined key .
6,419
public static function unflattenData ( $ flattened_data ) { $ data = array ( ) ; foreach ( $ flattened_data as $ key => $ flattened_data_entry ) { self :: arraySetNestedValue ( $ data , explode ( self :: ARRAY_DELIMITER , $ key ) , $ flattened_data_entry ) ; } return $ data ; }
Converts a flattened data structure into a nested array .
6,420
public static function elementChildren ( $ elements ) { $ children = array ( ) ; foreach ( $ elements as $ key => $ value ) { if ( $ key === '' || $ key [ 0 ] !== '#' ) { $ children [ $ key ] = $ value ; } } return array_keys ( $ children ) ; }
Identifies the children of an element array .
6,421
public static function evaluate ( $ number , array $ rules ) { $ rules = self :: compile ( $ rules ) ; return self :: evaluateCompiled ( $ number , $ rules ) ; }
Evaluate a number against a set of plural rules . If a rule passes return the index of plural rule .
6,422
public static function compile ( array $ rules ) { foreach ( $ rules as & $ rule ) { $ rule = Converter :: convert ( $ rule ) ; } return $ rules ; }
Convert a set of rules to a compiled form which is optimised for fast evaluation . The result will be an array of strings and may be cached .
6,423
private static function doOperation ( $ token , $ left , $ right ) { if ( in_array ( $ token , [ 'in' , 'not-in' , 'within' , 'not-within' ] ) ) { if ( ! $ right instanceof Range ) { $ right = new Range ( $ right ) ; } } switch ( $ token ) { case 'or' : return $ left || $ right ; case 'and' : return $ left && $ right ;...
Do a single operation
6,424
public function setForm ( $ form ) { $ this -> honeypot -> setForm ( $ form ) ; $ this -> timestamp -> setForm ( $ form ) ; return parent :: setForm ( $ form ) ; }
Defines the form instance for the receiver .
6,425
public function Field ( $ properties = [ ] ) { Requirements :: customCSS ( '.field.simpleguard { display: none !important; }' ) ; return DBField :: create_field ( 'HTMLFragment' , $ this -> honeypot -> Field ( ) . $ this -> timestamp -> Field ( ) ) ; }
Renders the field for the template .
6,426
public function setValue ( $ value , $ data = null ) { if ( is_array ( $ value ) ) { $ this -> honeypot -> setValue ( isset ( $ value [ 'value' ] ) ? $ value [ 'value' ] : null ) ; $ this -> timestamp -> setValue ( isset ( $ value [ 'timestamp' ] ) ? $ value [ 'timestamp' ] : null ) ; $ this -> value = $ this -> honeyp...
Defines the field value .
6,427
public function validate ( $ validator ) { if ( ! empty ( $ this -> value ) || $ this -> tooSoon ( ) ) { $ validator -> validationError ( $ this -> name , _t ( __CLASS__ . '.VALIDATIONERROR' , 'Sorry, an error has occurred. Please try again later.' ) , 'validation' ) ; return false ; } return true ; }
Answers true if the value is valid for the receiver .
6,428
public function getRequestVars ( $ name , $ primaryKey = self :: PRIMARY_KEY ) { $ name = Str :: low ( Inflector :: singularize ( $ name ) ) ; $ requestIds = ( array ) $ this -> _request -> getData ( $ name ) ; $ action = $ this -> _request -> getData ( 'action' ) ; $ ids = $ this -> _getIds ( $ requestIds , $ primaryK...
Get actual request vars for process .
6,429
public function make ( Table $ table , $ action , array $ ids = [ ] , array $ options = [ ] ) { $ count = count ( $ ids ) ; $ options = $ this -> _getOptions ( $ options , $ count ) ; $ redirectUrl = $ options [ 'redirect' ] ; $ messages = new JSON ( $ options [ 'messages' ] ) ; $ event = EventManager :: trigger ( $ th...
Make process .
6,430
protected function _getDefaultMessages ( $ count ) { $ context = $ this -> _configRead ( 'context' ) ; $ contextPlural = Inflector :: pluralize ( $ context ) ; $ countString = sprintf ( '<strong>%s</strong>' , $ count ) ; return [ 'delete' => __dn ( 'core' , 'One ' . $ context . ' success removed' , '{0} ' . $ contextP...
Setup default action messages .
6,431
protected function _getEventName ( $ action , $ event = self :: EVENT_NAME_BEFORE ) { $ details = [ ] ; if ( $ prefix = $ this -> _request -> getParam ( 'prefix' ) ) { $ details [ ] = ucfirst ( $ prefix ) ; } $ details = Hash :: merge ( $ details , [ 'Controller' , $ this -> _controller -> getName ( ) , $ event . Infle...
Get event name by data .
6,432
protected function _getIds ( array $ ids , $ primaryKey = self :: PRIMARY_KEY ) { $ return = [ ] ; foreach ( $ ids as $ id => $ value ) { if ( is_array ( $ value ) && is_int ( $ id ) && ( int ) $ value [ $ primaryKey ] === 1 ) { $ return [ $ id ] = $ id ; } } return $ return ; }
Get ids by request .
6,433
protected function _getOptions ( array $ options , $ count ) { $ options = Hash :: merge ( $ this -> _config , $ options ) ; return Hash :: merge ( [ 'messages' => $ this -> _getDefaultMessages ( $ count ) ] , $ options ) ; }
Create and merge actual process options .
6,434
protected function _loadBehavior ( Table $ table ) { $ behaviors = $ table -> behaviors ( ) ; if ( ! Arr :: in ( 'Process' , $ behaviors -> loaded ( ) ) ) { $ behaviors -> load ( 'Core.Process' ) ; } }
Load process behavior .
6,435
protected function _process ( $ action , Data $ messages , array $ redirect , array $ ids ) { $ count = count ( $ ids ) ; $ defaultMsg = __dn ( 'core' , 'One record success processed' , '{0} records processed' , $ count , sprintf ( '<strong>%s</strong>' , $ count ) ) ; EventManager :: trigger ( $ this -> _getEventName ...
Controller process .
6,436
public function getQueueMonitor ( ) : ? Monitor { if ( ! $ this -> hasQueueMonitor ( ) ) { $ this -> setQueueMonitor ( $ this -> getDefaultQueueMonitor ( ) ) ; } return $ this -> queueMonitor ; }
Get queue monitor
6,437
public static function add ( $ key , $ item , & $ arr ) { if ( ! is_array ( $ arr ) ) { throw new \ InvalidArgumentException ( 'CCArr::add - second argument has to be an array.' ) ; } if ( ! is_array ( static :: get ( $ key , $ arr ) ) ) { return static :: set ( $ key , array ( $ item ) , $ arr ) ; } return static :: s...
Adds an item to an element in the array
6,438
public static function sum ( $ arr , $ key = null ) { if ( ! is_array ( $ arr ) ) { throw new \ InvalidArgumentException ( 'CCArr::sum - first argument has to be an array.' ) ; } $ sum = 0 ; if ( is_string ( $ key ) && CCArr :: is_multi ( $ arr ) ) { $ arr = CCArr :: pick ( $ key , $ arr ) ; } foreach ( $ arr as $ item...
sum items in an array or use special item in the array
6,439
public static function average ( $ arr , $ key = null ) { if ( ! is_array ( $ arr ) ) { throw new \ InvalidArgumentException ( 'CCArr::average - first argunent has to be an array.' ) ; } if ( is_string ( $ key ) && CCArr :: is_multi ( $ arr ) ) { $ arr = CCArr :: pick ( $ key , $ arr ) ; } return ( static :: sum ( $ ar...
get the average of the items
6,440
public static function object ( $ arr ) { if ( ! is_array ( $ arr ) ) { throw new \ InvalidArgumentException ( "CCArr::object - only arrays can be passed." ) ; } $ object = new \ stdClass ( ) ; if ( ! empty ( $ arr ) ) { foreach ( $ arr as $ name => $ value ) { if ( is_array ( $ value ) ) { $ value = static :: object (...
create an object from an array
6,441
public static function merge ( ) { $ arrs = func_get_args ( ) ; $ return = array ( ) ; foreach ( $ arrs as $ arr ) { if ( ! is_array ( $ arr ) ) { throw new \ InvalidArgumentException ( 'CCArr::merge - all arguments have to be arrays.' ) ; } foreach ( $ arr as $ key => $ value ) { if ( array_key_exists ( $ key , $ retu...
merge arrays recursivly together
6,442
public static function get ( $ key , $ arr , $ default = null ) { if ( isset ( $ arr [ $ key ] ) ) { return $ arr [ $ key ] ; } if ( strpos ( $ key , '.' ) !== false ) { $ kp = explode ( '.' , $ key ) ; switch ( count ( $ kp ) ) { case 2 : if ( isset ( $ arr [ $ kp [ 0 ] ] [ $ kp [ 1 ] ] ) ) { return $ arr [ $ kp [ 0 ]...
return an item from an array with dottet dimensions
6,443
public static function has ( $ key , $ arr ) { if ( isset ( $ arr [ $ key ] ) ) { return true ; } if ( strpos ( $ key , '.' ) !== false ) { $ kp = explode ( '.' , $ key ) ; switch ( count ( $ kp ) ) { case 2 : return isset ( $ arr [ $ kp [ 0 ] ] [ $ kp [ 1 ] ] ) ; break ; case 3 : return isset ( $ arr [ $ kp [ 0 ] ] [ ...
checks if the array has an item with dottet dimensions
6,444
public static function set ( $ key , $ value , & $ arr ) { if ( strpos ( $ key , '.' ) === false ) { $ arr [ $ key ] = $ value ; } else { $ kp = explode ( '.' , $ key ) ; switch ( count ( $ kp ) ) { case 2 : $ arr [ $ kp [ 0 ] ] [ $ kp [ 1 ] ] = $ value ; break ; case 3 : $ arr [ $ kp [ 0 ] ] [ $ kp [ 1 ] ] [ $ kp [ 2 ...
sets an item from an array with dottet dimensions
6,445
public static function delete ( $ key , & $ arr ) { if ( isset ( $ arr [ $ key ] ) ) { unset ( $ arr [ $ key ] ) ; return ; } if ( strpos ( $ key , '.' ) !== false ) { $ kp = explode ( '.' , $ key ) ; switch ( count ( $ kp ) ) { case 2 : unset ( $ arr [ $ kp [ 0 ] ] [ $ kp [ 1 ] ] ) ; return ; break ; case 3 : unset ( ...
deletes an item from an array with dottet dimensions
6,446
public function matchOrderBy ( $ orderByValue , Array $ mappings , Array $ default = array ( ) ) { if ( is_string ( $ orderByValue ) ) { $ orderByValue = array ( $ orderByValue => 'ASC' ) ; } $ orderBy = array ( ) ; if ( is_array ( $ orderByValue ) ) { foreach ( $ orderByValue as $ key => $ sort ) { $ sort = mb_stripos...
Matches a value as it is meant to be a order by value
6,447
public static function set_custom_library ( $ name , $ custom_class ) { if ( class_exists ( '\\alsvanzelf\\fem\\' . $ name ) == false ) { throw new exception ( 'library does not exist in fem' ) ; } self :: $ custom_libraries [ $ name ] = $ custom_class ; }
set a custom library for usage by other fem libraries use this when extending a fem library without this fem will call the non - extended library in its own calls
6,448
public static function get_library ( $ name ) { if ( class_exists ( '\\alsvanzelf\\fem\\' . $ name ) == false ) { throw new exception ( 'library does not exist in fem' ) ; } if ( isset ( self :: $ custom_libraries [ $ name ] ) ) { return self :: $ custom_libraries [ $ name ] ; } return '\\alsvanzelf\\fem\\' . $ name ; ...
get the class name which should be used for a certain fem library used internally to determine whether a custom library has been set returns the fem class name if no custom library is set
6,449
private static function environment ( ) { $ environment = getenv ( 'APP_ENV' ) ? : 'production' ; define ( 'alsvanzelf\fem\ENVIRONMENT' , $ environment ) ; define ( 'alsvanzelf\fem\ROOT_DIR' , realpath ( __DIR__ . '/../../../../' ) . '/' ) ; define ( 'alsvanzelf\fem\ROOT_DIR_APP' , \ alsvanzelf \ fem \ ROOT_DIR . 'appl...
environmental check defines environment and root dir
6,450
private static function uncertain ( ) { ini_set ( 'display_startup_errors' , 0 ) ; ini_set ( 'display_errors' , 0 ) ; error_reporting ( 0 ) ; if ( \ alsvanzelf \ fem \ ENVIRONMENT == 'development' ) { ini_set ( 'display_startup_errors' , 1 ) ; ini_set ( 'display_errors' , 1 ) ; error_reporting ( - 1 ) ; } $ error_handl...
error handling know when to say what depending on environment and passes errors to exceptions
6,451
private static function secure ( ) { if ( \ alsvanzelf \ fem \ CLI ) { return ; } header_remove ( 'X-Powered-By' ) ; ini_set ( 'session.use_trans_sid' , 0 ) ; ini_set ( 'session.use_only_cookies' , 1 ) ; ini_set ( 'session.cookie_httponly' , 1 ) ; ini_set ( 'session.use_strict_mode' , 1 ) ; ini_set ( 'session.entropy_f...
basic security stops outputting of php header and help against session fixation
6,452
private function warnInsecureSettings ( ) : void { if ( ! self :: $ warnInsecureSettings ) { return ; } if ( ! ini_get ( 'session.use_cookies' ) ) { $ errorMessage = 'The ini setting session.use_cookies should be set to true.' ; throw new InsecureSettingsException ( $ errorMessage ) ; } if ( ! ini_get ( 'session.use_on...
Throws exceptions when insecure INI settings are detected .
6,453
private function handleStrict ( ) : void { if ( ! ini_get ( 'session.use_strict_mode' ) || headers_sent ( ) ) { return ; } $ cookieName = session_name ( ) ; if ( empty ( $ _COOKIE [ $ cookieName ] ) ) { return ; } $ sessionId = $ _COOKIE [ $ cookieName ] ; $ identifier = $ this -> cryptProvider -> makeSessionIdentifier...
Rejects arbitrary session ids .
6,454
public function open ( $ savePath , $ sessionName ) : bool { $ sessionId = session_id ( ) ; $ identifier = $ this -> cryptProvider -> makeSessionIdentifier ( $ sessionId ) ; while ( ! $ this -> storageDriver -> lock ( $ identifier ) ) { usleep ( 1000 ) ; } return true ; }
Opens the session .
6,455
public function close ( ) : bool { $ sessionId = session_id ( ) ; $ identifier = $ this -> cryptProvider -> makeSessionIdentifier ( $ sessionId ) ; $ this -> storageDriver -> unlock ( $ identifier ) ; return true ; }
Closes the session
6,456
public function write ( $ sessionId , $ sessionData ) : bool { $ identifier = $ this -> cryptProvider -> makeSessionIdentifier ( $ sessionId ) ; $ content = $ this -> cryptProvider -> encryptSessionData ( $ sessionId , $ sessionData ) ; try { $ this -> storageDriver -> save ( $ identifier , $ content ) ; return true ; ...
Encrypts the session data and saves to the storage ;
6,457
public function gc ( $ maxLife ) : bool { try { $ this -> storageDriver -> clearOld ( $ maxLife * 1000000 ) ; return true ; } catch ( Exception $ e ) { return false ; } }
Removes the expired sessions from the storage .
6,458
public function setCustomer ( Customer $ v = null ) { if ( $ v === null ) { $ this -> setCustomerId ( NULL ) ; } else { $ this -> setCustomerId ( $ v -> getId ( ) ) ; } $ this -> aCustomer = $ v ; if ( $ v !== null ) { $ v -> addUserCustomerRelation ( $ this ) ; } return $ this ; }
Declares an association between this object and a Customer object .
6,459
public function getCustomer ( PropelPDO $ con = null , $ doQuery = true ) { if ( $ this -> aCustomer === null && ( $ this -> customer_id !== null ) && $ doQuery ) { $ this -> aCustomer = CustomerQuery :: create ( ) -> findPk ( $ this -> customer_id , $ con ) ; } return $ this -> aCustomer ; }
Get the associated Customer object
6,460
public static function create ( $ install = true ) { $ instance = new PcntlSignals ( ) ; if ( $ install ) { $ instance -> install ( self :: getDefaultInstalledSignals ( ) ) ; } return $ instance ; }
Factory method can install default signals .
6,461
public function install ( array $ signals ) { if ( self :: isSupported ( ) ) { $ callback = [ $ this , 'dispatchSignal' ] ; foreach ( $ signals as $ signal ) { \ pcntl_signal ( $ signal , $ callback ) ; } } ; }
Installs selected signal
6,462
public function handle ( $ signal , $ handler , $ namespace = self :: DEFAULT_NAMESPACE ) { if ( empty ( $ this -> handlers [ $ signal ] ) ) { $ this -> handlers [ $ signal ] = [ ] ; } if ( empty ( $ this -> handlers [ $ signal ] [ $ namespace ] ) ) { $ this -> handlers [ $ signal ] [ $ namespace ] = [ ] ; } $ this -> ...
Registers handler for signal in selected namespace .
6,463
public function dispatchSignal ( $ signal ) { if ( isset ( $ this -> handlers [ $ signal ] ) ) { foreach ( $ this -> handlers [ $ signal ] as $ namespaceHandlers ) { foreach ( $ namespaceHandlers as $ handler ) { $ handler ( ) ; } } } return $ this ; }
Dispatch signal on registered handlers .
6,464
public function batchInsert ( \ Phalcon \ Db \ Adapter $ connection , $ tableName , $ fields ) { $ migrationData = $ this -> migrationsDir . '/' . $ this -> version . '/' . $ tableName . '.dat' ; if ( file_exists ( $ migrationData ) ) { $ connection -> begin ( ) ; $ batchHandler = fopen ( $ migrationData , 'r' ) ; whil...
Inserts data from a data migration file in a table
6,465
public function create ( $ videoKey , $ watermarkConfiguration , $ timeout = 90000 ) { $ this -> validateVideoKey ( $ videoKey ) ; $ this -> validateWatermarkConfiguration ( $ watermarkConfiguration ) ; $ this -> validateTimeout ( $ timeout ) ; $ config = is_array ( $ watermarkConfiguration ) ? $ watermarkConfiguration...
Watermarks a video
6,466
protected function createSheet ( $ name ) { $ name = \ Psc \ PHPExcel \ Helper :: sanitizeSheetTitle ( $ name ) ; $ this -> excel -> addSheet ( new PHPExcel_Worksheet ( $ this -> excel , $ name ) ) ; $ this -> excel -> setActiveSheetIndexByName ( $ name ) ; $ this -> sheet = $ this -> excel -> getActiveSheet ( ) ; $ th...
Setzt this - > sheet auf das gerade erstellte Sheet und die Row auf Zeile 1
6,467
public function addTable ( $ tableName , $ csvFile ) { if ( ! is_file ( $ csvFile ) ) { throw new \ InvalidArgumentException ( "Could not find csv file: {$csvFile}" ) ; } if ( ! is_readable ( $ csvFile ) ) { throw new \ InvalidArgumentException ( "Could not read csv file: {$csvFile}" ) ; } $ fh = fopen ( $ csvFile , 'r...
Adds a table to the dataset
6,468
public function renderClearing ( ) { if ( empty ( $ this -> items ) ) { return true ; } $ list = array ( ) ; foreach ( $ this -> items as $ item ) { $ list [ ] = $ this -> renderItem ( $ item ) ; } return \ CHtml :: tag ( 'ul' , $ this -> htmlOptions , implode ( "\n" , $ list ) ) ; }
Renders the clearing widget
6,469
public static function isValidMarkup ( $ html , $ message = '' , ConnectorInterface $ connector = null ) { if ( empty ( $ html ) || ! is_string ( $ html ) ) { throw \ PHPUnit_Util_InvalidArgumentHelper :: factory ( 1 , 'string' ) ; } if ( $ connector === null ) { $ connector = new HTML5ValidatorNuConnector ( ) ; } $ co...
Asserts that the HTML5 string is valid .
6,470
public static function isValidFile ( $ path , $ message = '' , ConnectorInterface $ connector = null ) { if ( ! file_exists ( $ path ) ) { throw new \ PHPUnit_Framework_Exception ( sprintf ( 'File "%s" does not exist.' . "\n" , $ path ) ) ; } $ html = file_get_contents ( $ path ) ; if ( $ html === false ) { throw new \...
Asserts that the HTML5 file is valid .
6,471
public static function isValidURL ( $ url , $ message = '' , ConnectorInterface $ connector = null ) { if ( empty ( $ url ) || ! is_string ( $ url ) ) { throw \ PHPUnit_Util_InvalidArgumentHelper :: factory ( 1 , 'string' ) ; } if ( filter_var ( $ url , FILTER_VALIDATE_URL ) === false ) { throw new \ PHPUnit_Framework_...
Asserts that the HTML5 url is valid .
6,472
public static function create ( $ modelAlias = null , $ criteria = null ) { if ( $ criteria instanceof RemoteAppQuery ) { return $ criteria ; } $ query = new RemoteAppQuery ( null , null , $ modelAlias ) ; if ( $ criteria instanceof Criteria ) { $ query -> mergeWith ( $ criteria ) ; } return $ query ; }
Returns a new RemoteAppQuery object .
6,473
protected function findPkComplex ( $ key , $ con ) { $ criteria = $ this -> isKeepQuery ( ) ? clone $ this : $ this ; $ stmt = $ criteria -> filterByPrimaryKey ( $ key ) -> doSelect ( $ con ) ; return $ criteria -> getFormatter ( ) -> init ( $ criteria ) -> formatOne ( $ stmt ) ; }
Find object by primary key .
6,474
public function filterByApiUrl ( $ apiUrl = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ apiUrl ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ apiUrl ) ) { $ apiUrl = str_replace ( '*' , '%' , $ apiUrl ) ; $ comparison = Criteria :: LIKE ; } } return $ th...
Filter the query on the api_url column
6,475
public function filterByApiAuthHttpUser ( $ apiAuthHttpUser = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ apiAuthHttpUser ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ apiAuthHttpUser ) ) { $ apiAuthHttpUser = str_replace ( '*' , '%' , $ apiAuthHttpUser...
Filter the query on the api_auth_http_user column
6,476
public function filterByApiAuthHttpPassword ( $ apiAuthHttpPassword = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ apiAuthHttpPassword ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ apiAuthHttpPassword ) ) { $ apiAuthHttpPassword = str_replace ( '*' , '%'...
Filter the query on the api_auth_http_password column
6,477
public function filterByApiAuthType ( $ apiAuthType = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ apiAuthType ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ apiAuthType ) ) { $ apiAuthType = str_replace ( '*' , '%' , $ apiAuthType ) ; $ comparison = Crit...
Filter the query on the api_auth_type column
6,478
public function filterByApiAuthUser ( $ apiAuthUser = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ apiAuthUser ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ apiAuthUser ) ) { $ apiAuthUser = str_replace ( '*' , '%' , $ apiAuthUser ) ; $ comparison = Crit...
Filter the query on the api_auth_user column
6,479
public function filterByApiAuthPassword ( $ apiAuthPassword = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ apiAuthPassword ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ apiAuthPassword ) ) { $ apiAuthPassword = str_replace ( '*' , '%' , $ apiAuthPassword...
Filter the query on the api_auth_password column
6,480
public function filterByApiAuthToken ( $ apiAuthToken = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ apiAuthToken ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ apiAuthToken ) ) { $ apiAuthToken = str_replace ( '*' , '%' , $ apiAuthToken ) ; $ comparison ...
Filter the query on the api_auth_token column
6,481
public function filterByApiAuthUrlUserKey ( $ apiAuthUrlUserKey = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ apiAuthUrlUserKey ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ apiAuthUrlUserKey ) ) { $ apiAuthUrlUserKey = str_replace ( '*' , '%' , $ apiAu...
Filter the query on the api_auth_url_user_key column
6,482
public function filterByApiAuthUrlPwKey ( $ apiAuthUrlPwKey = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ apiAuthUrlPwKey ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ apiAuthUrlPwKey ) ) { $ apiAuthUrlPwKey = str_replace ( '*' , '%' , $ apiAuthUrlPwKey...
Filter the query on the api_auth_url_pw_key column
6,483
public function filterByCron ( $ cron = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ cron ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ cron ) ) { $ cron = str_replace ( '*' , '%' , $ cron ) ; $ comparison = Criteria :: LIKE ; } } return $ this -> addUsi...
Filter the query on the cron column
6,484
public function filterByCustomerId ( $ customerId = null , $ comparison = null ) { if ( is_array ( $ customerId ) ) { $ useMinMax = false ; if ( isset ( $ customerId [ 'min' ] ) ) { $ this -> addUsingAlias ( RemoteAppPeer :: CUSTOMER_ID , $ customerId [ 'min' ] , Criteria :: GREATER_EQUAL ) ; $ useMinMax = true ; } if ...
Filter the query on the customer_id column
6,485
public function filterByLastRun ( $ lastRun = null , $ comparison = null ) { if ( is_array ( $ lastRun ) ) { $ useMinMax = false ; if ( isset ( $ lastRun [ 'min' ] ) ) { $ this -> addUsingAlias ( RemoteAppPeer :: LAST_RUN , $ lastRun [ 'min' ] , Criteria :: GREATER_EQUAL ) ; $ useMinMax = true ; } if ( isset ( $ lastRu...
Filter the query on the last_run column
6,486
public function filterByIncludelog ( $ includelog = null , $ comparison = null ) { if ( is_string ( $ includelog ) ) { $ includelog = in_array ( strtolower ( $ includelog ) , array ( 'false' , 'off' , '-' , 'no' , 'n' , '0' , '' ) ) ? false : true ; } return $ this -> addUsingAlias ( RemoteAppPeer :: INCLUDELOG , $ inc...
Filter the query on the includeLog column
6,487
public function filterByPublicKey ( $ publicKey = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ publicKey ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ publicKey ) ) { $ publicKey = str_replace ( '*' , '%' , $ publicKey ) ; $ comparison = Criteria :: LIKE...
Filter the query on the public_key column
6,488
public function filterByWebsiteHash ( $ websiteHash = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ websiteHash ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ websiteHash ) ) { $ websiteHash = str_replace ( '*' , '%' , $ websiteHash ) ; $ comparison = Crit...
Filter the query on the website_hash column
6,489
public function filterByNotificationRecipient ( $ notificationRecipient = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ notificationRecipient ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ notificationRecipient ) ) { $ notificationRecipient = str_replace (...
Filter the query on the notification_recipient column
6,490
public function filterByNotificationSender ( $ notificationSender = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ notificationSender ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ notificationSender ) ) { $ notificationSender = str_replace ( '*' , '%' , $ ...
Filter the query on the notification_sender column
6,491
public function filterByNotificationChange ( $ notificationChange = null , $ comparison = null ) { if ( is_string ( $ notificationChange ) ) { $ notificationChange = in_array ( strtolower ( $ notificationChange ) , array ( 'false' , 'off' , '-' , 'no' , 'n' , '0' , '' ) ) ? false : true ; } return $ this -> addUsingAli...
Filter the query on the notification_change column
6,492
public function filterByNotificationError ( $ notificationError = null , $ comparison = null ) { if ( is_string ( $ notificationError ) ) { $ notificationError = in_array ( strtolower ( $ notificationError ) , array ( 'false' , 'off' , '-' , 'no' , 'n' , '0' , '' ) ) ? false : true ; } return $ this -> addUsingAlias ( ...
Filter the query on the notification_error column
6,493
public function filterByApiLog ( $ apiLog , $ comparison = null ) { if ( $ apiLog instanceof ApiLog ) { return $ this -> addUsingAlias ( RemoteAppPeer :: ID , $ apiLog -> getRemoteAppId ( ) , $ comparison ) ; } elseif ( $ apiLog instanceof PropelObjectCollection ) { return $ this -> useApiLogQuery ( ) -> filterByPrimar...
Filter the query by a related ApiLog object
6,494
public function useApiLogQuery ( $ relationAlias = null , $ joinType = Criteria :: INNER_JOIN ) { return $ this -> joinApiLog ( $ relationAlias , $ joinType ) -> useQuery ( $ relationAlias ? $ relationAlias : 'ApiLog' , '\Slashworks\AppBundle\Model\ApiLogQuery' ) ; }
Use the ApiLog relation ApiLog object
6,495
public function filterByRemoteHistoryContao ( $ remoteHistoryContao , $ comparison = null ) { if ( $ remoteHistoryContao instanceof RemoteHistoryContao ) { return $ this -> addUsingAlias ( RemoteAppPeer :: ID , $ remoteHistoryContao -> getRemoteAppId ( ) , $ comparison ) ; } elseif ( $ remoteHistoryContao instanceof Pr...
Filter the query by a related RemoteHistoryContao object
6,496
public function useRemoteHistoryContaoQuery ( $ relationAlias = null , $ joinType = Criteria :: INNER_JOIN ) { return $ this -> joinRemoteHistoryContao ( $ relationAlias , $ joinType ) -> useQuery ( $ relationAlias ? $ relationAlias : 'RemoteHistoryContao' , '\Slashworks\AppBundle\Model\RemoteHistoryContaoQuery' ) ; }
Use the RemoteHistoryContao relation RemoteHistoryContao object
6,497
public function getFormField ( $ name = null , $ title = null , $ value = null ) { return SimpleSpamGuardField :: create ( $ name , $ title , $ value ) -> setTimeLimit ( $ this -> timeLimit ) ; }
Answers the form field used for implementing the spam guard .
6,498
protected function doConvert ( ) { $ expectOperator = true ; while ( false !== ( $ token = $ this -> nextToken ( ) ) ) { $ expectOperator = ! $ expectOperator ; if ( $ token instanceof Expression ) { if ( $ expectOperator ) { $ token -> error ( 'unexpected operand' ) ; } $ this -> operands [ ] = $ token ; continue ; } ...
Do the operation .
6,499
protected function write ( $ destination , $ content ) { $ directory = dirname ( $ destination ) ; if ( ! $ this -> files -> exists ( $ directory ) ) { $ this -> files -> makeDirectory ( $ directory , 0755 , true ) ; } return ( bool ) $ this -> files -> put ( $ destination , $ content ) ; }
Write file contents creating any necessary subdirectories .