includes/phing/src/Tasks/PropertiesValidateTask.php
protected function checkLoadProperties($propertiesFile, $propertyType)
    {

        if ($propertiesFile->exists() && $propertiesFile->isDirectory()) {
            $message = $propertyType." is a directory!";
            $this->_haltOnErrorAction(null, $message, Project::MSG_ERR);
            return;
        }

        if ($propertiesFile->exists() && !$propertiesFile->canRead()) {
            $message = "Can not read from the specified ".$propertyType."!";
            $this->_haltOnErrorAction(null, $message, Project::MSG_ERR);
            return;
        }

        $fileParserFactory = new FileParserFactory();
        $fileParser        = $fileParserFactory->createParser($propertiesFile->getFileExtension());
        $properties        = new Properties(null, $fileParser);

        $properties->load($propertiesFile);

        return $properties->getProperties();

    }
protected function checkLoadProperties($propertiesFile, $propertyType)
    {

        if ($propertiesFile->exists() && $propertiesFile->isDirectory()) {
            $message = $propertyType." is a directory!";
            $this->_haltOnErrorAction(null, $message, Project::MSG_ERR);
            return;
        }

        if ($propertiesFile->exists() && !$propertiesFile->canRead()) {
            $message = "Can not read from the specified ".$propertyType."!";
            $this->_haltOnErrorAction(null, $message, Project::MSG_ERR);
            return;
        }

        $fileParserFactory = new FileParserFactory();
        $fileParser        = $fileParserFactory->createParser($propertiesFile->getFileExtension());
        $properties        = new Properties(null, $fileParser);

        $properties->load($propertiesFile);

        return $properties->getProperties();

    }
protected function checkLoadProperties ( $ propertiesFile , $ propertyType ) { if ( $ propertiesFile -> exists ( ) && $ propertiesFile -> isDirectory ( ) ) { $ message = $ propertyType . " is a directory!" ; $ this -> _haltOnErrorAction ( null , $ message , Project :: MSG_ERR ) ; return ; } if ( $ propertiesFile -> exists ( ) && ! $ propertiesFile -> canRead ( ) ) { $ message = "Can not read from the specified " . $ propertyType . "!" ; $ this -> _haltOnErrorAction ( null , $ message , Project :: MSG_ERR ) ; return ; } $ fileParserFactory = new FileParserFactory ( ) ; $ fileParser = $ fileParserFactory -> createParser ( $ propertiesFile -> getFileExtension ( ) ) ; $ properties = new Properties ( null , $ fileParser ) ; $ properties -> load ( $ propertiesFile ) ; return $ properties -> getProperties ( ) ; }
Check if we can load the file and return the properties.

@param phingFile $propertiesFile Properties file
@param string    $propertyType   Type of file

@throws BuildException

@return array
Check if we can load the file and return the properties .