idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
54,900 | public static function get ( $ containerState ) { if ( in_array ( $ containerState , ContainerStateKeys :: getContainerStates ( ) ) ) { return new ContainerStateKeys ( $ containerState ) ; } throw new InvalidContainerStateException ( sprintf ( 'Requested container state %s is not available (choose on of: %s)' , $ conta... | Factory method to create a new container state instance . |
54,901 | public function run ( ) { try { require SERVER_AUTOLOADER ; set_error_handler ( array ( & $ this , 'errorHandler' ) ) ; register_shutdown_function ( array ( & $ this , 'shutdown' ) ) ; $ this -> errors = array ( ) ; $ application = $ this -> application ; $ application -> registerClassLoaders ( ) ; $ application -> reg... | The main method that handles the thread in a separate context . |
54,902 | public function copyToHttpResponse ( ResponseInterface $ httpResponse ) { $ servletResponse = $ this -> servletResponse ; $ httpResponse -> setStatusCode ( $ servletResponse -> getStatusCode ( ) ) ; $ httpResponse -> setStatusReasonPhrase ( $ servletResponse -> getStatusReasonPhrase ( ) ) ; $ httpResponse -> setVersion... | Copies the values from the request handler back to the passed HTTP response instance . |
54,903 | public function addError ( ErrorInterface $ error ) { $ errors = $ this -> errors ; $ errors [ ] = $ error ; $ this -> errors = $ errors ; } | Append the passed error to the request handler s stack . |
54,904 | protected function doExcute ( array $ command = array ( ) ) { try { $ lookupName = sprintf ( 'php:global/combined-appserver/%s/ApplicationInterface' , array_shift ( $ command ) ) ; $ application = $ this -> getNamingDirectory ( ) -> search ( $ lookupName ) ; $ consoleManager = $ application -> search ( ConsoleContextIn... | Execute the Doctrine CLI tool . |
54,905 | public function registerServlets ( ApplicationInterface $ application ) { $ objectManager = $ this -> getApplication ( ) -> search ( ObjectManagerInterface :: IDENTIFIER ) ; foreach ( $ objectManager -> getObjectDescriptors ( ) as $ descriptor ) { if ( $ descriptor instanceof ServletDescriptorInterface ) { $ this -> re... | Finds all servlets which are provided by the webapps and initializes them . |
54,906 | public function registerServlet ( ServletDescriptorInterface $ descriptor ) { try { foreach ( $ descriptor -> getUrlPatterns ( ) as $ pattern ) { $ this -> addServletMapping ( $ pattern , $ descriptor -> getName ( ) ) ; } $ this -> registerReferences ( $ descriptor ) ; } catch ( \ Exception $ e ) { $ this -> getApplica... | Register the servlet described by the passed descriptor . |
54,907 | public function getServlet ( $ key ) { if ( $ this -> servlets -> has ( $ key ) ) { return $ this -> servlets -> get ( $ key ) ; } } | Returns the servlet with the passed name . |
54,908 | public function getServletByMapping ( $ urlMapping ) { if ( isset ( $ this -> servletMappings [ $ urlMapping ] ) ) { return $ this -> getServlet ( $ this -> servletMappings [ $ urlMapping ] ) ; } } | Returns the servlet for the passed URL mapping . |
54,909 | public function getInitParameter ( $ name ) { if ( $ this -> initParameters -> has ( $ name ) ) { return $ this -> initParameters -> get ( $ name ) ; } } | Returns the init parameter with the passed name . |
54,910 | public function getSessionParameter ( $ name ) { if ( $ this -> sessionParameters -> has ( $ name ) ) { return $ this -> sessionParameters -> get ( $ name ) ; } } | Returns the session parameter with the passed name . |
54,911 | public function init ( ServerContextInterface $ serverContext ) { $ this -> serverContext = $ serverContext ; if ( $ serverContext -> hasLogger ( LoggerUtils :: PROFILE ) ) { $ this -> profileLogger = $ serverContext -> getLogger ( LoggerUtils :: PROFILE ) ; } } | Initiates the module |
54,912 | public function process ( RequestInterface $ request , ResponseInterface $ response , RequestContextInterface $ requestContext , $ hook ) { if ( ModuleHooks :: RESPONSE_POST === $ hook && $ this -> profileLogger instanceof ThreadSafeLoggerInterface ) { $ this -> profileLogger -> debug ( $ request -> getUri ( ) ) ; } } | Implement s module logic for given hook |
54,913 | public function getAttribute ( $ key ) { if ( $ this -> data -> has ( $ key ) ) { return $ this -> data -> get ( $ key ) ; } } | Returns the attribute with the passed key from the container . |
54,914 | public function parseObjectDescriptors ( ) { $ managerConfiguration = $ this -> getManagerConfiguration ( ) ; $ objectDescription = $ managerConfiguration -> getObjectDescription ( ) ; foreach ( $ objectDescription -> getParsers ( ) as $ parserConfiguration ) { if ( $ parserFactoryConfiguration = $ parserConfiguration ... | Parse the manager s object descriptors . |
54,915 | public function findAll ( ) { try { $ cronInstances = array ( ) ; $ configurationService = $ this -> newService ( 'AppserverIo\Appserver\Core\Api\ConfigurationService' ) ; $ baseCronPath = $ this -> getConfdDir ( 'cron.xml' ) ; $ configurationService -> validateFile ( $ baseCronPath , null ) ; $ cronInstance = new Cron... | Initializes the available CRON configurations and returns them . |
54,916 | protected function resolvePath ( $ webappPath , $ path = null ) { if ( $ path == null ) { $ path = $ webappPath ; } elseif ( $ path != null ) { if ( strpos ( $ path , '/' ) > 0 ) { $ path = sprintf ( '%s/%s' , $ webappPath , $ path ) ; } } return $ path ; } | Resolves the passed path . If the passed path is NULL the webapp path is used if the passed path is relative the webapp path is prepended . |
54,917 | public function getMethodAnnotation ( MethodInterface $ reflectionMethod , $ annotationName ) { return $ this -> getAnnotationReader ( ) -> getMethodAnnotation ( $ reflectionMethod -> toPhpReflectionMethod ( ) , $ annotationName ) ; } | Return s the method annotation with the passed name if available . |
54,918 | public function callTimeout ( TimerInterface $ timer , MethodInterface $ timeoutMethod = null ) { try { $ application = $ this -> getApplication ( ) ; $ application -> registerClassLoaders ( ) ; $ application -> registerAnnotationRegistries ( ) ; $ initialContext = new InitialContext ( ) ; $ initialContext -> injectApp... | Responsible for invoking the timeout method on the target object . |
54,919 | public function findAll ( ) { $ virtualHostNodes = array ( ) ; foreach ( $ this -> getSystemConfiguration ( ) -> getContainers ( ) as $ containerNodes ) { foreach ( $ containerNodes -> getServers ( ) as $ serverNode ) { foreach ( $ serverNode -> getVirtualHosts ( ) as $ virtualHostNode ) { $ virtualHostNodes [ $ virtua... | Returns all configured virtual hosts . |
54,920 | public function load ( $ uuid ) { foreach ( $ this -> findAll ( ) as $ virtualHostNode ) { if ( $ virtualHostNode -> getPrimaryKey ( ) == $ uuid ) { return $ virtualHostNode ; } } } | Returns the virtual host with the passed UUID . |
54,921 | public function getBaseDirectory ( $ directoryToAppend = null ) { $ baseDirectory = $ this -> getSystemConfiguration ( ) -> getBaseDirectory ( ) ; if ( $ directoryToAppend != null ) { $ baseDirectory .= $ this -> makePathAbsolute ( $ directoryToAppend ) ; } return $ baseDirectory ; } | Returns the application servers base directory . |
54,922 | public function getDirectories ( ) { $ directories = array ( ) ; foreach ( DirectoryKeys :: getServerDirectoryKeys ( ) as $ directoryKey ) { $ directories [ $ directoryKey ] = $ this -> getSystemConfiguration ( ) -> getParam ( $ directoryKey ) ; } return $ directories ; } | Returns the directory structure to be created at first start . |
54,923 | public function getFiles ( ) { $ files = array ( ) ; foreach ( FileKeys :: getServerFileKeys ( ) as $ fileKey ) { $ files [ $ fileKey ] = $ this -> getSystemConfiguration ( ) -> getParam ( $ fileKey ) ; } return $ files ; } | Returns the files to be created at first start . |
54,924 | public function makePathAbsolute ( $ path = '' ) { if ( empty ( $ path ) === false ) { return DIRECTORY_SEPARATOR . trim ( DirectoryKeys :: realpath ( $ path ) , DIRECTORY_SEPARATOR ) ; } } | Makes the path an absolute path or returns null if passed path is empty . |
54,925 | public function getTmpDir ( ContainerConfigurationInterface $ containerNode , $ relativePathToAppend = '' ) { return $ this -> realpath ( $ this -> makePathAbsolute ( $ containerNode -> getHost ( ) -> getTmpBase ( ) . $ this -> makePathAbsolute ( $ relativePathToAppend ) ) ) ; } | Returns the servers tmp directory append with the passed directory . |
54,926 | public function getDeployDir ( ContainerConfigurationInterface $ containerNode , $ relativePathToAppend = '' ) { return $ this -> realpath ( $ this -> makePathAbsolute ( $ containerNode -> getHost ( ) -> getDeployBase ( ) . $ this -> makePathAbsolute ( $ relativePathToAppend ) ) ) ; } | Returns the servers deploy directory . |
54,927 | public function getLogDir ( $ relativePathToAppend = '' ) { return $ this -> realpath ( $ this -> makePathAbsolute ( $ this -> getSystemConfiguration ( ) -> getParam ( DirectoryKeys :: VAR_LOG ) . $ this -> makePathAbsolute ( $ relativePathToAppend ) ) ) ; } | Returns the servers log directory . |
54,928 | public function getVendorDir ( $ relativePathToAppend = '' ) { return $ this -> realpath ( $ this -> makePathAbsolute ( $ this -> getSystemConfiguration ( ) -> getParam ( DirectoryKeys :: VENDOR ) . $ this -> makePathAbsolute ( $ relativePathToAppend ) ) ) ; } | Return s the system s vendor directory . |
54,929 | public function getSystemTmpDir ( $ relativePathToAppend = '' ) { return $ this -> realpath ( $ this -> makePathAbsolute ( $ this -> getSystemConfiguration ( ) -> getParam ( DirectoryKeys :: TMP ) . $ this -> makePathAbsolute ( $ relativePathToAppend ) ) ) ; } | Return s the system s temporary directory . |
54,930 | public function getEtcDir ( $ relativePathToAppend = '' ) { return $ this -> realpath ( $ this -> makePathAbsolute ( $ this -> getSystemConfiguration ( ) -> getParam ( DirectoryKeys :: ETC ) . $ this -> makePathAbsolute ( $ relativePathToAppend ) ) ) ; } | Return s the server s base configuration directory . |
54,931 | public function getConfDir ( $ relativePathToAppend = '' ) { return $ this -> realpath ( $ this -> makePathAbsolute ( $ this -> getSystemConfiguration ( ) -> getParam ( DirectoryKeys :: ETC_APPSERVER ) . $ this -> makePathAbsolute ( $ relativePathToAppend ) ) ) ; } | Return s the server s main configuration directory . |
54,932 | public function getConfdDir ( $ relativePathToAppend = '' ) { return $ this -> realpath ( $ this -> makePathAbsolute ( $ this -> getSystemConfiguration ( ) -> getParam ( DirectoryKeys :: ETC_APPSERVER_CONFD ) . $ this -> makePathAbsolute ( $ relativePathToAppend ) ) ) ; } | Return s the server s configuration subdirectory . |
54,933 | public function getSystemProperties ( ContainerConfigurationInterface $ containerNode = null , ApplicationInterface $ application = null ) { $ properties = Properties :: create ( ) ; $ properties -> add ( SystemPropertyKeys :: BASE , $ this -> getBaseDirectory ( ) ) ; $ properties -> add ( SystemPropertyKeys :: VAR_LOG... | Returns the system proprties . If a container node has been passed the container properties will also be appended . |
54,934 | public function initialize ( ApplicationInterface $ application ) { $ servletManager = $ application -> search ( ServletContextInterface :: IDENTIFIER ) ; $ sessionSettings = $ this -> getSessionSettings ( ) ; $ sessionSettings -> setSessionSavePath ( $ application -> getSessionDir ( ) ) ; if ( $ servletManager -> hasS... | Initializes the session manager . |
54,935 | public function create ( $ id , $ name , $ lifetime = null , $ maximumAge = null , $ domain = null , $ path = null , $ secure = null , $ httpOnly = null ) { if ( $ lifetime == null ) { $ lifetime = time ( ) + $ this -> getSessionSettings ( ) -> getSessionCookieLifetime ( ) ; } if ( $ maximumAge == null ) { $ maximumAge... | Creates a new session with the passed session ID and session name if given . |
54,936 | public function find ( $ id ) { if ( empty ( $ id ) ) { return ; } $ session = null ; if ( $ this -> getSessions ( ) -> exists ( $ id ) ) { $ session = $ this -> getSessions ( ) -> get ( $ id ) ; } else { foreach ( $ this -> getSessionHandlers ( ) as $ sessionHandler ) { try { if ( $ session = $ sessionHandler -> load ... | Tries to find a session for the given request . The session - ID will be searched in the cookie header of the request and in the request query string . If both values are present the value in the query string takes precedence . If no session id is found a new one is created and assigned to the request . |
54,937 | public function flush ( ) { foreach ( $ this -> getSessions ( ) as $ session ) { foreach ( $ this -> getSessionHandlers ( ) as $ sessionHandler ) { try { $ sessionHandler -> save ( $ session ) ; } catch ( \ Exception $ e ) { if ( $ logger = $ this -> getLogger ( LoggerUtils :: SYSTEM ) ) { $ logger -> error ( $ e -> __... | Flushes the session storage and persists all sessions . |
54,938 | public function getLogger ( $ loggerName ) { try { if ( $ logger = $ this -> getApplication ( ) -> getLogger ( $ loggerName ) ) { return $ logger ; } return $ this -> getApplication ( ) -> getNamingDirectory ( ) -> search ( sprintf ( 'php:global/log/%s' , $ loggerName ) ) ; } catch ( NamingException $ ne ) { } } | Return s the logger with the requested name . First we look in the application and then in the system itself . |
54,939 | public function login ( ) { $ this -> loginOk = false ; if ( $ this -> useFirstPass ) { $ name = $ this -> sharedState -> get ( SharedStateKeys :: LOGIN_NAME ) ; $ password = $ this -> sharedState -> get ( SharedStateKeys :: LOGIN_PASSWORD ) ; if ( $ name && $ password ) { $ this -> loginOk = true ; return true ; } } r... | Looks for servlet_engine . authentication . login_module . login_name and servlet_engine . authentication . login_module . login_password values in the sharedState map if the useFirstPass option was true and returns TRUE if they exist . If they do not or are NULL this method returns FALSE . |
54,940 | public function logout ( ) { $ identity = $ this -> getIdentity ( ) ; $ principals = $ this -> subject -> getPrincipals ( ) ; foreach ( $ principals as $ key => $ principal ) { if ( $ identity -> equals ( $ principal ) ) { $ principals -> remove ( $ key ) ; } } return true ; } | Remove the user identity and roles added to the Subject during commit . |
54,941 | public function createIdentity ( String $ name ) { $ principal = null ; if ( $ this -> principalClassName == null ) { $ principal = new SimplePrincipal ( $ name ) ; } else { $ reflectionClass = new ReflectionClass ( $ this -> principalClassName -> __toString ( ) ) ; $ principal = $ reflectionClass -> newInstanceArgs ( ... | Utility method to create a Principal for the given username . This creates an instance of the principalClassName type if this option was specified . If principalClassName was not specified a SimplePrincipal is created . |
54,942 | protected function createGroup ( String $ name , CollectionInterface $ principals ) { $ roles = null ; foreach ( $ principals as $ principal ) { if ( ( $ principal instanceof GroupInterface ) == false ) { continue ; } $ grp = $ principal ; if ( $ grp -> getName ( ) -> equals ( $ name ) ) { $ roles = $ grp ; break ; } }... | Find or create a Group with the given name . Subclasses should use this method to locate the Roles group or create additional types of groups . |
54,943 | public function init ( ) { $ this -> heartbeatFile = APPSERVER_BP . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'run' . DIRECTORY_SEPARATOR . self :: HEARTBEAT_FILE_NAME ; parent :: init ( ) ; } | Initializes the scanner |
54,944 | public function main ( ) { $ this -> getSystemLogger ( ) -> debug ( sprintf ( "Start watching heartbeat file %s" , $ this -> getHeartbeatFile ( ) ) ) ; while ( $ this -> getLastFileTouch ( $ this -> getHeartbeatFile ( ) ) === 0 ) { $ this -> getSystemLogger ( ) -> debug ( 'Heartbeat scanner is waiting for first success... | The thread implementation main method which will be called from run in abstractness |
54,945 | public function newFromApplication ( ApplicationInterface $ application ) { $ appNode = new AppNode ( ) ; $ appNode -> initFromApplication ( $ application ) ; $ appNode -> setParentUuid ( $ this -> getSystemConfiguration ( ) -> getUuid ( ) ) ; $ this -> persist ( $ appNode ) ; } | Creates a new app node for the passed application and attaches it to the system configuration . |
54,946 | public function findAllByName ( $ name ) { $ appNodes = array ( ) ; foreach ( $ this -> findAll ( ) as $ appNode ) { if ( $ appNode -> getName ( ) == $ name ) { $ appNodes [ $ appNode -> getPrimaryKey ( ) ] = $ appNode ; } } return $ appNodes ; } | Returns the applications with the passed name . |
54,947 | public function getExtractor ( ) { if ( ! isset ( $ this -> extractor ) ) { $ configuration = $ this -> getSystemConfiguration ( ) -> getExtractors ( ) ; if ( isset ( $ configuration [ self :: DEFAULT_EXTRACTOR_NAME ] ) ) { $ this -> extractor = new PharExtractor ( $ this -> getInitialContext ( ) , $ configuration [ se... | Getter for this service s extractor |
54,948 | public function load ( $ uuid ) { foreach ( $ this -> findAll ( ) as $ appNode ) { if ( $ appNode -> getPrimaryKey ( ) == $ uuid ) { return $ appNode ; } } } | Returns the application with the passed UUID . |
54,949 | public function loadByWebappPath ( $ webappPath ) { foreach ( $ this -> findAll ( ) as $ appNode ) { if ( $ appNode -> getWebappPath ( ) == $ webappPath ) { return $ appNode ; } } } | Returns the application with the passed webapp path . |
54,950 | public function persist ( NodeInterface $ appNode ) { $ systemConfiguration = $ this -> getSystemConfiguration ( ) ; $ systemConfiguration -> attachApp ( $ appNode ) ; $ this -> setSystemConfiguration ( $ systemConfiguration ) ; } | Persists the system configuration . |
54,951 | public function soak ( ContainerConfigurationInterface $ containerNode , \ SplFileInfo $ archive ) { $ extractor = $ this -> getExtractor ( ) ; $ extractor -> soakArchive ( $ containerNode , $ archive ) ; } | Soaks the passed archive into from a location in the filesystem to the deploy directory . |
54,952 | public function deploy ( ContainerConfigurationInterface $ containerNode , NodeInterface $ appNode ) { $ extractor = $ this -> getExtractor ( ) ; $ fileName = $ appNode -> getName ( ) . $ extractor -> getExtensionSuffix ( ) ; $ archive = new \ SplFileInfo ( $ this -> getDeployDir ( $ containerNode ) . DIRECTORY_SEPARAT... | Adds the . dodeploy flag file in the deploy folder therefore the app will be deployed with the next restart . |
54,953 | public function undeploy ( ContainerConfigurationInterface $ containerNode , $ uuid ) { if ( $ appNode = $ this -> load ( $ uuid ) ) { $ extractor = $ this -> getExtractor ( ) ; $ fileName = $ appNode -> getName ( ) . $ extractor -> getExtensionSuffix ( ) ; $ archive = new \ SplFileInfo ( $ this -> getDeployDir ( $ con... | Removes the . deployed flag file from the deploy folder therefore the app will be undeployed with the next restart . |
54,954 | public function createTmpFolders ( ApplicationInterface $ application ) { $ tmpFolders = array ( new \ SplFileInfo ( $ application -> getTmpDir ( ) ) , new \ SplFileInfo ( $ application -> getDataDir ( ) ) , new \ SplFileInfo ( $ application -> getCacheDir ( ) ) , new \ SplFileInfo ( $ application -> getSessionDir ( ) ... | Creates the temporary directory for the webapp . |
54,955 | public function getUpstreamServersAsArray ( ) { $ upstreamServers = array ( ) ; foreach ( $ this -> getUpstreamServers ( ) as $ upstreamServerNode ) { $ upstreamServers [ ] = array ( 'name' => $ upstreamServerNode -> getName ( ) , 'type' => $ upstreamServerNode -> getType ( ) , 'params' => $ upstreamServerNode -> getPa... | Returns the upstream servers as an associative array |
54,956 | public static function getLinuxDistro ( ) { $ distros = array ( SetupKeys :: OS_ARCH => 'arch-release' , SetupKeys :: OS_DEBIAN => 'debian_version' , SetupKeys :: OS_FEDORA => 'fedora-release' , SetupKeys :: OS_UBUNTU => 'lsb-release' , SetupKeys :: OS_REDHAT => 'redhat-release' , SetupKeys :: OS_CENTOS => 'centos-rele... | Returns the Linux distribution we re running on . |
54,957 | public static function prepareProperties ( $ os , array $ contextProperties ) { Setup :: $ mergedProperties = array_merge ( $ contextProperties , Setup :: $ defaultProperties , Setup :: $ osProperties [ $ os ] ) ; Setup :: $ mergedProperties [ SetupKeys :: OS_IDENTIFIER ] = sprintf ( '%s_%s_%s' , str_replace ( ' ' , '-... | Merge the properties based on the passed OS . |
54,958 | public static function prepareContext ( $ installDir = null , $ event = null ) { if ( is_null ( $ installDir ) ) { $ installDir = getcwd ( ) ; } $ version = '' ; if ( file_exists ( $ filename = $ installDir . '/etc/appserver/.release-version' ) ) { $ version = file_get_contents ( $ filename ) ; } else { if ( ! is_null ... | Prepares the context by given event or without event for other usage |
54,959 | public static function copyOsSpecificResource ( $ os , $ resource , $ override = false , $ mode = 0644 ) { $ installDir = Setup :: getValue ( SetupKeys :: INSTALL_DIR ) ; $ source = Setup :: prepareOsSpecificPath ( sprintf ( '%s/resources/os-specific/%s/%s' , $ installDir , $ os , $ resource ) ) ; $ target = Setup :: p... | Copies the passed OS specific resource file to the target directory . |
54,960 | public static function processOsSpecificTemplate ( $ os , $ template , $ override = false , $ mode = 0644 ) { $ targetFile = Setup :: prepareOsSpecificPath ( $ template ) ; if ( $ override === false && is_file ( $ targetFile ) === true ) { return ; } Setup :: prepareDirectory ( $ template ) ; ob_start ( ) ; include Set... | Processes the OS specific template and replace the properties with the OS specific values . |
54,961 | public static function changeFilePermissions ( $ filename , $ mode = 0644 ) { $ toBeChanged = Setup :: prepareOsSpecificPath ( $ filename ) ; if ( SetupKeys :: OS_FAMILY_WINDOWS !== strtolower ( php_uname ( 's' ) ) ) { chmod ( $ toBeChanged , $ mode ) ; } } | Sets the passed mode for the file if NOT on Windows . |
54,962 | public static function prepareDirectory ( $ directory , $ mode = 0775 ) { $ toBePreapared = Setup :: prepareOsSpecificPath ( $ directory ) ; if ( is_dir ( dirname ( $ toBePreapared ) ) === false ) { mkdir ( dirname ( $ toBePreapared ) , $ mode , true ) ; } } | Prepares the passed directory if necessary . |
54,963 | public function init ( StackableStructureMap $ structureMap , AspectRegister $ aspectRegister ) { $ this -> structureMap = $ structureMap ; $ this -> aspectRegister = $ aspectRegister ; $ config = $ this -> getConfig ( ) ; $ this -> cacheDir = $ config -> getValue ( 'cache/dir' ) ; $ this -> environment = $ config -> g... | Initializes the autoloader with the values from the configuration and creates and fills the structure map instance . |
54,964 | public function createCache ( ) { $ fileIterator = new \ FilesystemIterator ( $ this -> getConfig ( ) -> getValue ( 'cache/dir' ) , \ FilesystemIterator :: SKIP_DOTS ) ; if ( iterator_count ( $ fileIterator ) <= 1 || $ this -> getConfig ( ) -> getValue ( 'environment' ) === 'development' ) { $ this -> fillCache ( ) ; }... | Will start the generation of the cache based on the known structures |
54,965 | protected function createDefinitions ( ) { $ structures = $ this -> structureMap -> getEntries ( ) ; $ cacheMap = new CacheMap ( $ this -> getConfig ( ) -> getValue ( 'cache/dir' ) , array ( ) , $ this -> getConfig ( ) ) ; $ generator = new Generator ( $ this -> structureMap , $ cacheMap , $ this -> getConfig ( ) , $ t... | Creates the definitions by given structure map |
54,966 | protected function refillCache ( ) { foreach ( new \ DirectoryIterator ( $ this -> getConfig ( ) -> getValue ( 'cache/dir' ) ) as $ fileInfo ) { if ( ! $ fileInfo -> isDot ( ) && ! $ fileInfo -> isDir ( ) ) { unlink ( $ fileInfo -> getPathname ( ) ) ; } } return $ this -> createDefinitions ( ) ; } | We will refill the cache dir by emptying it and filling it again |
54,967 | public function register ( $ throw = true , $ prepend = true ) { $ this -> getConfig ( ) -> storeInstances ( ) ; if ( ! $ this -> cacheIsReady || $ this -> environment !== 'production' ) { spl_autoload_register ( array ( $ this , self :: OUR_LOADER ) , $ throw , $ prepend ) ; return ; } spl_autoload_register ( array ( ... | Will register our autoloading method at the beginning of the spl autoloader stack |
54,968 | public function unregister ( ) { if ( ! $ this -> cacheIsReady || $ this -> environment !== 'production' ) { spl_autoload_unregister ( array ( $ this , self :: OUR_LOADER ) ) ; return ; } spl_autoload_unregister ( array ( $ this , self :: OUR_LOADER_PROD_NO_OMIT ) ) ; } | Uninstalls this class loader from the SPL autoloader stack . |
54,969 | public function set ( $ key , $ value , $ subKey = null ) { if ( ! is_null ( $ subKey ) && ( is_array ( $ this -> data [ $ key ] ) ) ) { $ this -> data [ $ key ] [ $ subKey ] = $ value ; } else { $ this -> data [ $ key ] = $ value ; } } | Sets value for specific key with optional subkey |
54,970 | public function get ( $ key , $ subKey = null ) { if ( ! is_null ( $ subKey ) && ( is_array ( $ this -> data [ $ key ] ) ) ) { return $ this -> data [ $ key ] [ $ subKey ] ; } else { return $ this -> data [ $ key ] ; } } | Gets value for specific key with optional subkey |
54,971 | public function has ( $ key , $ subKey = null ) { if ( ! is_null ( $ subKey ) && ( is_array ( $ this -> data [ $ key ] ) ) ) { return isset ( $ this -> data [ $ key ] [ $ subKey ] ) ; } else { return isset ( $ this -> data [ $ key ] ) ; } } | Checks if specific key with options subkey exists |
54,972 | public function del ( $ key , $ subKey = null ) { if ( ! is_null ( $ subKey ) && ( is_array ( $ this -> data [ $ key ] ) ) ) { unset ( $ this -> data [ $ key ] [ $ subKey ] ) ; } else { unset ( $ this -> data [ $ key ] ) ; } } | Deletes specific key with options subkey entry in data |
54,973 | protected function unmarshall ( $ marshalled ) { $ servletSession = Session :: emptyInstance ( ) ; $ this -> getSessionMarshaller ( ) -> unmarshall ( $ servletSession , $ marshalled ) ; return $ servletSession ; } | Initializes the session instance from the passed JSON string . If the encoded data contains objects they will be unserialized before reattached to the session instance . |
54,974 | protected function sessionTimedOut ( ServletSessionInterface $ session ) { $ inactivityTimeout = $ this -> getSessionSettings ( ) -> getInactivityTimeout ( ) ; $ lastActivitySecondsAgo = time ( ) - $ session -> getLastActivityTimestamp ( ) ; if ( $ inactivityTimeout < 1 ) { $ inactivityTimeout = $ lastActivitySecondsAg... | Querys whether or not the passed session has timed out . |
54,975 | public function fromDatabaseNode ( DatabaseConfigurationInterface $ databaseNode ) { $ connectionParameters = array ( 'driver' => $ databaseNode -> getDriver ( ) -> getNodeValue ( ) -> __toString ( ) ) ; if ( $ pathNode = $ databaseNode -> getPath ( ) ) { $ connectionParameters [ 'path' ] = $ pathNode -> getNodeValue (... | Creates an array with the connection parameters for a Doctrine DBAL connection from the passed database node . |
54,976 | public function newInstance ( $ className ) { \ Mutex :: lock ( $ this -> mutex ) ; $ this -> dispatched = false ; $ this -> className = $ className ; $ this -> notify ( ) ; while ( $ this -> dispatched === false ) { usleep ( 100 ) ; } if ( isset ( $ this -> instances [ $ last = sizeof ( $ this -> instances ) - 1 ] ) )... | Create a new instance with the passed data . |
54,977 | public function getAuthentication ( $ uri ) { foreach ( $ this -> getAuthentications ( ) as $ authenticationNode ) { if ( $ authenticationNode -> getUri ( ) === $ uri ) { return $ authenticationNode ; } } return false ; } | Will return the authentication node with the specified definition and if nothing could be found we will return false . |
54,978 | public function getAuthenticationsAsArray ( ) { $ authentications = array ( ) ; foreach ( $ this -> getAuthentications ( ) as $ authenticationNode ) { $ authentications [ $ authenticationNode -> getUri ( ) ] = $ authenticationNode -> getParamsAsArray ( ) ; } return $ authentications ; } | Returns the authentications as an associative array . |
54,979 | public function createIntervalTimer ( $ initialExpiration , $ intervalDuration , \ Serializable $ info = null , $ persistent = true ) { $ now = new \ DateTime ( ) ; $ now -> add ( new \ DateInterval ( sprintf ( 'PT%dS' , $ initialExpiration / 1000000 ) ) ) ; return $ this -> createTimer ( $ now , $ intervalDuration , $... | Create an interval timer whose first expiration occurs at a given point in time and whose subsequent expirations occur after a specified interval . |
54,980 | public function createSingleActionTimer ( $ duration , \ Serializable $ info = null , $ persistent = true ) { $ now = new \ DateTime ( ) ; $ now -> add ( new \ DateInterval ( sprintf ( 'PT%dS' , $ duration / 1000000 ) ) ) ; $ intervalDuration = 0 ; return $ this -> createTimer ( $ now , $ intervalDuration , $ info , $ ... | Create a single - action timer that expires after a specified duration . |
54,981 | public function scheduleTimeout ( TimerInterface $ timer , $ newTimer ) { if ( $ newTimer === false && $ this -> getTimers ( ) -> has ( $ timer -> getId ( ) ) === false ) { return ; } if ( $ timer -> getNextExpiration ( ) == null ) { return ; } $ this -> getTimerServiceExecutor ( ) -> schedule ( $ timer ) ; } | Creates and schedules a timer task for the next timeout of the passed timer . |
54,982 | public function start ( ) { foreach ( $ this -> getTimedObjectInvoker ( ) -> getTimeoutMethods ( ) as $ timeoutMethod ) { if ( $ timeoutMethod instanceof MethodInterface ) { $ annatationReader = new AnnotationReader ( ) ; $ schedule = $ annatationReader -> getMethodAnnotation ( $ timeoutMethod -> toPhpReflectionMethod ... | Creates the auto timer instances . |
54,983 | protected function getFlags ( ) { return array ( ExtractorInterface :: FLAG_DEPLOYED , ExtractorInterface :: FLAG_DEPLOYING , ExtractorInterface :: FLAG_DODEPLOY , ExtractorInterface :: FLAG_FAILED , ExtractorInterface :: FLAG_UNDEPLOYED , ExtractorInterface :: FLAG_UNDEPLOYING ) ; } | Returns all flags in array . |
54,984 | public function deployWebapps ( ) { foreach ( $ this -> getService ( ) -> getSystemConfiguration ( ) -> getContainers ( ) as $ containerNode ) { if ( is_dir ( $ deployDir = $ this -> getService ( ) -> getBaseDirectory ( $ containerNode -> getHost ( ) -> getDeployBase ( ) ) ) ) { $ fileIterator = new \ FilesystemIterato... | Will actually deploy all webapps . |
54,985 | public function flagArchive ( \ SplFileInfo $ archive , $ flag ) { $ this -> unflagArchive ( $ archive ) ; file_put_contents ( $ archive -> getPathname ( ) . $ flag , $ archive -> getPathname ( ) ) ; $ this -> setUserRight ( new \ SplFileInfo ( $ archive -> getPathname ( ) . $ flag ) ) ; } | Flags the archive in specific states of extraction |
54,986 | public function unflagArchive ( \ SplFileInfo $ archive ) { foreach ( $ this -> getFlags ( ) as $ flagString ) { if ( file_exists ( $ archive -> getRealPath ( ) . $ flagString ) ) { unlink ( $ archive -> getRealPath ( ) . $ flagString ) ; } } } | Deletes all old flags so the app will be undeployed with the next appserver restart . |
54,987 | public function restoreBackup ( ContainerConfigurationInterface $ containerNode , \ SplFileInfo $ archive ) { if ( $ this -> getExtractorNode ( ) -> isCreateBackups ( ) === false || $ this -> getExtractorNode ( ) -> isRestoreBackups ( ) === false ) { return ; } $ webappFolderName = $ this -> getWebappsDir ( $ container... | Restores the backup files from the backup directory . |
54,988 | public function getWebappsDir ( ContainerConfigurationInterface $ containerNode , $ relativePathToAppend = '' ) { return $ this -> getService ( ) -> realpath ( $ this -> getService ( ) -> makePathAbsolute ( $ containerNode -> getHost ( ) -> getAppBase ( ) . $ this -> getService ( ) -> makePathAbsolute ( $ relativePathT... | Returns the container s webapps directory . |
54,989 | protected function calculateNextTimeout ( TimerInterface $ timer ) { $ intervalDuration = $ timer -> getIntervalDuration ( ) ; if ( $ intervalDuration > 0 ) { $ nextExpiration = $ timer -> getNextExpiration ( ) ; return $ nextExpiration -> add ( new \ DateInterval ( sprintf ( 'PT%sS' , $ intervalDuration / 1000000 ) ) ... | Calculates and returns the next timeout for the passed timer . |
54,990 | protected function getDatasourceFiles ( ) { $ datasourceFiles = array ( ) ; if ( is_dir ( $ appBase = $ this -> getAppBase ( ) ) ) { $ datasourceFiles = array_merge ( $ datasourceFiles , $ this -> prepareDatasourceFiles ( $ this -> getDeploymentService ( ) -> globDir ( $ appBase . DIRECTORY_SEPARATOR . '*-ds.xml' , 0 ,... | Returns all datasource files we potentially use |
54,991 | protected function prepareDatasourceFiles ( array $ datasourceFiles ) { $ ds = array ( ) ; foreach ( $ datasourceFiles as $ datasourceFile ) { $ contextPath = explode ( DIRECTORY_SEPARATOR , ltrim ( str_replace ( sprintf ( '%s' , $ this -> getAppBase ( ) ) , '' , $ datasourceFile ) , DIRECTORY_SEPARATOR ) ) ; $ context... | Prepares the datasource files by adding the found context name and the webapp path if available . |
54,992 | protected function deployDatasources ( ) { $ container = $ this -> getContainer ( ) ; if ( $ datasourceFiles = $ this -> getDatasourceFiles ( ) ) { $ namingDirectory = $ container -> getNamingDirectory ( ) ; $ namingDirectory -> createSubdirectory ( sprintf ( 'php:env/%s/ds' , $ this -> getContainer ( ) -> getName ( ) ... | Deploys the available root directory datasources . |
54,993 | protected function deployApplications ( ) { $ container = $ this -> getContainer ( ) ; $ contextInstances = $ this -> loadContextInstances ( ) ; foreach ( $ contextInstances as $ context ) { if ( $ applicationFactory = $ context -> getFactory ( ) ) { $ applicationFactory :: visit ( $ container , $ context ) ; } else { ... | Deploys the available applications . |
54,994 | protected function unpersist ( $ id ) { if ( apc_exists ( $ id ) === false ) { return ; } if ( ( $ marshalled = apc_fetch ( $ id ) ) === false ) { throw new SessionDataNotReadableException ( sprintf ( 'Can\'t load session with ID %s' , $ id ) ) ; } return $ this -> unmarshall ( $ marshalled ) ; } | Tries to load the session data with the passed ID . |
54,995 | public function execute ( ConnectionInterface $ connection , array $ argv ) { $ input = new ArgvInput ( $ argv ) ; $ output = new BufferedOutput ( ) ; $ executionContext = new ExecutionContext ( ) ; $ executionContext -> injectInput ( $ input ) ; $ executionContext -> injectOutput ( $ output ) ; $ executionContext -> i... | Executes the command with defined by the passed input . |
54,996 | public function registerBeans ( ApplicationInterface $ application ) { $ this -> parseObjectDescriptors ( ) ; $ objectManager = $ this -> getApplication ( ) -> search ( ObjectManagerInterface :: IDENTIFIER ) ; foreach ( $ objectManager -> getObjectDescriptors ( ) as $ descriptor ) { if ( $ descriptor instanceof BeanDes... | Registers the message beans at startup . |
54,997 | public function registerBean ( BeanDescriptorInterface $ descriptor ) { try { $ application = $ this -> getApplication ( ) ; $ application -> getNamingDirectory ( ) -> bind ( sprintf ( 'php:global/%s/%s' , $ application -> getUniqueName ( ) , $ descriptor -> getName ( ) ) , array ( & $ this , 'lookup' ) , array ( $ des... | Register the bean described by the passed descriptor . |
54,998 | public function lookupStatefulSessionBean ( $ sessionId , $ className ) { $ identifier = SessionBeanUtil :: createIdentifier ( $ sessionId , $ className ) ; $ sessionBeans = $ this -> getStatefulSessionBeans ( ) ; if ( $ sessionBeans -> exists ( $ identifier ) ) { return $ sessionBeans -> get ( $ identifier ) ; } } | Retrieves the requested stateful session bean . |
54,999 | public function removeStatefulSessionBean ( $ sessionId , $ className ) { $ identifier = SessionBeanUtil :: createIdentifier ( $ sessionId , $ className ) ; $ sessionBeans = $ this -> getStatefulSessionBeans ( ) ; if ( $ sessionBeans -> exists ( $ identifier ) ) { $ sessionBeans -> remove ( $ identifier , array ( $ thi... | Removes the stateful session bean with the passed session - ID and class name from the bean manager . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.