@param CoverFishPHPUnitFile $coverFishUnitFile

@return null
163542
protected function writeFileName(CoverFishPHPUnitFile $coverFishUnitFile)
    {
        if (true === $this->outputFormatJson || 0 === $this->outputLevel) {
            return null;
        }

        $file = $this->coverFishHelper->getFileNameFromPath($coverFishUnitFile->getFile());
        $fileNameLine = sprintf('%s%s%s',
            (false === $this->preventAnsiColors)
                ? Color::tplNormalColor(($this->outputLevel > 1) ? 'scan file ' : null)
                : 'scan file '
            ,
            (false === $this->preventAnsiColors)
                ? Color::tplYellowColor($file)
                : $file
            ,
            ($this->outputLevel > 1) ? PHP_EOL : ' '
        );

        $this->write($fileNameLine);
    }
291107
public function actionIndex($configFile = false)
    {
        echo "Start building PHAR package...\n";

        $this->loadConfiguration($configFile);

        $this->clean(false);

        $phar = new \Phar(\Yii::getAlias($this->module->path), 0, $this->module->pharName);

        Builder::addFilesFromIterator($phar, $this->module);
        Builder::addStub($phar, $this->module->stub);
        Builder::addCompress($phar, $this->module->compress);
        Builder::addSignature($phar, $this->module->signature, $this->module->openSSLPrivateKeyAlias);

        echo "\n\nFinish\n";
    }
882548
private function loadConfigFile($configFile)
    {
        if ($this->useCache) {
            if (function_exists('apc_fetch')) {
                $config = apc_fetch($configFile);
            } elseif (function_exists('apcu_fetch')) {
                $config = apcu_fetch($configFile);
            }

            if (!empty($config)) {
                return $config;
            }
        }

        if (!is_readable($configFile)) {
            throw new FileNotFoundException("File $configFile could not be found.");
        }

        try {
            $config = $this->parser->parse(file_get_contents($configFile));
        } catch (ParseException $e) {
            $line = $e->getParsedLine();
            throw new InvalidConfigFileException(
                "File $configFile does not have a valid format (line $line)"
            );
        }

        if ($this->useCache) {
            if (function_exists('apc_store')) {
                apc_store($configFile, $config);
            } elseif (function_exists('apcu_store')) {
                apcu_store($configFile, $config);
            }
        }

        return $config;
    }
833392
function GetStatus()
    {
        if (IO\File::Exists($this->targetFile))
        {
            $json = IO\File::GetContents($this->targetFile);
            return json_decode($json);
        }
        return null;
    }
521336
public static function init($configFile='config/settings.yml', $localConfigFile='config/settings.local.yml')
    {
        // Check what php SAPI is being used
        self::$_cli = false;
        if (strcmp(php_sapi_name(), 'cli') === 0)
            self::$_cli = true;

        // Initialize application services, Store application Object as a global
        // Services are available from global app.
        $GLOBALS['app']    = $app = new self();
        $GLOBALS['logger'] = LoggerFactory::instance()->getLogger();
        $GLOBALS['routeLogger'] = LoggerFactory::instance()->getLogger();

        $configFactory     = new ConfigurationFactory($configFile, $localConfigFile);
        $app->_config      = $configFactory->getConfig();
        
        $logFolder =  getcwd().'/logs';
        if (!file_exists($logFolder)) {
            if(!mkdir($logFolder)) {
                $logFolder = sys_get_temp_dir().'/logs';
                if(!file_exists($logFolder) && !mkdir($logFolder)) {
                    die('Insufficient privileges to create logs folder in application directory, or temp path, exiting');    
                }
            }
        }

        $file              = $logFolder.DIRECTORY_SEPARATOR.$app->_config->getApplicationContext().'-debug.log';
        $GLOBALS['logger']->addHandler($file, Logger::ALL, self::$LOG_MAPPING[$app->_config->getLogLevel()]);

        $analyticsFile = $logFolder.DIRECTORY_SEPARATOR.$app->_config->getApplicationContext().'-analytics.log';
        $GLOBALS['routeLogger']->addHandler($analyticsFile, Logger::ALL, self::$LOG_MAPPING[$app->_config->getLogLevel()], 'analytics');

        if (!self::$_cli) {
            $sessionManager = new WebSessionManager();
            $sessionManager->startSession(null, true);
            $app->_services['sessions']   = $sessionManager;

            SecurityUtils::setSecurityManager(new DefaultSecurityManager());

            $app->_subject = $app->_getSubjectFromSession($sessionManager->getActiveSession());

            $app->_services['routing']    = new RoutingEngine();
        }

        $app->_services['messaging']  = NotificationService::instance();

        return $app;
    }
955274
public static function autoConfigure($configFile = null) {
        Maestrano_Config_Client::with('dev-platform')->configure($configFile);
        Maestrano_Config_Client::with('dev-platform')->loadMarketplacesConfig();
    }
1154289
public function setConfigFile($configFile = '')
    {
        if (!is_readable($configFile)) {
            $this->activeConfig = [];

            throw ParserException::forFileUnreadable($configFile);
        }

        $this->configFile = $configFile;
        if (!$this->parseConfigFile()) {
            throw InvalidConfigException::forEmptyConfig($configFile);
        }

        return $this;
    }
1085062
protected function outputResult(CoverFishResult $coverFishResult)
    {
        if (false === $this->outputFormatJson) {

            if ($coverFishResult->getFailureCount() > 0) {
                $this->writeScanFailStatistic($coverFishResult);
            } else {
                $this->writeScanPassStatistic($coverFishResult);
            }

            return null;
        }

        if (true === $this->preventEcho) {
            return json_encode($this->jsonResults);
        }

        $this->output->write(json_encode($this->jsonResults));

        return null;
    }
792366
public function setConfigFromPHPUnitConfigFile()
    {
        try {
            /** @var \SimpleXMLElement $xmlDocument */
            $xmlDocument = simplexml_load_file($this->phpUnitXMLFile);

            $this->phpUnitXMLPath = $this->coverFishHelper->getPathFromFileNameAndPath($this->phpUnitXMLFile);
            $this->testAutoloadPath = sprintf('%s%s', $this->phpUnitXMLPath, $this->getAttributeFromXML('bootstrap', $xmlDocument));
            $this->testSourcePath = sprintf('%s%s', $this->phpUnitXMLPath, $this->getTestSuitePropertyFromXML('directory', $xmlDocument));
            $this->testExcludePath = sprintf('%s', $this->getTestSuitePropertyFromXML('exclude', $xmlDocument));

        } catch (\Exception $e) {

            echo (sprintf('parse error loading phpunit config file "%s"!', $this->phpUnitXMLFile));
            echo (sprintf('-> message: %s', $e->getMessage()));

        }
    }
811221
public function validateMapping(CoverFishMapping $coverMapping)
    {
        /** @var CoverFishResult $coverFishResult */
        $coverFishResult = new CoverFishResult();
        // prepare base results, clear all validation errors and warnings
        $coverFishResult = $this->prepareCoverFishResult($coverFishResult);
        // E-01: check for classFQN/DefaultCoverClass existence/mapping validation-error
        $coverFishResult = $this->validateDefaultCoverClassMapping($coverMapping, $coverFishResult);
        // E-02: check for invalid classFQN validation-error
        $coverFishResult = $this->validateClassFQNMapping($coverMapping, $coverFishResult);
        // E-03: check for invalid accessor validation-error
        $coverFishResult = $this->validateClassAccessorVisibility($coverMapping, $coverFishResult);
        // E-04: check for invalid method validation-error
        $coverFishResult = $this->validateClassMethod($coverMapping, $coverFishResult);

        return $coverFishResult;
    }
1289028
def _discover_cover_image(zf, opf_xmldoc, opf_filepath):
    '''
    
    '''
    content = None
    filepath = None
    extension = None

    # Strategies to discover the cover-image path:

    # e.g.: <meta name="cover" content="cover"/>
    tag = find_tag(opf_xmldoc, 'meta', 'name', 'cover')
    if tag and 'content' in tag.attributes.keys():
        item_id = tag.attributes['content'].value
        if item_id:
            # e.g.: <item href="cover.jpg" id="cover" media-type="image/jpeg"/>
            filepath, extension = find_img_tag(opf_xmldoc, 'item', 'id', item_id)
    if not filepath:
        filepath, extension = find_img_tag(opf_xmldoc, 'item', 'id', 'cover-image')
    if not filepath:
        filepath, extension = find_img_tag(opf_xmldoc, 'item', 'id', 'cover')

    # If we have found the cover image path:
    if filepath:
        # The cover image path is relative to the OPF file
        base_dir = os.path.dirname(opf_filepath)
        # Also, normalize the path (ie opfpath/../cover.jpg -> cover.jpg)
        coverpath = os.path.normpath(os.path.join(base_dir, filepath))
        content = zf.read(coverpath)
        content = base64.b64encode(content)

    return content, extension
158745
public function process(File $phpcsFile, $stackPtr)
    {
        $scopeEnd = null;
        $tokens   = $phpcsFile->getTokens();

        if (isset($tokens[$stackPtr]['nested_parenthesis']) === true) {
            // New in PHP 5.4: allow to instantiate class and immediately call method on it.
            $scopeStart = key($tokens[$stackPtr]['nested_parenthesis']);
            $scopeEnd = $tokens[$stackPtr]['nested_parenthesis'][$scopeStart];
        }

        $nextParenthesis = $phpcsFile->findNext(
            T_OPEN_PARENTHESIS,
            ($stackPtr + 1),
            $scopeEnd,
            false,
            null,
            true
        );

        if ($nextParenthesis === false || $tokens[$nextParenthesis]['line'] !== $tokens[$stackPtr]['line']) {
            $error = 'Calling class constructors must always include parentheses';
            $fix   = $phpcsFile->addFixableError($error, $stackPtr, 'MissingParenthesis');
            if ($fix === true) {
                $phpcsFile->fixer->beginChangeset();
                $classNameEnd = $phpcsFile->findNext(
                    array(
                     T_WHITESPACE,
                     T_NS_SEPARATOR,
                     T_STRING,
                    ),
                    ($stackPtr + 1),
                    null,
                    true,
                    null,
                    true
                );

                $phpcsFile->fixer->addContentBefore($classNameEnd, '()');
                $phpcsFile->fixer->endChangeset();
            }//end if
        } elseif ($tokens[($nextParenthesis - 1)]['code'] === T_WHITESPACE) {
            $error = 'Between the class name and the opening parenthesis spaces are not welcome';
            $fix   = $phpcsFile->addFixableError($error, ($nextParenthesis - 1), 'ExtraSpaces');
            if ($fix === true) {
                $phpcsFile->fixer->beginChangeset();
                $phpcsFile->fixer->replaceToken(($nextParenthesis - 1), '');
                $phpcsFile->fixer->endChangeset();
            }//end if
        }//end if
    }
979006
protected function setupFile($originalFile, $cacheFile)
    {
        if (count($this->filters) > 0) {
            $this->checkNumberOfAllowedFilters($cacheFile);
            if ($this->options['checkReferrer']) {
                $this->checkReferrer();
            }
        }

        if (! file_exists($originalFile)) {
            // If we are using a placeholder and that exists, use it!
            if ($this->placeholder && file_exists($this->placeholder)) {
                $originalFile = $this->placeholder;
            }
        }

        parent::setupFile($originalFile, $cacheFile);
    }
270094
public function getMapping(CoverFishPHPUnitFile $phpUnitFile)
    {
        $method = $this->getResult()['method'];
        $class = $this->getResult()['class'];
        $classFQN = $this->coverFishHelper->getClassFromUse($class, $phpUnitFile->getUsedClasses());

        $mappingOptions = array(
            'coverToken' => $this->coversToken,
            'coverMethod' => $method,
            'coverAccessor' => null,
            'coverClass' => $class,
            'coverClassFQN' => $classFQN,
            'validatorMatch' => $this->getValidationTag(),
            'validatorClass' => get_class($this)
        );

        return $this->setMapping($mappingOptions);
    }
46861
public function setExcludesFile($excludesFile)
    {
        if ($this->isReference()) {
            throw $this->tooManyAttributes();
        }
        if ($excludesFile instanceof PhingFile) {
            $excludesFile = $excludesFile->getPath();
        }
        $o = $this->createExcludesFile();
        $o->setName($excludesFile);
    }
1126371
public function getFileContents($sFile)
    {
        $sContents = null;
        if (file_exists($sFile) && is_readable($sFile)) {
            $sContents = file_get_contents($sFile);
        }

        return $sContents;
    }
1161692
public function checkFile($sFile)
    {
        $aCheckCache = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("checkcache");

        if (isset($aCheckCache[$sFile])) {
            return $aCheckCache[$sFile];
        }

        $blRet = true;
        if (!is_readable($sFile)) {
            $blRet = $this->urlValidate($sFile);
        }

        $aCheckCache[$sFile] = $blRet;
        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("checkcache", $aCheckCache);

        return $blRet;
    }