Creates a new file logger
@param WURFL_Configuration_Config $wurflConfig
@param string $fileName
@return WURFL_Logger_FileLogger File logger
964804
private static function createFileLogger($wurflConfig, $fileName)
    {
        $logFileName = self::createLogFile($wurflConfig->logDir, $fileName);
        return new WURFL_Logger_FileLogger($logFileName);
    }
660357
protected Logger buildLogger(String fileStr) throws IOException {
		String loggerName = buildLoggerName();
		Appender appender = buildAppender(loggerName, fileStr);

		// Create the logger and add to the map of loggers using our factory
		Logger logger = loggerContext.getLogger(loggerName);
		logger.addAppender(appender);
		logger.setLevel(Level.INFO);
		logger.setAdditive(false);
		return logger;
	}
172724
public function createLogger(
        ?string $channel = null,
        ?string $level = null,
        HandlerInterface $handler = null
    ): LoggerInterface {
        $config = $this->config->extract('logs.channels.' . $channel);

        if ($config->get('enabled') === false) {
            return $this->getNullLogger();
        }

        $level = $level ?: $config->get('level', LogLevel::DEBUG);

        $logger = new Monolog($channel);

        if (!$handler) {
            $handlers = [];
            $handlerProfiles = (array) $config->get('handlers', [StreamHandler::class]);

            foreach ($handlerProfiles as $class) {
                $args = [];

                $args['level'] = $level;

                if ($class instanceof ClassMeta) {
                    $args['channel'] = $channel;

                    if (!$class->hasArgument('filename')) {
                        $args['filename'] = $this->getLogFile($channel);
                    }

                    $handler = $this->container->newInstance($class, $args);
                } else {
                    if (is_array($class)) {
                        $args = $class['args'] ?? [];
                        $args['level'] = $class['level'] ?? $level;

                        if (isset($class['file_argument'])) {
                            $args[$class['file_argument']] = $this->getLogFile($channel);
                        }

                        $class = $class['class'];
                    }

                    switch ($class) {
                        case 'stream':
                        case StreamHandler::class:
                            $args['stream'] = $args['stream'] ?? $this->getLogFile($channel);

                            $handler = $this->container->newInstance(
                                StreamHandler::class,
                                $args
                            );
                            break;

                        case 'rotating':
                        case RotatingFileHandler::class:
                            $args['filename'] = $args['filename'] ?? $this->getLogFile($channel);

                            $handler = $this->container->newInstance(
                                RotatingFileHandler::class,
                                $args
                            );
                            break;

                        default:
                            $handler = $this->container->newInstance($class, $args);
                    }
                }

                $handlers[] = $handler;
            }
        } else {
            $handlers = [$handler];
        }

        foreach ($handlers as $handler) {
            $handler->setFormatter(new LineFormatter(null, null, true));

            $logger->pushProcessor(new PsrLogMessageProcessor());

            // Basic string handler
            $logger->pushHandler($handler);
        }

        foreach (GlobalContainer::getHandlers() as $handler) {
            $logger->pushHandler(clone $handler);
        }

        foreach (GlobalContainer::getProcessors() as $processor) {
            $logger->pushProcessor(clone $processor);
        }

        return $logger;
    }
182433
private Logger createLoggerInstance(String loggerName) throws Exception
    {
        Class loggerClass = getConfiguration().getLoggerClass();
        Logger log = (Logger) ClassHelper.newInstance(loggerClass, String.class, loggerName);
        log.configure(getConfiguration());
        return log;
    }
784851
public static function create( $slug, $filename = '' ) {
		// Use the calling file as the main plugin file.
		if ( empty( $filename ) ) {
			$backtrace = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT, 1 );
			$filename = $backtrace[0]['file'];
		}

		return ( new Plugin() )
			->set_basename( plugin_basename( $filename ) )
			->set_directory( plugin_dir_path( $filename ) )
			->set_file( $filename )
			->set_slug( $slug )
			->set_url( plugin_dir_url( $filename ) );
	}
491551
static function create($name)
    {
        $logger = new Logger($name);
        $filename = SettingsPath::LOGS . mb_strtolower($name, 'UTF-8') . '.log';
        $handler = new RotatingFileHandler($filename);

        $handler->setFilenameFormat('{date}-{filename}', 'Y/m/d');

        $logger->pushHandler($handler);

        return $logger;
    }
1034576
public static function parseFile($fileName, $fileContent = null)
    {
        $fileName = PathResolver::realpath($fileName);
        if (isset(self::$parsedFiles[$fileName]) && !isset($fileContent)) {
            return self::$parsedFiles[$fileName];
        }

        if (isset(self::$maximumCachedFiles) && (count(self::$parsedFiles) === self::$maximumCachedFiles)) {
            array_shift(self::$parsedFiles);
        }

        if (!isset($fileContent)) {
            $fileContent = file_get_contents($fileName);
        }
        $treeNode = self::$parser->parse($fileContent);
        $treeNode = self::$traverser->traverse($treeNode);

        self::$parsedFiles[$fileName] = $treeNode;

        return $treeNode;
    }
1263382
protected function parseCsv($filename, ConfigurationInterface $config)
    {
        $length = $config->getLength();
        $delimiter = $config->getDelimiter();
        $enclosure = $config->getEnclosureChar();
        $escape = $config->getEscapeChar();
        $result = [];

        if (($handle = fopen($filename, 'r')) !== false) {
            while (($row = fgetcsv($handle, $length, $delimiter, $enclosure, $escape)) !== false) {
                $temp = [];

                if (empty($this->attributes)) {
                    if ($config->isFirstLineAsAttributes()) {
                        $this->attributes = $row;
                    } else {
                        $cRow = count($row);
                        for ($i = 0; $i < $cRow; ++$i) {
                            $attrName = 'attribute '.$i;
                            $this->attributes[] = $attrName;
                            $temp[$attrName] = trim($row[$i]);
                        }
                        $result[] = $temp;
                    }
                } else {
                    $cRow = count($row);
                    for ($i = 0; $i < $cRow; ++$i) {
                        $attrName = $this->attributes[$i];
                        $temp[$attrName] = trim($row[$i]);
                    }
                    $result[] = $temp;
                }
            }
            fclose($handle);
        }

        return $result;
    }
229015
function (config) {
    config = config || {};
    Appender.call(this, config);

    /**
     * Log file name, initialized from the configuration. Folders up to the
     * file must exist beforehand.
     */
    this.fileName = config.fileName;

    /**
     * Append log events to the end of the file when true, clear the file
     * before writing the first log event otherwise.
     */
    this.appendToFile = (typeof config.append !== 'undefined') ?
      !!config.append :
      true;

    /**
     * True to log strings instead of objects
     */
    this.appendStrings = (typeof config.appendStrings !== 'undefined') ?
      config.appendStrings :
      true;

    /**
     * The file stream, initialized by the "start" function
     */
    this.stream = null;
  }
1029235
public function buildLogger($class, Configurator $configurator)
    {
        if (!class_exists($class) || !is_subclass_of($class, Logger::class)) {
            $class = "\\Phassets\\Loggers\\$class";
        }

        if (class_exists($class) && is_subclass_of($class, Logger::class)) {
            return new $class($configurator);
        }

        return false;
    }
634199
public static function write(string $fileName = '', $config = null): bool
    {
        $pathInfo = \pathinfo(static::normalizePath($fileName));
        if (!isset($pathInfo['extension'])) {
            $message = \sprintf(
                'Config file name "%s" is missing an extension and cannot be auto-detected',
                $pathInfo['filename']
            );

            throw new RuntimeException($message);
        }

        $extension = \strtolower($pathInfo['extension']);
        if (!\in_array($extension, static::$allowedExtensions)) {
            $message = \sprintf(
                'Unsupported config file type. Supported extension types are: %s',
                \implode(',', static::$allowedExtensions)
            );

            throw new RuntimeException($message);
        }

        if (!isset(static::$writers[$extension]) || !(static::$writers[$extension] instanceof AbstractWriter)) {
            static::$writers[$extension] = WriterManager::get($extension);
        }

        return static::$writers[$extension]->toFile($fileName, $config);
    }
535565
private function createConfigurationFile($filename)
    {
        $absFilename = GeneralUtility::getFileAbsFileName($filename);
        if (file_exists($absFilename)) {
            // Add Flashmessage that there is already an configuration file and we are not going to override this.
            $flashMessage = GeneralUtility::makeInstance(
                FlashMessage::class,
                'There is already an ' . $filename . ' configuration file in the root directory, '
                . 'please make sure that configuration files are protected and the url rewritings are set properly. '
                . 'An example configuration is located at: "typo3conf/ext/bootstrap_package/Configuration/Server/_' . $filename . '"',
                'Webserver configuration file "' . $filename . '" already exists',
                FlashMessage::NOTICE,
                true
            );
            $this->addFlashMessage($flashMessage);
            return;
        }

        $filecontent = GeneralUtility::getUrl(ExtensionManagementUtility::extPath(self::EXT_KEY) . '/Configuration/Server/_' . $filename);
        if ($filecontent && is_string($filecontent)) {
            GeneralUtility::writeFile($absFilename, $filecontent, true);
            // Add Flashmessage that the example configuration file was placed in the root directory
            $flashMessage = GeneralUtility::makeInstance(
                FlashMessage::class,
                'For securing configuration files and optimization purposes an example ' . $filename . ' file was placed in your root directory.',
                'Webserver configuration file "' . $filename . '" was placed in the root directory.',
                FlashMessage::OK,
                true
            );
            $this->addFlashMessage($flashMessage);
        }
    }
1340823
public function parseFile($filename, $config = NULL, $encoding = NULL, $use_include_path = false, $filename, $config = NULL, $encoding = NULL, $use_include_path = false)
    {
    }
847769
public function addPHPConfig($filename)
    {
        $filename = trim($filename);
        
        if (strlen($filename) === 0) {
            throw new ConfiguratorException("Zero length filename is bogus.");
        }
        
        if (file_exists($filename) === false) {
            throw new ConfiguratorException("File `$filename` does not exist.");
        }
        
        ob_start();
        require($filename);
        $contents = ob_get_contents();
        ob_end_clean();

        if (strlen($contents) !== 0) {
            $message = sprintf(
                "Filename `%s` output some characters. Please check it is a valid PHP file.\n",
                $filename
            );

            throw new ConfiguratorException($message);
        }

        if (isset($default) === true) {
            $this->configuratorData->addConfigDefault($default);
        }

        foreach ($this->environmentList as $environment) {
            if (isset($$environment) === true) {
                $this->configuratorData->addConfigEnvironment($$environment);
            }
        }

        if (isset($override) === true) {
            $this->configuratorData->addConfigOverride($override);
        }

        if (isset($evaluate) === true) {
            $calculatedValues = $evaluate($this->configuratorData->getConfig(), $this->environment);
            $this->configuratorData->addConfigOverride($calculatedValues);
        }
    }
721363
public static function createStreamFromFile($filename, $mode = 'r')
    {
        if (! static::$streamFactory) {
            static::$streamFactory = new StreamFactory();
        }

        return static::$streamFactory->createStreamFromFile($filename, $mode);
    }
1245381
public static function start(&$config)
    {
        $config = array_merge(array(
        
            /* @var bool */
            'register_default'   => false,
            
            /* @var string */
            'filename'           => 'log.txt',
            
            /* From which level to start logging messages
             * @var int */
            'level'              => LOG_WARNING,
            
            /* Message template for the default logger
             * @see logToFile()
             * @var string */
            'message_template'   => '[%date%] [%level%] %message%'
            
        ), $config);
        self::$config = &$config;
        
        Atomik::registerHelper('log', 'Atomik\Logger::log');
        if ($config['register_default']) {
            Atomik::listenEvent('Logger::Log', 'Atomik\Logger::logToFile');
        }
    }
1251355
public function createDocumentManager($connection,$config)
    {
        $dbConn = new Connection($connection);
        $dm = DocumentManager::create($dbConn,$config);
        return $dm;
    }