idx
int64
0
241k
question
stringlengths
64
6.21k
target
stringlengths
5
803
240,400
protected function fetchOperation ( ) { $ operation = $ this -> getRouteParam ( 'operation' ) ; if ( $ operation !== null ) { $ operation = $ this -> parseCanonicalName ( $ operation ) ; if ( preg_match ( $ this -> operationPattern , $ operation ) ) { return $ operation ; } else { return false ; } } else { $ operation ...
Parse operation name from request
240,401
protected function fetchParams ( ) { $ contentType = $ this -> getRequest ( ) -> getHeaders ( ) -> get ( 'Content-Type' ) ; if ( $ contentType ) { $ contentTypeParts = explode ( ';' , $ contentType -> getFieldValue ( ) ) ; $ contentType = strtolower ( trim ( $ contentTypeParts [ 0 ] ) ) ; } if ( $ contentType === 'appl...
Parse parameters from request
240,402
public function get ( $ id , Cargo \ Container $ container = null ) { if ( $ this -> container -> has ( $ id ) || ! class_exists ( $ id ) ) { return $ this -> container -> get ( $ id , $ container ? : $ this ) ; } $ this -> add ( $ id , null ) ; return $ this -> get ( $ id , $ container ) ; }
fetch from container or if the service is a class name we ll try to resolve it automatically
240,403
public function setOptions ( $ options ) { if ( ! is_array ( $ options ) && ! $ options instanceof Traversable ) { throw new \ InvalidArgumentException ( sprintf ( 'Expected an array or Traversable; received "%s"' , ( is_object ( $ options ) ? get_class ( $ options ) : gettype ( $ options ) ) ) ) ; } foreach ( $ option...
Configure service loader
240,404
public function getCommandManager ( ) { if ( $ this -> commandManager === null ) { $ this -> commandManager = new CommandManager ( ) ; $ this -> commandManager -> setServiceLoader ( $ this ) ; } return $ this -> commandManager ; }
Retrieve command manager
240,405
public function registerServices ( $ services ) { if ( ! is_array ( $ services ) && ! ( $ services instanceof Traversable ) ) { throw new Exception \ InvalidArgumentException ( sprintf ( 'Expected an array or Traversable; received "%s"' , ( is_object ( $ services ) ? get_class ( $ services ) : gettype ( $ services ) ) ...
Batch register services
240,406
public function load ( $ id , $ options = null ) { $ id = $ this -> normalizeServiceId ( $ id ) ; if ( ! isset ( $ this -> services [ $ id ] ) ) { throw new Exception \ ServiceNotFoundException ( sprintf ( 'Service ID "%s" does not exist' , $ id ) ) ; } if ( $ options == null ) { $ options = $ this -> services [ $ id ]...
Loads specific service by ID
240,407
public function getServiceOptions ( $ id ) { $ id = $ this -> normalizeServiceId ( $ id ) ; if ( ! isset ( $ this -> services [ $ id ] ) ) { throw new Exception \ ServiceNotFoundException ( sprintf ( 'Service ID "%s" does not exist' , $ id ) ) ; } return $ this -> services [ $ id ] [ 'options' ] ; }
Retrieve options for service
240,408
public function exists ( $ name ) { $ name = $ this -> normalizeServiceName ( $ name ) ; return $ this -> getCommandManager ( ) -> hasListeners ( $ name ) ; }
Test if a service exists
240,409
public function getServicePluginManager ( ) { if ( $ this -> servicePluginManager === null ) { $ this -> servicePluginManager = new ServicePluginManager ( ) ; $ that = $ this ; $ this -> servicePluginManager -> addInitializer ( function ( $ instance , $ serviceManager ) use ( $ that ) { $ name = $ serviceManager -> get...
Retrieve service manager
240,410
public function register ( CommandInterface $ command ) { $ name = $ command -> getCommand ( ) ; if ( array_key_exists ( $ name , $ this -> commands ) ) { throw new CommandException ( "Command with name '$name' already registered" ) ; } $ this -> commands [ $ name ] = $ command ; }
Registers a command .
240,411
public function getCommandIfExists ( $ string ) { if ( starts_with ( $ string , $ this -> id ) ) { foreach ( $ this -> commands as $ commandName => $ command ) { if ( starts_with ( $ string , $ this -> id . $ commandName ) ) { return $ command ; } } } }
Check if the given string contains a command if so return the registered command .
240,412
protected function rebuildDatabase ( ) { $ this -> schemaTool -> dropDatabase ( ) ; $ entityMeta = $ this -> em -> getMetadataFactory ( ) -> getAllMetadata ( ) ; $ this -> schemaTool -> updateSchema ( $ entityMeta ) ; }
Builds the DB Schema
240,413
private function locateFile ( ) { $ filePath = locate_template ( $ this -> templatesPath , false , false ) ; if ( ! $ filePath ) { $ filePath = $ this -> defaultPath ; } return $ filePath ; }
Locate template file
240,414
public function daysOfWeek ( $ daysOfWeek ) { if ( empty ( $ daysOfWeek ) || is_string ( $ daysOfWeek ) === false || strlen ( $ daysOfWeek ) < 3 ) { return null ; } $ daysOfWeek = explode ( ',' , $ daysOfWeek ) ; $ allowedValues = [ 'mon' , 'tue' , 'wed' , 'thu' , 'fri' , 'sat' , 'sun' ] ; foreach ( $ daysOfWeek as $ d...
Parses a string like mon tue wed thu fri sat sun into a array
240,415
public function setPackage ( $ package ) { if ( $ package != $ this -> package ) { $ this -> layoutLocation = null ; } $ this -> package = $ this -> treatPackageName ( $ package ) ; }
Set the package name
240,416
public function setLayout ( $ file ) { if ( strstr ( $ file , '::' ) ) { $ file = explode ( '::' , $ file ) ; $ package = $ file [ 0 ] ; $ file = $ file [ 1 ] ; } else { $ package = $ this -> package ; } $ this -> assignDeclaredLayout ( $ package , $ file ) ; }
Set the layout location
240,417
private function assignDeclaredLayout ( $ package , $ file ) { $ file = lcfirst ( $ file ) ; if ( substr ( strtolower ( $ file ) , - 6 ) == '.phtml' ) { $ file = substr ( $ file , 0 , - 6 ) ; } $ package = $ this -> app -> getPackage ( $ package ) ; $ pathPieces = array ( $ package [ 'package_path' ] , 'res' , 'layout'...
Assign the path to the layout file
240,418
private function getPathForView ( ) { $ methodName = lcfirst ( $ this -> method ) ; $ className = lcfirst ( $ this -> class ) ; $ package = $ this -> app -> getPackage ( $ this -> package ) ; $ pathPieces = array ( $ package [ 'package_path' ] , 'res' , 'view' , $ className , $ methodName ) ; $ path = implode ( self ::...
Get the path for a view file .
240,419
private function inflate ( $ filePath ) { $ currentDirectory = rtrim ( dirname ( $ this -> currentView ) , self :: DS ) ; $ currentDirectory .= self :: DS ; if ( substr ( $ filePath , - 6 , 6 ) != '.phtml' ) { $ filePath .= '.phtml' ; } $ searchPath = realpath ( $ currentDirectory . $ filePath ) ; if ( $ searchPath != ...
Inflate a given
240,420
public function getCredentialsByService ( $ serviceName ) { if ( ! in_array ( $ serviceName , $ this -> getInitializedServices ( ) ) ) { throw new DomainException ( sprintf ( "Credentials for service '%s' was not initialized" , $ serviceName ) ) ; } return $ this -> serviceCredentials [ $ serviceName ] ; }
Returns credentials for notification service
240,421
public function addRepository ( $ repositoryClass , $ serviceId , $ entityClass ) { $ repositoryDefinition = $ this -> definitionFactory -> build ( $ repositoryClass , $ serviceId , $ entityClass ) ; $ this -> definitions [ ] = $ repositoryDefinition ; }
Add a repository service from Symfony DIC to the pool
240,422
public function createPool ( ) { $ pool = new RepositoryPool ( ) ; foreach ( $ this -> definitions as $ definition ) { $ pool -> addRepositoryDefinition ( $ definition ) ; } return $ pool ; }
Factory method for the EntityPool
240,423
static public function from ( $ class ) { if ( is_object ( $ class ) ) { $ class = get_class ( $ class ) ; } if ( empty ( self :: $ prototypes [ $ class ] ) ) { self :: $ prototypes [ $ class ] = new static ( $ class ) ; } return self :: $ prototypes [ $ class ] ; }
Returns the prototype associated with the specified class or object .
240,424
protected function getConsolidatedMethods ( ) { if ( $ this -> consolidatedMethods !== null ) { return $ this -> consolidatedMethods ; } $ methods = $ this -> methods ; if ( $ this -> parent ) { $ methods += $ this -> parent -> getConsolidatedMethods ( ) ; } return $ this -> consolidatedMethods = $ methods ; }
Consolidate the methods of the prototype .
240,425
protected function revokeConsolidatedMethods ( ) { $ class = $ this -> class ; foreach ( self :: $ prototypes as $ prototype ) { if ( ! is_subclass_of ( $ prototype -> class , $ class ) ) { continue ; } $ prototype -> consolidatedMethods = null ; } $ this -> consolidatedMethods = null ; }
Revokes the consolidated methods of the prototype .
240,426
public function offsetSet ( $ method , $ callback ) { self :: $ prototypes [ $ this -> class ] -> methods [ $ method ] = $ callback ; $ this -> revokeConsolidatedMethods ( ) ; }
Adds or replaces the specified method of the prototype .
240,427
public function offsetGet ( $ method ) { $ methods = $ this -> getConsolidatedMethods ( ) ; if ( ! isset ( $ methods [ $ method ] ) ) { throw new Exception ( "$method, $this->class" ) ; } return $ methods [ $ method ] ; }
Returns the callback associated with the specified method .
240,428
public static function addOptions ( InputDefinition $ definition , array $ fields , $ description ) { foreach ( $ fields as $ field => $ type ) { $ mode = 'array' === $ type ? InputOption :: VALUE_REQUIRED | InputOption :: VALUE_IS_ARRAY : InputOption :: VALUE_REQUIRED ; if ( ! $ definition -> hasOption ( $ field ) && ...
Add options in input definition .
240,429
public static function getFieldValue ( InputInterface $ input , $ fieldName ) { $ value = null ; if ( $ input -> hasArgument ( $ fieldName ) ) { $ value = $ input -> getArgument ( $ fieldName ) ; } elseif ( $ input -> hasOption ( $ fieldName ) ) { $ value = $ input -> getOption ( $ fieldName ) ; } return $ value ; }
Get field value in console input .
240,430
public function create ( $ type , $ override , $ persisted ) { $ base = $ this -> factory -> blueprint ( ) ; $ variation = $ this -> getVariation ( $ type ) ; $ blueprint = array_merge ( $ base , $ variation , $ override ) ; return new Blueprint ( $ this -> name , $ type , $ blueprint , $ this -> isFixture ( $ type ) ,...
Creates a new blueprint
240,431
private function getVariation ( $ type ) { if ( $ type == 'blueprint' ) { return array ( ) ; } elseif ( method_exists ( $ this -> factory , "{$type}Fixture" ) ) { return call_user_func ( array ( $ this -> factory , "{$type}Fixture" ) ) ; } elseif ( method_exists ( $ this -> factory , "{$type}_fixture" ) ) { return call...
Applies a variation to the basic blueprint or calls the fixture
240,432
public function replace ( array $ annotations ) { $ this -> annotations = $ annotations ; $ this -> names = [ ] ; $ index = 0 ; foreach ( $ annotations as $ annotation ) { $ name = $ annotation -> getName ( ) ; if ( ! array_key_exists ( $ name , $ this -> names ) ) { $ this -> names [ $ name ] = [ ] ; } $ this -> names...
Replaces a set of annotations values
240,433
public function get ( $ key ) { if ( $ this -> has ( $ key ) ) { return $ this -> annotations [ $ this -> names [ $ key ] [ 0 ] ] ; } return null ; }
Retrieves a single annotation
240,434
public function find ( $ key , $ filter = null ) { if ( ! $ this -> has ( $ key ) ) { return [ ] ; } $ annotations = [ ] ; foreach ( $ this -> names [ $ key ] as $ index ) { if ( ! is_int ( $ filter ) ) { $ annotations [ ] = $ this -> annotations [ $ index ] ; continue ; } $ annotation = $ this -> annotations [ $ index...
Retrieves a list of annotations by name
240,435
public function filter ( \ Closure $ callback , $ reindex = true ) { $ result = array_filter ( $ this -> annotations , $ callback ) ; if ( $ reindex ) { $ result = array_values ( $ result ) ; } return $ result ; }
Filters elements with the given callback
240,436
protected function checkRequiredModules ( array $ data , & $ result ) { if ( $ data [ 'installer' ] === 'base' && empty ( $ data [ 'step' ] ) && ! $ this -> getModel ( ) -> hasAllRequiredModules ( ) ) { $ result = array ( 'redirect' => '' , 'severity' => 'warning' , 'message' => gplcart_text ( 'You cannot use this inst...
Check if all required modules in place
240,437
public static function create ( int $ statusCode , string $ message , string $ request , string $ response ) : ApiClientException { switch ( $ statusCode ) { case 400 : $ exception = new BadRequestException ( $ message , $ request , $ response ) ; break ; case 401 : $ exception = new UnauthorizedException ( $ message ,...
Creates the exception corresponding to the specified status code .
240,438
public function store ( $ message , $ bucket ) { $ messages = $ this -> fetch ( $ bucket ) ; if ( true === in_array ( $ message , $ messages ) ) { return false ; } $ messages [ ] = $ message ; $ _SESSION [ self :: ROOT_NODE ] [ $ bucket ] = $ messages ; return true ; }
Store the notifications using the driver
240,439
public function fetch ( $ bucket , $ flush = true ) { if ( true === empty ( $ _SESSION [ self :: ROOT_NODE ] ) ) { $ _SESSION [ self :: ROOT_NODE ] = [ ] ; } if ( true === empty ( $ _SESSION [ self :: ROOT_NODE ] [ $ bucket ] ) ) { $ _SESSION [ self :: ROOT_NODE ] [ $ bucket ] = [ ] ; } $ messages = $ _SESSION [ self :...
Fetch the notifications from the driver
240,440
public function flush ( $ bucket ) { if ( false === empty ( $ _SESSION [ self :: ROOT_NODE ] [ $ bucket ] ) ) { $ _SESSION [ self :: ROOT_NODE ] [ $ bucket ] = [ ] ; return true ; } return false ; }
Flush all notifications from the driver
240,441
final protected function addFailureMessage ( string $ messageKey ) : void { $ messages = $ this -> getPossibleMessages ( ) ; if ( ! isset ( $ messages [ $ messageKey ] ) ) { throw new \ RuntimeException ( 'Unknown message key: ' . $ messageKey ) ; } $ this -> failureMessages [ $ messageKey ] = $ messages [ $ messageKey...
Adds a failure message .
240,442
protected function dispatchClassMetadataLoadedEvent ( ClassMetadataInterface $ classMetadata ) : void { if ( null === $ this -> eventDispatcher ) { return ; } $ this -> eventDispatcher -> dispatch ( ClassMetadataLoadedEvent :: LOADED_EVENT , new ClassMetadataLoadedEvent ( $ classMetadata ) ) ; }
Dispatches a class metadata loaded event for the given class .
240,443
private function getFromCache ( string $ class ) : ? ClassMetadataInterface { if ( null === $ this -> cache ) { return null ; } if ( $ this -> cache instanceof Cache ) { $ cached = $ this -> cache -> fetch ( $ class ) ? : null ; } else { $ class = preg_replace ( '#[\{\}\(\)/\\\\@:]#' , '_' , str_replace ( '_' , '__' , ...
Check a cache pool for cached metadata .
240,444
private function saveInCache ( string $ class , ClassMetadataInterface $ classMetadata ) : void { if ( null === $ this -> cache ) { return ; } if ( $ this -> cache instanceof Cache ) { $ this -> cache -> save ( $ class , $ classMetadata ) ; } else { $ class = preg_replace ( '#[\{\}\(\)/\\\\@:]#' , '_' , str_replace ( '...
Saves a metadata into a cache pool .
240,445
private function getClass ( $ value ) { if ( ! is_object ( $ value ) && ! is_string ( $ value ) ) { return false ; } if ( is_object ( $ value ) ) { $ value = get_class ( $ value ) ; } return ltrim ( $ value , '\\' ) ; }
Get the class name from a string or an object .
240,446
public function register ( ) { if ( ! $ this -> isRegistered ) { spl_autoload_register ( [ $ this , 'load' ] , true , true ) ; $ this -> isRegistered = true ; } return $ this ; }
Register the autoloader with spl_autoload .
240,447
public function registerPath ( $ namespace , $ path , $ prepend = false ) { $ namespace = Normalizer :: ns ( $ namespace , true ) ; $ index = substr ( $ namespace , 0 , 4 ) ; $ this -> indexes [ $ index ] = true ; $ path = Normalizer :: path ( $ path , true ) ; if ( ! isset ( $ this -> paths [ $ namespace ] ) ) { $ thi...
Registers a PSR - 4 directory for a given namespace .
240,448
public function addClassMap ( array $ map ) { if ( empty ( $ this -> classMap ) ) { $ this -> classMap = $ map ; return $ this ; } $ this -> classMap = array_merge ( $ this -> classMap , $ map ) ; return $ this ; }
Adds the map of classes .
240,449
public function findFile ( $ class ) { $ class = Normalizer :: ns ( $ class , false ) ; if ( isset ( $ this -> classMap [ $ class ] ) ) { return $ this -> classMap [ $ class ] ; } $ index = substr ( $ class , 0 , 4 ) ; if ( isset ( $ this -> indexes [ $ index ] ) ) { $ namespace = $ class ; while ( false !== $ pos = st...
Finds the path to the file that contains the specified class .
240,450
public function setEntityFormat ( $ format ) { $ this -> validator -> isFormatValid ( $ format ) ; $ this -> entityFormat = $ format ; return $ this ; }
Sets the entity type format .
240,451
public function setFieldKeyFormat ( $ format ) { $ this -> validator -> isFormatValid ( $ format ) ; $ this -> fieldKeyFormat = $ format ; return $ this ; }
Sets the field key format .
240,452
public function getFeatures ( ) { $ featuresString = $ this -> storage -> get ( $ this -> getFeaturesKey ( ) ) ; $ features = explode ( ',' , $ featuresString ) ; return $ features ; }
Get all feature names
240,453
protected function saveFeature ( RolloutableInterface $ feature ) { $ this -> storage -> set ( $ this -> getKey ( $ feature -> getName ( ) ) , ( string ) $ feature ) ; $ features = $ this -> getFeatures ( ) ; if ( false === in_array ( $ feature -> getName ( ) , $ features ) ) { $ features [ ] = $ feature -> getName ( )...
Saves a feature to the storage
240,454
public function activateRole ( $ featureName , $ roleName ) { $ feature = $ this -> getFeature ( $ featureName ) ; $ feature -> addRole ( $ roleName ) ; $ this -> saveFeature ( $ feature ) ; }
Activates a feature for a specific role
240,455
public function deactivateRole ( $ featureName , $ roleName ) { $ feature = $ this -> getFeature ( $ featureName ) ; $ feature -> removeRole ( $ roleName ) ; $ this -> saveFeature ( $ feature ) ; }
Deactivates a feature for a specific role .
240,456
public function activateGroup ( $ featureName , $ groupName ) { $ feature = $ this -> getFeature ( $ featureName ) ; $ feature -> addGroup ( $ groupName ) ; $ this -> saveFeature ( $ feature ) ; }
Activates a feature for a specific group
240,457
public function deactivateGroup ( $ featureName , $ groupName ) { $ feature = $ this -> getFeature ( $ featureName ) ; $ feature -> removeGroup ( $ groupName ) ; $ this -> saveFeature ( $ feature ) ; }
Deactivates a feature for a specific group .
240,458
public function activateUser ( $ featureName , $ userId ) { $ feature = $ this -> getFeature ( $ featureName ) ; $ feature -> addUser ( $ userId ) ; $ this -> saveFeature ( $ feature ) ; }
Activates a feature for a specific user
240,459
public function deactivateUser ( $ featureName , $ userId ) { $ feature = $ this -> getFeature ( $ featureName ) ; $ feature -> removeUser ( $ userId ) ; $ this -> saveFeature ( $ feature ) ; }
Deactivates a feature for a specific user
240,460
public function activatePercentage ( $ featureName , $ percentage ) { $ feature = $ this -> getFeature ( $ featureName ) ; $ feature -> setPercentage ( $ percentage ) ; $ this -> saveFeature ( $ feature ) ; }
Activates a feature for a percentage of users
240,461
public function deactivatePercentage ( $ featureName ) { $ feature = $ this -> getFeature ( $ featureName ) ; $ feature -> setPercentage ( 0 ) ; $ this -> saveFeature ( $ feature ) ; }
Deactivates the percentage activation for a feature
240,462
public function isActive ( $ featureName , DeterminableUserInterface $ user = null ) { $ feature = $ this -> getFeature ( $ featureName ) ; return $ feature -> isActive ( $ this , $ user ) ; }
Checks if a feature is active
240,463
public function userHasRole ( $ roleName , DeterminableUserInterface $ user ) { $ userHasRole = false ; if ( true === in_array ( $ roleName , $ user -> getRoles ( ) ) ) { $ userHasRole = true ; } return $ userHasRole ; }
Checks if a user has the given role
240,464
public function userHasGroup ( $ groupName , DeterminableUserInterface $ user ) { $ userHasGroup = false ; if ( true === in_array ( $ groupName , $ user -> getGroups ( ) ) ) { $ userHasGroup = true ; } return $ userHasGroup ; }
Checks if a user has the given group
240,465
public static function isValid ( $ collection ) { if ( false === is_array ( $ collection ) && false === ( $ collection instanceof Collection ) ) { return false ; } return true ; }
Is Valid Collection
240,466
public static function find ( $ collection , $ id ) { $ id = intval ( $ id ) ; foreach ( $ collection as $ entity ) { if ( $ id === $ entity -> getId ( ) ) { return $ entity ; } } return null ; }
Find By Id
240,467
public function directoryAction ( $ path ) { try { $ this -> setPath ( $ path ) ; } catch ( NotFoundException $ e ) { throw $ e ; } $ dbfile = new WDBFile ( $ this -> getpath ( ) ) ; if ( $ dbfile -> isFile ( ) ) { return $ this -> fileAction ( $ this -> getPath ( ) ) ; } $ readme_content = $ dir_content = '' ; $ index...
Directory path action
240,468
public function fileAction ( $ path ) { try { $ this -> setPath ( $ path ) ; } catch ( NotFoundException $ e ) { throw $ e ; } $ dbfile = new WDBFile ( $ this -> getPath ( ) ) ; if ( $ dbfile -> isDir ( ) ) { return $ this -> directoryAction ( $ this -> getPath ( ) ) ; } $ tpl_params = array ( 'page' => $ dbfile -> get...
File path action
240,469
public function rssFeedAction ( $ path ) { try { $ this -> setPath ( $ path ) ; } catch ( NotFoundException $ e ) { throw $ e ; } $ dbfile = new WDBFile ( $ this -> getpath ( ) ) ; $ contents = array ( ) ; $ tpl_params = array ( 'page' => $ dbfile -> getWDBFullStack ( ) , 'breadcrumbs' => TemplateHelper :: getBreadcrum...
RSS action for concerned path
240,470
public function sitemapAction ( $ path ) { try { $ this -> setPath ( $ path ) ; } catch ( NotFoundException $ e ) { throw $ e ; } $ dbfile = new WDBFile ( $ this -> getpath ( ) ) ; if ( ! $ dbfile -> isDir ( ) ) { throw new NotFoundException ( 'Can not build a sitemap from a single file!' , 0 , null , TemplateHelper ::...
Sitemap action for a path
240,471
public function htmlOnlyAction ( $ path ) { try { $ this -> setPath ( $ path ) ; } catch ( NotFoundException $ e ) { throw $ e ; } $ dbfile = new WDBFile ( $ this -> getpath ( ) ) ; if ( ! $ dbfile -> isFile ( ) ) { throw new NotFoundException ( 'Can not send raw content of a directory!' , 0 , null , TemplateHelper :: ...
HTML only version of a path
240,472
public function plainTextAction ( $ path ) { try { $ this -> setPath ( $ path ) ; } catch ( NotFoundException $ e ) { throw $ e ; } $ dbfile = new WDBFile ( $ this -> getpath ( ) ) ; if ( ! $ dbfile -> isFile ( ) ) { throw new NotFoundException ( 'Can not send raw content of a directory!' , 0 , null , TemplateHelper ::...
Raw plain text action of a path
240,473
public function downloadAction ( $ path ) { try { $ this -> setPath ( $ path ) ; } catch ( NotFoundException $ e ) { throw $ e ; } $ dbfile = new WDBFile ( $ this -> getpath ( ) ) ; if ( ! $ dbfile -> isFile ( ) ) { throw new NotFoundException ( 'Can not send raw content of a directory!' , 0 , null , TemplateHelper :: ...
Download action of a path
240,474
public function searchAction ( $ path ) { try { $ this -> setPath ( $ path ) ; } catch ( NotFoundException $ e ) { throw $ e ; } $ search = $ this -> wdb -> getRequest ( ) -> getArgument ( 's' ) ; if ( empty ( $ search ) ) { return $ this -> indexAction ( $ path ) ; } $ _s = Helper :: makeSearch ( $ search , $ this -> ...
Global search action of a path
240,475
protected function createSeed ( ) { $ templateTags = [ ] ; $ seedsDirectory = $ this -> cmd -> getConfigOpt ( 'seeds_storage' ) ; $ filename = trim ( $ this -> cmd -> question ( 'Seed filename?' ) ) ; $ templateTags [ 'phx:class' ] = Helper :: getQualifiedClassName ( $ filename ) ; $ path = $ seedsDirectory . '/' . $ f...
Create new seed class .
240,476
protected function runSeeds ( ) { foreach ( $ this -> getSeeders ( ) as $ file ) { require_once $ file ; $ className = basename ( $ file , '.php' ) ; $ this -> runSeed ( $ className ) ; } }
Runs all seeders .
240,477
protected function runSeed ( String $ className ) { if ( ! class_exists ( $ className ) ) { throw new SeederNotFoundException ( sprintf ( '[%s] seeder class not found.' , $ className ) ) ; } $ seeder = new $ className ( ) ; return $ seeder -> run ( ) ; }
Runs a single seeder .
240,478
protected function getSeeders ( ) : Array { $ seeders = [ ] ; $ seedsDirectory = $ this -> cmd -> getConfigOpt ( 'seeds_storage' ) ; foreach ( glob ( $ seedsDirectory . '/*' . '.php' ) as $ file ) { $ seeders [ ] = $ file ; } return $ seeders ; }
Returns an array of seeder files .
240,479
public function getLabelAttributes ( ) { $ result = [ ] ; $ label = $ this -> element -> getLabel ( ) ; foreach ( $ label -> getAttributes ( ) as $ attribute => $ value ) { if ( null === $ value ) { $ result [ ] = $ attribute ; continue ; } $ result [ ] = "{$attribute}=\"{$value}\"" ; } return implode ( ' ' , $ result ...
Returns the elements s label attributes as a string
240,480
private function verifyCommand ( ) { $ process = new Process ( 'which cracklib-check' ) ; $ process -> setTimeout ( 10 ) ; $ process -> run ( ) ; if ( $ process -> isSuccessful ( ) ) { return trim ( $ process -> getOutput ( ) ) ; } $ process = new Process ( 'whereis cracklib-check' ) ; $ process -> setTimeout ( 10 ) ; ...
Verify the command to be available
240,481
public function check ( $ password ) { if ( empty ( $ password ) ) { throw new InvalidArgumentException ( 'The password cannot be empty' ) ; } $ process = new Process ( $ this -> command ) ; $ process -> setInput ( $ password ) ; $ process -> mustRun ( ) ; return $ this -> verifyOutput ( $ process -> getOutput ( ) ) ; ...
Performs an obscure check with the given password
240,482
private function verifyOutput ( $ output ) { $ output = trim ( $ output ) ; $ result = 'unknown' ; if ( preg_match ( '/: ([^:]+)$/' , $ output , $ matches ) ) { $ result = $ matches [ 1 ] ; } $ this -> message = $ result ; if ( array_key_exists ( $ result , $ this -> messageStatus ) ) { $ this -> status = $ this -> mes...
Checks the result of the password check
240,483
public function start_lvl ( & $ output , $ depth = 0 , $ args = array ( ) ) { $ indent = ( $ depth > 0 ? str_repeat ( "\t" , $ depth ) : '' ) ; $ display_depth = ( $ depth + 1 ) ; $ classes = array ( 'sub-menu' , ( $ display_depth == 0 ? 'dropdown' : '' ) , ( $ display_depth > 0 ? 'dropdown-menu' : '' ) , ) ; $ class_n...
Starts the list before the elements are added . add classes to ul sub - menus
240,484
public function resolve ( $ themeName = null ) { switch ( true ) { case $ themeName : if ( ! $ theme = $ this -> themeLoader -> retrieveByName ( $ themeName ) ) { throw new InvalidThemeException ( sprintf ( 'No themes registered under for "%s" theme name. Did you mean one of these themes : %s ?' , $ themeName , $ this ...
Select Theme to use from given parameters and return it .
240,485
public function Increment ( ) { if ( $ this -> version == null ) { $ this -> _getVersion ( ) ; } $ this -> version += .1 ; $ this -> _StoreVersion ( ) ; }
Increment version number .
240,486
protected function _getVersion ( ) { if ( empty ( $ this -> version ) ) { $ result = $ this -> cacheHandler -> get ( $ this -> getTagName ( ) ) ; if ( empty ( $ result ) ) { $ this -> ResetTagVersion ( ) ; } else { $ this -> version = $ result ; } } return $ this -> version ; }
return current version number of tag - instance
240,487
function getOwnerId ( ) { if ( $ this -> withIdentity ( ) instanceof iIdentityOfUser ) { $ identity = $ this -> withIdentity ( ) ; $ userId = $ identity -> getOwnerId ( ) ; } else { $ userInfo = $ this -> getAuthInfo ( ) ; $ userId = $ userInfo [ 'user' ] [ 'uid' ] ; } return $ userId ; }
Get Owner Identifier
240,488
function getAuthInfo ( $ grants = false ) { if ( $ this -> _c_info ) return $ this -> _c_info ; $ options = null ; if ( $ grants ) $ options [ 'include_grants' ] = true ; try { $ info = $ this -> federation ( ) -> getMyAccountInfo ( $ options ) ; } catch ( exOAuthAccessDenied $ e ) { throw new exAccessDenied ( $ e -> g...
Retrieve User Info From OAuth Server
240,489
function federation ( ) { if ( $ this -> _c_federation ) return $ this -> _c_federation ; $ federation = clone $ this -> federation ; $ federation -> setTokenProvider ( $ this -> insTokenProvider ( ) ) ; return $ this -> _c_federation = $ federation ; }
Access Federation Commands Of Identified User
240,490
function insTokenProvider ( ) { if ( $ this -> _tokenProvider ) return $ this -> _tokenProvider ; $ identity = $ this -> withIdentity ( ) ; $ tokenProvider = new TokenProviderSolid ( $ identity -> getAccessToken ( ) ) ; return $ tokenProvider ; }
Token Provider Help Call API s Behalf Of User with given token
240,491
public function getCollapseClassNames ( ) { $ classes = $ this -> styles ( 'navbar.collapse' , 'collapse' ) ; if ( $ this -> hasRows ( ) ) { $ classes [ ] = $ this -> style ( 'navbar.column' ) ; } if ( $ align = $ this -> ItemAlign ) { $ classes [ ] = $ this -> style ( sprintf ( 'navbar.item-align-%s' , $ align ) ) ; }...
Answers an array of collapse class names for the HTML template .
240,492
public function getLogoDimensions ( ) { $ data = [ ] ; $ widths = $ this -> dbObject ( 'BrandLogoWidth' ) ; $ heights = $ this -> dbObject ( 'BrandLogoHeight' ) ; foreach ( $ widths -> getViewports ( ) as $ viewport ) { if ( $ value = $ widths -> getField ( $ viewport ) ) { $ data [ $ viewport ] [ 'Width' ] = $ value ;...
Answers a list of logo dimensions for the custom CSS template .
240,493
public function getBackgroundOptions ( ) { return [ self :: BG_PRIMARY => _t ( __CLASS__ . '.PRIMARY' , 'Primary' ) , self :: BG_LIGHT => _t ( __CLASS__ . '.LIGHT' , 'Light' ) , self :: BG_DARK => _t ( __CLASS__ . '.DARK' , 'Dark' ) ] ; }
Answers an array of options for the background field .
240,494
public function getItemAlignOptions ( ) { return [ self :: ITEM_ALIGN_START => _t ( __CLASS__ . '.START' , 'Start' ) , self :: ITEM_ALIGN_CENTER => _t ( __CLASS__ . '.CENTER' , 'Center' ) , self :: ITEM_ALIGN_END => _t ( __CLASS__ . '.END' , 'End' ) , self :: ITEM_ALIGN_BETWEEN => _t ( __CLASS__ . '.BETWEEN' , 'Between...
Answers an array of options for the item align field .
240,495
public function getItemJustifyOptions ( ) { return [ self :: ITEM_ALIGN_START => _t ( __CLASS__ . '.START' , 'Start' ) , self :: ITEM_ALIGN_CENTER => _t ( __CLASS__ . '.CENTER' , 'Center' ) , self :: ITEM_ALIGN_END => _t ( __CLASS__ . '.END' , 'End' ) , self :: ITEM_ALIGN_BASELINE => _t ( __CLASS__ . '.BASELINE' , 'Bas...
Answers an array of options for the item justify field .
240,496
protected function createCtrl ( ) { $ oView = ViewFactory :: createView ( $ this -> ctrlName , str_replace ( 'action' , '' , $ this -> actionName ) ) ; $ aComponentsRootMap = AppHelper :: getInstance ( ) -> getConfig ( 'componentsRootMap' ) ; if ( ! isset ( $ aComponentsRootMap [ 'controllers' ] ) ) { throw new Excepti...
It creates the controller object assignes it with default view and layout objects .
240,497
public function resolveSql ( array $ parameters = array ( ) ) { $ sql = preg_replace_callback ( '|/\*\*(.+?)\*\*/|' , function ( $ match ) use ( & $ parameters ) { $ name = trim ( $ match [ 1 ] ) ; $ snippet = $ this -> builder -> resolveSnippet ( $ name , $ parameters ) ; return $ snippet ; } , $ this -> sql ) ; $ typ...
Resolve SQL statement .
240,498
public function create ( Description $ description ) { return new ContactEntity ( $ description -> getOptionalProperty ( 'phone' ) , $ description -> getOptionalProperty ( 'twitter' ) , $ description -> getOptionalProperty ( 'facebook' ) ) ; }
Create contact information from a description .
240,499
public function addWorker ( $ worker ) { if ( ! $ worker instanceof Worker ) { throw new \ Exception ( '$worker is not an instance of Worker' ) ; } $ this -> workerList [ $ worker -> getId ( ) ] = $ worker ; return $ this ; }
Adds a worker to the action .