idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
58,400
public function deleteWith ( \ Zend \ Db \ Sql \ Delete $ delete ) { return $ this -> tableGateway -> deleteWith ( $ delete ) ; }
Delete request .
58,401
public function insertWith ( \ Zend \ Db \ Sql \ Insert $ insert ) { return $ this -> tableGateway -> insertWith ( $ insert ) ; }
Insert request .
58,402
public function updateWith ( \ Zend \ Db \ Sql \ Update $ update ) { return $ this -> tableGateway -> updateWith ( $ update ) ; }
Update request .
58,403
public function fetchRow ( $ column , $ value ) { $ where = array ( $ column , $ value ) ; return $ this -> tableGateway -> select ( $ where ) -> current ( ) ; }
Get row .
58,404
public function delete ( AbstractModel $ model ) { $ array = $ model -> toArrayCurrent ( ) ; if ( empty ( $ array ) ) { throw new \ Exception ( 'Error : delete used an empty model' ) ; } return $ this -> tableGateway -> delete ( $ array ) ; }
Delete full modele .
58,405
public function usePaginator ( $ options ) { if ( $ options === null ) { $ this -> usePaginator = false ; return $ this ; } $ this -> usePaginator = true ; $ this -> paginatorOptions [ 's' ] = ( isset ( $ options [ 's' ] ) ) ? $ options [ 's' ] : null ; $ this -> paginatorOptions [ 'd' ] = ( isset ( $ options [ 'd' ] )...
Set the mapper options and enable the mapper .
58,406
protected function initPaginator ( $ select ) { $ this -> usePaginator = false ; $ this -> paginator = new Paginator ( $ select , $ this -> tableGateway -> getAdapter ( ) , $ this -> tableGateway -> getResultSetPrototype ( ) ) ; if ( isset ( $ this -> paginatorOptions [ 'n' ] ) ) { $ this -> paginator -> setN ( $ this ...
Init the paginator with a select object .
58,407
public function printSql ( \ Zend \ Db \ Sql \ SqlInterface $ request ) { return $ request -> getSqlString ( $ this -> tableGateway -> getAdapter ( ) -> getPlatform ( ) ) ; }
Return request sql .
58,408
public function register ( $ namespace , $ includePath ) { if ( array_key_exists ( $ namespace , $ this -> includePaths ) ) { throw new \ Exception ( "Error: Namespace '$namespace' is already registered!" ) ; } $ this -> includePaths [ $ namespace ] = rtrim ( $ includePath , DS ) . DS ; }
Register a determinated namespace and its include path to find it .
58,409
public function registerClass ( $ className , $ includeFile ) { if ( array_key_exists ( $ className , $ this -> includePaths ) ) { throw new \ Exception ( "Error: Class '$className' is already registered!" ) ; } $ this -> includePaths [ $ className ] = $ includeFile ; }
Register a determinated class to autoloader
58,410
protected function createFolders ( ) { foreach ( $ this -> getFolderStructure ( ) as $ folder ) { $ newFolder = $ this -> twigStringRenderer -> renderToString ( $ folder , $ this -> data ) ; $ this -> fs -> mkdir ( $ this -> targetPath . DIRECTORY_SEPARATOR . $ newFolder , self :: DIRECTORY_MODE ) ; $ msg = '[mkdir] ' ...
Creates all folders specified by getFolderStructure within the target location .
58,411
protected function copyFiles ( ) { $ skeletonFinder = new SkeletonFinder ( $ this -> lookupPaths ) ; $ sourcePath = $ skeletonFinder -> findByName ( $ this -> skeletonName ) -> getRealpath ( ) ; $ finder = $ this -> getFinderForFilesToCopy ( $ sourcePath ) ; foreach ( $ finder as $ file ) { $ targetFilePath = $ this ->...
Copies all files from the source location to the target location .
58,412
protected function renderTemplates ( ) { $ finder = new Finder ; $ finder -> files ( ) -> name ( '*' . self :: TEMPLATE_FILENAME_EXTENSION ) -> in ( $ this -> targetPath ) ; $ twigRenderer = TwigRenderer :: create ( [ 'twig_extensions' => [ new ProjectExtension ( $ this -> configProvider ) ] , 'twig_options' => [ 'auto...
Renders all files within the target location whose extension is . tmpl . twig onto a file that has the same name without that extension . After the rendering all the . tmpl . twig files will be deleted in the target location .
58,413
public static function end ( $ edition , $ used , $ start , $ timeNow ) { if ( ! $ used ) { return 0 ; } $ end = $ edition / ( $ used / ( $ timeNow - $ start ) ) ; $ end += $ timeNow ; return $ end ; }
Estimate time to end by given current usage value and max value
58,414
public function getValue ( ) { $ val = $ this -> base [ 'value' ] ; if ( is_array ( $ val ) ) { if ( isset ( $ val [ 'ID' ] ) ) { return $ this -> authorFactory -> create ( $ val [ 'ID' ] ) ; } else { $ authors = array ( ) ; foreach ( $ val as $ a ) { $ authors [ ] = $ this -> authorFactory -> create ( $ a [ 'ID' ] ) ;...
Get a single author object or array of author objects .
58,415
public static function applyformatToText ( ) { $ args = func_get_args ( ) ; $ count = func_num_args ( ) ; $ text = $ args [ $ count - 1 ] ; if ( $ count == 1 ) { return $ text ; } $ mode_texts = array_slice ( $ args , 0 , $ count - 1 ) ; return self :: buildEscapeCodes ( $ mode_texts ) . $ text . self :: buildEscapeCod...
Applies one or more console formatting codes to text
58,416
protected static function buildEscapeCodes ( $ mode_texts ) { if ( ! is_array ( $ mode_texts ) ) { $ mode_texts = array ( $ mode_texts ) ; } $ code_text = '' ; foreach ( $ mode_texts as $ mode ) { $ constant_name = 'self::CONSOLE_' . strtoupper ( $ mode ) ; if ( defined ( $ constant_name ) ) { $ code_text .= ( strlen (...
builds ANSI escape codes
58,417
public function getParameter ( $ key ) { if ( isset ( $ this -> queryParts [ $ key ] ) ) { return $ this -> queryParts [ $ key ] ; } else { return false ; } }
getParameter function .
58,418
private function getPathForTreeGenerator ( $ pathKey , $ path ) { if ( is_array ( $ path ) && array_key_exists ( 'type' , $ path ) && array_key_exists ( 'path' , $ path ) ) { return $ path ; } if ( ! Str :: contains ( $ pathKey , ']' ) ) { throw new InvalidArgumentException ( 'Missing key options. Supplied key was ' . ...
Converts the key and path into an array that various tree generators expect .
58,419
public function create ( $ exclude = array ( ) , $ cache = FALSE ) { if ( $ cache === FALSE || ! ( $ this -> memcached instanceof \ Memcached ) ) { return parent :: create ( $ exclude ) ; } $ parent = parent :: create ( $ exclude ) ; if ( $ parent === FALSE ) { return FALSE ; } $ this -> memcached -> set ( $ this -> ge...
Create object in the database and set in memcached
58,420
public function read ( $ pkValue = FALSE , $ cache = FALSE ) { if ( $ cache === FALSE || ! ( $ this -> memcached instanceof \ Memcached ) ) { return parent :: read ( $ pkValue ) ; } if ( $ pkValue !== FALSE ) { $ this -> iset ( static :: $ pk , $ pkValue ) ; } $ obj = $ this -> memcached -> get ( $ this -> getMemcached...
Read an object from memcached if it exists otherwise load the object from the database and then cache it
58,421
public function delete ( $ pkValue = FALSE ) { if ( $ pkValue === FALSE ) { $ pkValue = $ this -> iget ( static :: $ pk ) ; } $ parent = parent :: delete ( $ pkValue ) ; if ( $ parent === FALSE ) { return FALSE ; } if ( $ this -> memcached instanceof \ Memcached ) { $ this -> memcached -> delete ( static :: _getMemcach...
Delete an object in the database and memcached
58,422
private function getCacheAttributes ( ) { $ attributes = array ( ) ; foreach ( array_keys ( self :: $ attributes ) as $ name ) { $ attributes [ $ name ] = $ this -> iget ( $ name ) ; } return $ attributes ; }
Return object attributes to cache
58,423
private function setCacheAttributes ( $ arr ) { foreach ( $ arr as $ name => $ val ) { $ this -> iset ( $ name , $ val , FALSE ) ; } }
Set object attributes from cache
58,424
public function getCollection ( $ name ) { $ name = strtolower ( $ name ) ; if ( $ this -> collections -> containsKey ( $ name ) ) { return $ this -> collections -> get ( $ name ) ; } $ this -> collections -> set ( $ name , $ this -> createCollection ( $ name ) ) ; return $ this -> collections -> get ( $ name ) ; }
Gets a Collection by name
58,425
public function all ( ) { $ results = [ ] ; foreach ( $ this -> collections as $ collection ) { $ results [ ] = array_merge ( [ 'name' => $ collection -> name ] , $ collection -> info ( ) ) ; } return $ results ; }
Lists the available Collections by name
58,426
public function drop ( $ collection ) { if ( ! $ this -> collections -> containsKey ( $ collection ) ) { return false ; } $ this -> collections -> get ( $ collection ) -> drop ( ) ; $ this -> collections -> remove ( $ collection ) ; return true ; }
Drops a Collection - removing all data
58,427
private function loadCollections ( ) { $ collections = new ArrayCollection ( ) ; $ finder = new Finder ( ) ; $ finder -> files ( ) -> name ( '*.dat' ) -> in ( $ this -> filepath ) ; foreach ( $ finder as $ file ) { $ name = $ file -> getBasename ( '.dat' ) ; $ collections -> set ( $ name , $ this -> createCollection ( ...
Loads the collections for the Database
58,428
public function collectXmlMetadata ( array $ metadataCollection ) : array { if ( file_exists ( $ this -> configPath ) ) { $ xmlConfigurator = new XmlResolver ( new CollectionClassResolver ( [ Scope :: class , Name :: class , ClassName :: class , \ samsonframework \ containercollection \ attribute \ Service :: class ] )...
Get xml metadata collection
58,429
public function getDefaultPropertyValue ( $ className , $ propertyName ) { $ reflection = new \ ReflectionClass ( $ className ) ; $ values = $ reflection -> getDefaultProperties ( ) ; return $ values [ $ propertyName ] ?? null ; }
Get default property value by property name
58,430
public function createMetadata ( $ class , $ name , $ path , $ scope = 'module' ) : ClassMetadata { $ metadata = new ClassMetadata ( ) ; $ class = ltrim ( $ class , '\\' ) ; $ name = strtolower ( ltrim ( $ name , '\\' ) ) ; $ metadata -> className = $ class ; $ metadata -> name = str_replace ( [ '\\' , '/' ] , '_' , $ ...
Create metadata for module
58,431
public function collectAnnotationMetadata ( $ classes , $ metadataCollection ) { new Injectable ( ) ; new InjectArgument ( [ 'var' => 'type' ] ) ; new Service ( [ 'value' => '' ] ) ; $ reader = new AnnotationReader ( ) ; $ resolver = new AnnotationResolver ( new AnnotationClassResolver ( $ reader ) , new AnnotationProp...
Get annotation metadata
58,432
public function getRenderer ( ) { $ config = new Config ( $ this -> configDirectory ) ; $ rendererClass = $ config -> getRenderer ( ) ; $ reflection = new ReflectionClass ( $ rendererClass ) ; if ( false === $ reflection -> implementsInterface ( 'Signalert\Renderer\RendererInterface' ) ) { throw new SignalertResolverEx...
Returns a valid renderer class
58,433
public function getDriver ( ) { $ config = new Config ( $ this -> configDirectory ) ; $ driverClass = $ config -> getDriver ( ) ; $ reflection = new ReflectionClass ( $ driverClass ) ; if ( false === $ reflection -> implementsInterface ( 'Signalert\Storage\DriverInterface' ) ) { throw new SignalertResolverException ; }...
Returns a valid driver class
58,434
public function activateAction ( ) { $ object = $ this -> getObject ( ) ; if ( method_exists ( $ object , 'setActive' ) && method_exists ( $ object , 'getActive' ) ) { $ object -> setActive ( ( $ object -> getActive ( ) == 1 ) ? 0 : 1 ) ; } $ this -> admin -> update ( $ object ) ; return new RedirectResponse ( $ this -...
Activate or inactivate the object
58,435
public function assertIsArray ( $ value , $ message = '%s must be an Array' , $ exception = 'Asserts' ) { if ( isset ( $ value ) === false || is_array ( $ value ) === false ) { $ this -> throwException ( $ exception , $ message , $ value ) ; } }
Verifies that the specified condition is array . The assertion fails if the condition is not array .
58,436
public function make ( ICategory $ category ) { $ category -> setResponse ( $ this -> response -> view ( \ OogleeBConfig :: get ( 'config.category_view.view' ) , compact ( 'category' ) ) ) ; }
Make the category response .
58,437
public function addAction ( $ action ) { if ( $ action instanceof Action ) { $ action = $ action -> getName ( ) ; } $ this -> actionList [ ] = $ action ; $ this -> valid = null ; return $ this ; }
Adds a action name to the list of actions the worker listens to .
58,438
public function getFormattedImage ( $ format ) { $ formatName = $ format instanceof FormatInterface ? $ format -> getName ( ) : $ format ; return $ this -> formattedImages -> filter ( function ( FormattedImageInterface $ formattedImage ) use ( $ formatName ) { return ( $ format = $ formattedImage -> getFormat ( ) ) && ...
Returns image formatted for given format name or FormatInterface object .
58,439
public function getFormatWebPath ( $ format = null ) { if ( ! $ format = $ format ? : $ this -> defaultFormat ) { return $ this -> getWebPath ( ) ; } return ( $ formattedImage = $ this -> getFormattedImage ( $ format ) ) ? $ formattedImage -> getWebPath ( ) : $ this -> getWebPath ( ) ; }
Returns requested format web path or original one if format doesnt exists .
58,440
public function getArea ( ) : float { $ event = new MeasurementOpEvent ( $ this ) ; $ this -> fireOperationEvent ( MeasurementOpEvent :: AREA_EVENT , $ event ) ; return $ event -> getResults ( ) ; }
Gets the area of this MultiSurface as measured in the spatial reference system of this Surface .
58,441
public function getPointOnSurface ( ) : Point { $ event = new ProcessOpEvent ( $ this ) ; $ this -> fireOperationEvent ( ProcessOpEvent :: POINT_ON_SURFACE_EVENT , $ event ) ; return $ event -> getResults ( ) ; }
Gets a Point guaranteed to be on the MultiSurface .
58,442
function add ( $ selector , $ callbackOrFilterName = null , $ options = null , $ recursive = false , $ priority = 0 ) { if ( is_array ( $ selector ) ) { foreach ( $ selector as $ key => $ filters ) { $ this -> add ( $ key , $ filters ) ; } return $ this ; } if ( ! is_string ( $ selector ) ) { throw new \ InvalidArgumen...
Add a filter to the filters stack
58,443
function remove ( $ selector , $ callbackOrName = true ) { if ( array_key_exists ( $ selector , $ this -> filters ) ) { if ( $ callbackOrName === true ) { unset ( $ this -> filters [ $ selector ] ) ; } else { if ( ! is_object ( $ callbackOrName ) ) { $ filter = $ this -> filterFactory -> createFilter ( $ callbackOrName...
Remove a filter from the stack
58,444
function filter ( $ data = array ( ) ) { if ( ! is_array ( $ data ) ) { return $ data ; } if ( isset ( $ this -> filters [ self :: SELECTOR_ROOT ] ) ) { $ rootFilters = $ this -> filters [ self :: SELECTOR_ROOT ] ; $ data = $ rootFilters -> applyFilters ( $ data ) ; } foreach ( $ data as $ key => $ value ) { $ data [ $...
Apply filters to an array
58,445
function filterItem ( $ data , $ valueIdentifier ) { $ value = Utils :: arrayGetByPath ( $ data , $ valueIdentifier ) ; $ value = $ this -> applyFilters ( $ value , $ valueIdentifier , $ data ) ; if ( is_array ( $ value ) ) { foreach ( array_keys ( $ value ) as $ k ) { $ value [ $ k ] = $ this -> filterItem ( $ data , ...
Apply filters on a single item in the array
58,446
function applyFilters ( $ value , $ valueIdentifier , $ context ) { foreach ( $ this -> filters as $ selector => $ filterSet ) { if ( $ selector != self :: SELECTOR_ROOT && $ this -> itemMatchesSelector ( $ valueIdentifier , $ selector ) ) { $ value = $ filterSet -> applyFilters ( $ value , $ valueIdentifier , $ contex...
Apply filters to a single value
58,447
protected function itemMatchesSelector ( $ item , $ selector ) { if ( strpos ( $ selector , '*' ) === false ) { return $ item === $ selector ; } $ regex = '/' . str_replace ( '*' , '[^\]]+' , str_replace ( array ( '[' , ']' ) , array ( '\[' , '\]' ) , $ selector ) ) . '/' ; return preg_match ( $ regex , $ item ) ; }
Checks if an item matches a selector
58,448
public function get ( $ html = null ) { if ( null === $ html ) { if ( file_exists ( $ this -> _path ) ) { $ html = file_get_contents ( $ this -> _path ) ; } } $ this -> _path = null ; return $ this -> parse ( $ html ) ; }
Get Packed HTML
58,449
public static function run_hive_script ( $ script , $ args = null ) { if ( ! $ args ) $ args = array ( ) ; $ args = is_array ( $ args ) ? $ args : array ( $ args ) ; $ args = array_merge ( array ( '--run-hive-script' , '--args' , '-f' , $ script ) , $ args ) ; return self :: hive_pig_script ( 'hive' , $ args ) ; }
Step that runs a Hive script on your job flow .
58,450
public static function run_pig_script ( $ script , $ args = null ) { if ( ! $ args ) $ args = array ( ) ; $ args = is_array ( $ args ) ? $ args : array ( $ args ) ; $ args = array_merge ( array ( '--run-pig-script' , '--args' , '-f' , $ script ) , $ args ) ; return self :: hive_pig_script ( 'pig' , $ args ) ; }
Step that runs a Pig script on your job flow .
58,451
public static function normalizeProperty ( $ property ) { if ( substr ( $ property , 0 , 1 ) == '_' ) { $ property = substr ( $ property , 1 ) ; } $ property = lcfirst ( $ property ) ; return $ property ; }
Normalizes a property name by making it lowercase and stripping off ies or s
58,452
public static function copy ( string $ source , string $ dest , bool $ override = false ) : void { if ( is_file ( $ source ) ) { self :: copyFile ( $ source , $ dest , $ override ) ; return ; } if ( ! is_dir ( $ source ) ) { Helpers :: consoleMessage ( "File or directory '%s' not found." , [ $ source ] ) ; return ; } $...
Copies files recursively and automatically creates nested directories
58,453
protected function _captureOutput ( callable $ callable , $ args = null ) { if ( is_null ( $ args ) ) { $ args = [ ] ; } ob_start ( ) ; $ this -> _invokeCallable ( $ callable , $ args ) ; $ output = ob_get_clean ( ) ; return $ output ; }
Invokes the given callable and returns the output as a string .
58,454
private function walker ( $ keys , & $ arr ) { if ( count ( $ keys ) == 0 ) { return true ; } $ current = array_shift ( $ keys ) ; return ( is_array ( $ arr ) ? array_key_exists ( $ current , $ arr ) : false ) && ( ( is_array ( $ arr [ $ current ] ) ) ? $ this -> walker ( $ keys , $ arr [ $ current ] ) : ( count ( $ ke...
Recursive walker to check .
58,455
public function validate ( & $ arr ) { if ( count ( $ this -> list ) == 0 ) { return true ; } $ ok = true ; foreach ( $ this -> list as $ key => $ value ) { $ list = explode ( '.' , $ value ) ; $ ok = $ ok && $ this -> walker ( $ list , $ arr ) ; } return $ ok ; }
Tries to validate a hash list .
58,456
public function handle ( string $ event , callable $ callback , int $ priority = 0 ) : Route { return $ this -> collection -> createRoute ( $ event , $ callback ) -> set ( 'priority' , $ priority ) ; }
Handle an event
58,457
public function emit ( string $ name , bool $ cancelable = false ) : Event { return $ this -> dispatch ( new Event ( $ name , $ cancelable ) ) ; }
Emits an event
58,458
public function getFacebookHelper ( ) { $ redirectHelper = new FacebookRedirectLoginHelper ( $ this -> getRedirectUrl ( ) , $ this -> appId , $ this -> appSecret ) ; $ redirectHelper -> disableSessionStatusCheck ( ) ; return $ redirectHelper ; }
Get Facebook Redirect Login Helper .
58,459
public function getLoginUrl ( $ scope = array ( ) , $ version = null ) { $ scope = $ this -> getScope ( $ scope ) ; return $ this -> getFacebookHelper ( ) -> getLoginUrl ( $ scope , $ version ) ; }
Get Login Url .
58,460
public function getCallback ( ) { $ token = $ this -> getAccessToken ( ) ; if ( ! empty ( $ token ) ) { $ this -> putSessionToken ( $ token ) ; return true ; } return false ; }
Get callback from facebook .
58,461
public function api ( $ method , $ path , $ parameters = null , $ version = null , $ etag = null ) { $ session = new FacebookSession ( $ this -> getAccessToken ( ) ) ; $ request = with ( new FacebookRequest ( $ session , $ method , $ path , $ parameters , $ version , $ etag ) ) -> execute ( ) -> getGraphObject ( GraphU...
Facebook API Call .
58,462
public function get ( $ path , $ parameters = null , $ version = null , $ etag = null ) { return $ this -> api ( 'GET' , $ path , $ parameters , $ version , $ etag ) ; }
Facebook API Request with GET method .
58,463
public function post ( $ path , $ parameters = null , $ version = null , $ etag = null ) { return $ this -> api ( 'POST' , $ path , $ parameters , $ version , $ etag ) ; }
Facebook API Request with POST method .
58,464
public function delete ( $ path , $ parameters = null , $ version = null , $ etag = null ) { return $ this -> api ( 'DELETE' , $ path , $ parameters , $ version , $ etag ) ; }
Facebook API Request with DELETE method .
58,465
public function put ( $ path , $ parameters = null , $ version = null , $ etag = null ) { return $ this -> api ( 'PUT' , $ path , $ parameters , $ version , $ etag ) ; }
Facebook API Request with PUT method .
58,466
public function patch ( $ path , $ parameters = null , $ version = null , $ etag = null ) { return $ this -> api ( 'PATCH' , $ path , $ parameters , $ version , $ etag ) ; }
Facebook API Request with PATCH method .
58,467
public function getProfile ( $ parameters = [ ] , $ version = null , $ etag = null ) { return $ this -> get ( '/me' , $ parameters , $ version , $ etag ) ; }
Get user profile .
58,468
public function verifyPassword ( UserInterface $ user , $ password ) { if ( ! $ password ) { return false ; } $ hashedPassword = $ user -> getHashedPassword ( ) ; if ( ! $ hashedPassword ) { return false ; } return password_verify ( $ password , $ hashedPassword ) ; }
Checks if a given password matches the user s password .
58,469
function getRateLimiter ( ) { if ( $ this -> rateLimiter ) { return $ this -> rateLimiter ; } $ app = $ this -> auth -> getApp ( ) ; $ class = $ app [ 'config' ] -> get ( 'auth.loginRateLimiter' , NullRateLimiter :: class ) ; $ this -> rateLimiter = new $ class ( ) ; if ( method_exists ( $ this -> rateLimiter , 'setApp...
Gets the login rate limiter .
58,470
private function buildUsernameWhere ( $ username ) { $ userClass = $ this -> auth -> getUserClass ( ) ; $ conditions = array_map ( function ( $ prop , $ username ) { return $ prop . " = '" . $ username . "'" ; } , $ userClass :: $ usernameProperties , array_fill ( 0 , count ( $ userClass :: $ usernameProperties ) , add...
Builds a query string for matching the username .
58,471
public static function encryptMessage ( $ message , $ key , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'encryptMessage' ) ; Helpers :: isString ( $ key , 'Encryption' , 'encryptMessage' ) ; Helpers :: isString ( $ hashKey , 'Encryption' , 'encryptMessage' ) ; $ key = Hash :: hash ( $ key , $ ha...
Returns an encrypted message in the form of a JSON string .
58,472
public static function decryptMessage ( $ message , $ key , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'decryptMessage' ) ; Helpers :: isString ( $ key , 'Encryption' , 'decryptMessage' ) ; Helpers :: isString ( $ hashKey , 'Encryption' , 'decryptMessage' ) ; $ key = Hash :: hash ( $ key , $ ha...
Returns the encrypted message in plaintext format .
58,473
public static function signMessage ( $ message , $ key , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'signMessage' ) ; Helpers :: isString ( $ key , 'Encryption' , 'signMessage' ) ; Helpers :: isString ( $ hashKey , 'Encryption' , 'signMessage' ) ; $ key = Hash :: hash ( $ key , $ hashKey , Cons...
Returns a signed message to the client for authentication .
58,474
public static function verifyMessage ( $ message , $ key , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'verifyMessage' ) ; Helpers :: isString ( $ key , 'Encryption' , 'verifyMessage' ) ; Helpers :: isString ( $ hashKey , 'Encryption' , 'verifyMessage' ) ; $ key = Hash :: hash ( $ key , $ hashKe...
Validates a message signature and returns the signed message .
58,475
public static function encryptSignMessage ( $ message , $ encryptionKey , $ signatureKey , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'encryptSignMessage' ) ; Helpers :: isString ( $ encryptionKey , 'Encryption' , 'encryptSignMessage' ) ; Helpers :: isString ( $ signatureKey , 'Encryption' , 'e...
Sign and encrypt a message for security .
58,476
public static function decryptVerifyMessage ( $ message , $ encryptionKey , $ signatureKey , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'decryptVerifyMessage' ) ; Helpers :: isString ( $ encryptionKey , 'Encryption' , 'decryptVerifyMessage' ) ; Helpers :: isString ( $ signatureKey , 'Encryption...
Verify and decrypt a message for security .
58,477
public function getStateElement ( $ state = null ) { if ( is_bool ( $ state ) && ( $ state === true ) ) { $ state = 2 ; } switch ( ( int ) $ state ) { case 2 : $ stateText = $ this -> Html -> tag ( 'span' , '' , [ 'class' => 'fas fa-check' ] ) ; $ titleText = __d ( 'cake_installer' , 'Ok' ) ; $ labelClass = 'label-succ...
Build HTML element with status icon from status value
58,478
public function getStateItemClass ( $ state = null ) { if ( is_bool ( $ state ) && ( $ state === true ) ) { $ state = 2 ; } switch ( ( int ) $ state ) { case 2 : $ classItem = '' ; break ; case 1 : $ classItem = 'list-group-item-warning' ; break ; default : $ classItem = 'list-group-item-danger' ; } return $ classItem ...
Return class for list element from status value
58,479
public function getStateList ( $ list = null ) { $ result = '' ; if ( empty ( $ list ) ) { return $ result ; } $ listText = '' ; foreach ( $ list as $ listItem ) { $ classItem = '' ; if ( is_array ( $ listItem ) ) { if ( ! isset ( $ listItem [ 'textItem' ] ) ) { continue ; } $ textItem = $ listItem [ 'textItem' ] ; if ...
Return list of states
58,480
public function propertyPath ( $ data , $ propertyPath ) { if ( null !== $ propertyPath && ! $ propertyPath instanceof PropertyPathInterface ) { $ propertyPath = new PropertyPath ( $ propertyPath ) ; } if ( $ propertyPath instanceof PropertyPathInterface && ( \ is_object ( $ data ) || $ data instanceof \ ArrayAccess ) ...
Get the data defined by property path .
58,481
public static function getIconByExtension ( $ extension ) { if ( 'pdf' === $ extension ) { return 'file-pdf-o' ; } if ( true === in_array ( $ extension , self :: extensionsArchive ( ) ) ) { return 'file-archive-o' ; } if ( true === in_array ( $ extension , self :: extensionsImage ( ) ) ) { return 'file-image-o' ; } if ...
Get FontAwesome Icon By Extension
58,482
public function getQuery ( ) { if ( ! $ this -> query ) { $ this -> query = new Query ( $ this -> driver , $ this -> preprocessor ) ; } return $ this -> query ; }
Returns parameter builder
58,483
private function createDriver ( array $ config ) { if ( empty ( $ config [ 'driver' ] ) ) { throw new InvalidStateException ( 'Undefined driver' ) ; } elseif ( $ config [ 'driver' ] instanceof IDriver ) { return $ config [ 'driver' ] ; } else { $ name = ucfirst ( $ config [ 'driver' ] ) ; $ class = "Mva\\Dbm\\Driver\\{...
Creates a IDriver instance .
58,484
private function ensureIndexNameAttIdLanguage ( ) { if ( ! ( $ this -> database -> tableExists ( 'tl_metamodel_translatedurl' ) ) ) { return ; } if ( ! $ this -> database -> indexExists ( 'att_lang' , 'tl_metamodel_translatedurl' , true ) ) { return ; } $ this -> database -> execute ( 'ALTER TABLE `tl_metamodel_transla...
Ensure that the index types are correct .
58,485
private function ensureHrefDefaultsToNull ( ) { if ( ! ( $ this -> database -> tableExists ( 'tl_metamodel_translatedurl' ) ) ) { return ; } foreach ( $ this -> database -> listFields ( 'tl_metamodel_translatedurl' , true ) as $ field ) { if ( 'href' == $ field [ 'name' ] && $ field [ 'type' ] != 'index' ) { if ( 'NOT ...
Ensure the default value for the href column is correct .
58,486
public function uncamelize ( $ input ) { $ input = trim ( $ input ) ; if ( empty ( $ input ) ) { throw new \ Exception ( "Can not uncamelize an empty string." ) ; } $ output = '' ; for ( $ i = 0 ; $ i < mb_strlen ( $ input ) ; ++ $ i ) { $ character = mb_substr ( $ input , $ i , 1 ) ; $ isCapital = ( $ character == mb_...
Uncamelize a string
58,487
function setExpiresIn ( $ expiry ) { $ this -> expiresIn = $ expiry ; $ this -> datetimeExpiration = $ this -> getDateTimeExpiration ( ) ; return $ this ; }
Set Expiry DateTime
58,488
static public function loadEmpty ( $ defaults = NULL ) { $ defaults = array_merge ( array ( 'FN' => '' , ) , ( array ) $ defaults ) ; $ ical = implode ( "\n" , array ( 'BEGIN:VCARD' , 'VERSION:3.0' , 'PRODID:QuipContact' , 'N:' , 'FN:' . QuipContactVcfFormatter :: escape ( $ defaults [ 'FN' ] ) , 'END:VCARD' , ) ) ; re...
Initialize an empty contact .
58,489
public function getUpdated ( ) { $ set = new ArrayList ( ) ; foreach ( $ this -> updated as $ arrItem ) { $ set -> push ( ArrayData :: create ( $ arrItem ) ) ; } return $ set ; }
Return all updated objects
58,490
public function getDeleted ( ) { $ set = new ArrayList ( ) ; foreach ( $ this -> deleted as $ arrItem ) { $ set -> push ( ArrayData :: create ( $ arrItem ) ) ; } return $ set ; }
Return all deleted objects
58,491
public function getData ( ) { $ data = new ArrayList ( ) ; if ( $ this -> CreatedCount ( ) ) { $ data -> push ( ArrayData :: create ( array ( "Title" => _t ( 'Consumer.CREATED' , 'Created' ) ) ) ) ; $ data -> merge ( $ this -> getCreated ( ) ) ; } if ( $ this -> UpdatedCount ( ) ) { $ data -> push ( ArrayData :: create...
Prepare the boby for an email or build task
58,492
protected function getChangedFields ( $ obj ) { $ changedFields = $ obj -> getChangedFields ( true , 2 ) ; foreach ( $ changedFields as $ key => $ value ) { $ changedFields [ $ key ] [ 'before' ] = '(' . gettype ( $ value [ 'before' ] ) . ') ' . $ value [ 'before' ] ; $ changedFields [ $ key ] [ 'after' ] = '(' . getty...
Modelled on the getChangedFields of DataObject with the addition of the variable s type
58,493
public function directoryFiles ( $ path ) { $ contents = [ ] ; $ directoryFiles = scandir ( $ path ) ; foreach ( $ directoryFiles as $ index => $ filePath ) { if ( ! in_array ( $ filePath , [ '.' , '..' ] ) ) { if ( is_dir ( $ path . DIRECTORY_SEPARATOR . $ filePath ) ) { $ contents = array_merge ( $ contents , self ::...
Return an array of files with their full paths contained in a directory and its subdirectories
58,494
public static function simple ( Configuration $ configuration , VenueFactory $ venueFactory ) { return new static ( $ configuration , new HttpMethodsClient ( HttpClientDiscovery :: find ( ) , MessageFactoryDiscovery :: find ( ) ) , $ venueFactory ) ; }
Convenience factory method creating a standard Client configuration .
58,495
public function getVenue ( Identifier $ identifier ) { $ url = $ this -> getUrl ( sprintf ( 'venues/%s' , urlencode ( $ identifier ) ) ) ; $ response = $ this -> httpClient -> get ( $ url , $ this -> getDefaultHeaders ( ) ) ; $ content = $ this -> parseResponse ( $ response ) ; if ( ! isset ( $ content -> response -> v...
Get a venue by its unique identifier .
58,496
public function search ( Search $ options ) { $ url = $ this -> getUrl ( 'venues/search' , $ options -> parametrise ( ) ) ; $ response = $ this -> httpClient -> get ( $ url , $ this -> getDefaultHeaders ( ) ) ; $ content = $ this -> parseResponse ( $ response ) ; if ( ! isset ( $ content -> response -> venues ) ) { thr...
Search venues .
58,497
public function explore ( Explore $ options ) { $ url = $ this -> getUrl ( 'venues/explore' , $ options -> parametrise ( ) ) ; $ response = $ this -> httpClient -> get ( $ url , $ this -> getDefaultHeaders ( ) ) ; $ content = $ this -> parseResponse ( $ response ) ; if ( ! isset ( $ content -> response -> groups [ 0 ] ...
Explore venues .
58,498
private function parseResponse ( ResponseInterface $ response ) { if ( $ response -> getStatusCode ( ) >= 400 && $ response -> getStatusCode ( ) < 500 ) { throw new ClientErrorException ( $ response ) ; } if ( $ response -> getStatusCode ( ) >= 500 && $ response -> getStatusCode ( ) < 600 ) { throw new ServerErrorExcep...
Parse a response .
58,499
private function getUrl ( $ path , $ parameters = [ ] ) { $ url = sprintf ( '%s/v%d/%s?client_id=%s&client_secret=%s&v=%s%s' , $ this -> configuration -> getBasePath ( ) , urlencode ( $ this -> configuration -> getVersion ( ) ) , trim ( $ path , '/' ) , urlencode ( $ this -> configuration -> getClientId ( ) ) , urlenco...
Get the API url for a given path .