import dicon file.

@param   string  $dicon
188009
public function import($dicon)
    {
        $defines = $this->get('yaml')->load($dicon);
        foreach ($defines as $name => $def) {
            $define = $this->getComponentDefine($def);
            $this->register($name, $define);
        }
    }
798793
public function importFromCsv($file)
    {
        $data = file_get_contents($file);
        $data = $this->container->get('claroline.utilities.misc')->formatCsvOutput($data);
        $lines = str_getcsv($data, PHP_EOL);
        $this->om->startFlushSuite();
        $i = 0;

        foreach ($lines as $line) {
            $values = str_getcsv($line, ';');
            $code = $values[0];
            $workspace = $this->om->getRepository('ClarolineCoreBundle:Workspace\Workspace')->findOneByCode($code);

            $name = $values[1];
            $tab = $this->om->getRepository('ClarolineCoreBundle:Tab\HomeTab')->findBy(['workspace' => $workspace, 'name' => $name]);
            if (!$tab) {
                $this->createHomeTab($name, $workspace);
                ++$i;
            } else {
                $this->log("Tab {$name} already exists for workspace {$code}");
            }

            if (0 === $i % 100) {
                $this->om->forceFlush();
                $this->om->clear();
            }
        }

        $this->om->endFlushSuite();
    }
58003
@Override
    public ExplodedImporter importDirectory(String fileName, Filter<ArchivePath> filter) {
        Validate.notNull(fileName, "FileName must be specified");
        return importDirectory(new File(fileName), filter);
    }
1185967
public function import($file) {
        $stream = new Stream($file);
        if (!$stream->openRead()->isResource()) {
            return false;
        }
        $content = '';
        while ($line = $stream->readLine(self::LINE_MAX_LENGTH)) {
            if (substr($line, 0, 2) == '--' || $line == '') {
                continue;
            }
            $content .= $line;
            if (substr(trim($line), -1, 1) !== ';') {
                continue;
            }
            $this->command()->execute($content);
            $content = '';
        }
        $stream->close();
        return true;
    }
1272871
public function load($filename)
    {
        $this->filename = $filename;
        $this->readXML($this->filename);
        $this->configure($this->xml->value);
        $this->loadUserDatatypes();
        $this->parse();
    }
286611
protected function import($locale, $group, $delimiter = ',', $enclosure ='"', $escape = '\\')
    {
        // Create output device and write CSV.
        if (($input_fp = fopen("{$this->import_path}/{$group}.csv", 'r')) === false) {
            $this->error('Can\'t open the input file!');
            exit;
        }

        $strings = [];

        // Write CSV lintes
        while (($data = fgetcsv($input_fp, 0, $delimiter, $enclosure, $escape)) !== false) {
            $strings[$data[0]] = $data[1];
        }

        fclose($input_fp);

        $this->writeLangList($locale, $group, $strings);

        $this->line('');
        $this->info("Successfully imported file:");
        $this->info("{$this->import_path}/{$group}.csv");
        $this->line('');
    }
1108889
protected function load($source)
    {
        $reader = new FileReader($source);

        $dictionary = new MimeTypeDictionary($reader);

        foreach ($dictionary as $entry) {
            $this->dict += array_fill_keys(
                $entry->fileExtensions,
                $entry->mimeType
            );
        }
    }
533039
public function addImport(string $importName): NamespaceContext
    {
        $importName = \trim($importName, '\\');
        
        if (false !== ($offset = \strrpos($importName, '\\'))) {
            $this->imports[\strtolower(\substr($importName, $offset + 1))] = $importName;
        } else {
            $this->imports[\strtolower($importName)] = $importName;
        }
        
        return $this;
    }
1296090
private function loadConfig($fileName) {
		$config = include($this->path . DIRECTORY_SEPARATOR . $fileName . '.php');
		
		$this->map[$fileName] = $config;
	}
736008
public final function import(string $fileName): RouterInterface
   {
       if (file_exists($fileName)) {
           $config = json_decode(file_get_contents($fileName), true);
           foreach ($config as $value) {
               $this->add($this->create(
                   $value[Route::ACTION],
                   $value[Route::PREFIX],
                   $value[Route::CONTROLLER],
                   $value[Route::PARAM],
                   $value[Route::PATH]));
           }
           return $this;
       }
       throw new InvalidArgumentException(
          "Can't import: invalid \"" . $fileName . "\""
       );
   }
121429
private function initContainer()
    {
        $dicons = (array)$this->app->config('container.dicon');
        $container = ContainerFactory::create();
        foreach ($dicons as $dicon) {
            $file = $this->app->getLoader()->find($dicon)->first();
            $container->import($file);
        }

        $container->register('framework', $this);
        $container->register('application', $this->app);
        $container->register('loader', $this->app->getLoader());

        $this->setContainer($container);
        $this->app->setContainer($container);

        // callback
        foreach ((array)$this->app->config('container.callback.initialized') as $callback) {
            $callback($container);
        }
    }
480481
public function loadDatabase(string $file): void
	{
		$this->connection->transactional(function (Connection $db) use ($file) {
			$db->query('SET foreign_key_checks = 0');
			FileImporter::executeFile($db, $file);
			$db->query('SET foreign_key_checks = 1');
		});
	}
1293224
protected function import(DOMNode $node, $parent)
    {
      // abort if there are no children
        if (!$node->childNodes->length) {
            return;
        }

        foreach ($node->childNodes as $n) {
          // skip if we can't handle the element
            if (!isset(self::$types[$n->nodeName])) {
                continue;
            }

            $class = __NAMESPACE__ . '\\'.self::$types[$n->nodeName];
            $key = null;

          // find previous <key> if possible
            $ps = $n->previousSibling;
            while ($ps && $ps->nodeName == '#text' && $ps->previousSibling) {
                $ps = $ps->previousSibling;
            }

          // read <key> if possible
            if ($ps && $ps->nodeName == 'key') {
                $key = $ps->firstChild->nodeValue;
            }

            switch ($n->nodeName) {
                case 'date':
                    $value = new $class(CFDate::dateValue($n->nodeValue));
                    break;
                case 'data':
                    $value = new $class($n->nodeValue, true);
                    break;
                case 'string':
                    $value = new $class($n->nodeValue);
                    break;

                case 'real':
                case 'integer':
                    $value = new $class($n->nodeName == 'real' ? floatval($n->nodeValue) : intval($n->nodeValue));
                    break;

                case 'true':
                case 'false':
                    $value = new $class($n->nodeName == 'true');
                    break;

                case 'array':
                case 'dict':
                    $value = new $class();
                    $this->import($n, $value);

                    if ($value instanceof CFDictionary) {
                        $hsh = $value->getValue();
                        if (isset($hsh['CF$UID']) && count($hsh) == 1) {
                            $value = new CFUid($hsh['CF$UID']->getValue());
                        }
                    }

                    break;
            }

        // Dictionaries need a key
            if ($parent instanceof CFDictionary) {
                $parent->add($key, $value);
            } // others don't
            else {
                $parent->add($value);
            }
        }
    }
618910
public function import()
    {
        if (null === $this->getInput()) {
            throw new Doozr_Di_Exception(
                'Could not import map. No input set. Please set input first.'
            );
        }

        // Get content from map file
        $this->setContent(
            $this->importMapFromFromJsonFile($this->getInput())
        );

        return $this->getContent();
    }
1027160
private function import($file)
    {
        $fileData = $this->parser->parse(file_get_contents($file));

        $handlers = new MenuItemCollection();

        foreach ($fileData as $name => $handlerData) {
            if (isset($handlerData['parent']) && !is_string($handlerData['parent'])) {
                throw new LoaderException("Data type of parent has to be string, $name given.");
            }
            if (!isset($handlerData['handle']) || !is_string($handlerData['handle'])) {
                throw new LoaderException("Data type of handle has to be string, $name given.");
            }
            if (isset($handlerData['roles']) && !is_array($handlerData['roles'])) {
                throw new LoaderException('Data type of roles has to be array.');
            }

            if (!isset($handlerData['parent'])) {
                $handlerData['parent'] = null;
            }
            if (!isset($handlerData['roles'])) {
                $handlerData['roles'] = [];
            }

            $handlers->set($name, new MenuItem($handlerData['handle'], $handlerData['parent'], $handlerData['roles']));
        }

        return $handlers;
    }
1210281
public function load($file, $type = null)
    {
        $path = $this->locator->locate($file);

        $content = $this->loadFile($path);

        $this->configCollection->addResource(new FileResource($path));

        // empty file
        if (null === $content) {
            return;
        }

        // imports
        $this->parseImports($content, $path);

        // parameters
        if (isset($content['parameters'])) {
            foreach ($content['parameters'] as $key => $value) {
                $this->configCollection->setParameter($key, $value);
            }
        }

        // extensions
        $this->loadFromExtensions($content);
    }
820276
public function import($file)
    {
        if (! file_exists($file)) return;

        $settings = $this->yaml->load($file);
        foreach ($settings as $alias => $setting) {
            $database= new Database($setting);
            $database->database_dir = $this->config->getDataDir();
            $this->_databases[$alias] = $database;
        }
    }