Makes a storable file instance from an SplFileInfo instance.

@param SplFileInfo $data
@param string|null $name
@param string|null $mimeType
@return StorableFileInterface
775558
public function makeFromFileInfo(SplFileInfo $data, $name = null, $mimeType = null)
    {
        $file = new SplFileInfoStorableFile;
        $file->setData($data);

        if (null !== $mimeType) {
            $file->setMimeType($mimeType);
        } else {
            $file->setMimeType(
                $this->mimeTypeHelper->guessMimeTypeForPath($data->getRealPath())
            );
        }

        if (empty($name)) {
            $name = pathinfo($data->getRealPath(), PATHINFO_BASENAME);
        }

        if (null !== $name) {
            $file->setName($name);
        }

        return $this->getReturnPreparedFile($file);
    }
1168104
public function createContentPartForMimeType(Message $message, $mimeType, $charset)
    {
        $builder = $this->partBuilderFactory->newPartBuilder($this->mimePartFactory);
        $builder->addHeader('Content-Type', "$mimeType;\r\n\tcharset=\"$charset\"");
        $builder->addHeader('Content-Transfer-Encoding', 'quoted-printable');
        $this->enforceMime($message);
        $mimePart = $builder->createMessagePart();

        $altPart = $this->findOtherContentPartFor($message, $mimeType);

        if ($altPart === $message) {
            $this->setMessageAsAlternative($message);
            $message->addChild($mimePart);
        } elseif ($altPart !== null) {
            $mimeAltPart = $this->createAlternativeContentPart($message, $altPart);
            $mimeAltPart->addChild($mimePart, 1);
        } else {
            $message->addChild($mimePart, 0);
        }

        return $mimePart;
    }
913455
public function create($fileName, $data)
    {
        $path = $this->getPathBase($fileName);

        if (file_exists($path)) {
            return;
        }

        $data = serialize($data);

        return file_put_contents($path, $data);
    }
975446
public function createPolicyWithLimitation(
        ?PolicyCreateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(PolicyCreateWithLimitationType::class);

        return $this->formFactory->createNamed($name, PolicyCreateWithLimitationType::class, $data);
    }
1316196
public function map($name, $data)
    {
        return new Facet\ContentTypeFacet(
            array(
                'name' => (string)substr($name, 6),
                'entries' => $this->mapData($data),
            )
        );
    }
994911
public function makeFromLocalPath($path, $name = null, $mimeType = null)
    {
        $info = new SplFileInfo($path);

        return $this->makeFromFileInfo($info, $name, $mimeType);
    }
568868
protected function createSplFileInfo(): \SplFileInfo
    {
        if (null !== $this->splFileInfo && $this->path === $this->splFileInfo->getRealPath()) {
            return $this->splFileInfo;
        }
        $this->splFileInfo = new \SplFileInfo($this->path);

        return $this->splFileInfo;
    }
1362370
public function readPath($path, $mimeType = null)
    {
        return $this->schemaFactory()->create(
            $this->reader()->readPath($path, $mimeType)
        );
    }
1311773
protected function createMimetypeFile()
    {
        $this->createFileWithContents($this->rootFolder, self::MIMETYPE_FILE_NAME, self::MIMETYPE);
        return $this;
    }
571167
public function createFile(
       $fileName,
       $mimeType,
       \Google_Service_Drive_DriveFile $parentFolder = null
    ) {
        $folder = new \Google_Service_Drive_DriveFile();
        $folder->setTitle($fileName);
        $folder->setMimeType($mimeType);
        if ($parentFolder !== null) {
            $parent = new \Google_Service_Drive_ParentReference();
            $parent->setId($parentFolder->getId());
            $folder->setParents(array($parent));
        }

        return $this->service->files->insert($folder);
    }
1285936
public function createFromArray(array $data, $name = null)
    {
        $preloadOids = $itemList = array();
        $menu        = $this->_createFromArray($data, $name, $itemList, $preloadOids);

        if ($preloadOids && $this->aclProvider) {
            //preload all acls for menu items
            try {
                $this->aclProvider->findAcls($preloadOids);
            } catch(AclNotFoundException $e) {
            }
        }

        foreach ($itemList as $item) {
            $this->setContext($item[0], $item[1], $item[2]);
        }

        return $menu;
    }
860550
public function getMimeType(\SplFileInfo $file)
    {
        $fileInfo = finfo_open(FILEINFO_MIME_TYPE);
        $mimeType = finfo_file($fileInfo, $file->getPathname());
        finfo_close($fileInfo);

        return $mimeType;
    }
55031
private function createPageJs(string $name, array $data, string $pathFile)
    {
        $minifier = new Minify\JS("");

        foreach ($data as $datum) {
            if (in_array($datum['nome'], $this->param['js'])) {
                foreach ($datum['arquivos'] as $file) {
                    if ($file['type'] === "text/javascript")
                        $minifier->add($file['content']);
                }
            }
        }

        if (file_exists(PATH_HOME . $pathFile . "assets/{$name}.min.js"))
            $minifier->add(file_get_contents(PATH_HOME . $pathFile . "assets/{$name}.min.js"));
        elseif (file_exists(PATH_HOME . $pathFile . "assets/{$name}.js"))
            $minifier->add(file_get_contents(PATH_HOME . $pathFile . "assets/{$name}.js"));

        $minifier->minify(PATH_HOME . "assetsPublic/view/{$name}.min.js");
    }
592962
public function append(string $name, $data)
  {
    return Filesystem::append(self::url($name), $data, FILE_APPEND);
  }
573223
public function partial($name, array $data = [])
    {
        $file = $this->_getLayoutPartialPath($name);

        if (FS::isFile($file)) {
            return $this->_render($file, $data);
        }

        return null;
    }
248167
public function addFile($file, $name = null, $mime = null) {

		if('post' !== $this -> method) {
			return trigger_error('File uploads are only supported with POST request method', E_USER_ERROR);
		}

		if(false === $file instanceof File && false === is_string($file)) {
            return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or instance of sFire\\System\\File, "%s" given', __METHOD__, gettype($file)), E_USER_ERROR);
        }

        if(null !== $name && false === is_string($name)) {
            return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
        }

		if(null !== $mime && false === is_string($mime)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($mime)), E_USER_ERROR);
		}

		if(true === is_string($file)) {
			$file = new File($file);
		}

		if(false === $file -> isReadable()) {
			return trigger_error(sprintf('File %s passed to %s() is not readable', $file -> entity() -> getBasepath(), __METHOD__), E_USER_ERROR);
		}

		if(null === $name) {
			$name = $file -> entity() -> getBasename();
		}

		if(null === $mime) {
			$mime = $file -> getMime();
		}

		$this -> files[] = (object) ['file' => $file, 'name' => $name, 'mime' => $mime];

		return $this;
	}
539196
public function createRole(
        ?RoleCreateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(RoleCreateType::class);

        return $this->formFactory->createNamed($name, RoleCreateType::class, $data);
    }