ファイルを復号化して文字列として返します。

@param	string	$file_path	復号化するファイルのパス
@param	string	$key		復号化キー
@param	array	$options	復号化オプション
@return	string	復号化されたファイルの実体
775744
public static function DecryptFile ($file_path, $key, $options = []) {
		$options = static::_AdjustOptions($options);
		return openssl_decrypt(file_get_contents($file_path), $options['method'], $key, $options['openssl_options'], $options['iv']);
	}
393660
public function putFile($path, $file, $options = [])
    {
        return $this->putFileAs($path, $file, $file->getRename(), $options);
    }
205836
protected function _getFileName($entity, $field, $options = [])
    {
        $_options = [
        ];

        $options = Hash::merge($_options, $options);

        $config = $this->config($field);

        $_upload = $this->_uploads[$field];

        $fileInfo = explode('.', $_upload['name']);
        $extension = end($fileInfo);

        $fileName = $config['fileName'];

        $replacements = [
            '{ORIGINAL}' => $_upload['name'],
            '{field}' => $entity->get($config['field']),
            '{extension}' => $extension,
            '{DS}' => DIRECTORY_SEPARATOR,
            '//' => DIRECTORY_SEPARATOR,
            '/' => DIRECTORY_SEPARATOR,
            '\\' => DIRECTORY_SEPARATOR,
        ];

        $builtFileName = str_replace(array_keys($replacements), array_values($replacements), $fileName);

        return $builtFileName;
    }
1370200
public function stream_open($path, $mode, $options, &$opened_path)
	{
		$this->path = $path;
		$this->resource = fopen($this->getLocalFilesystemPath($path), $mode);
		
		return is_resource($this->resource);
	}
722382
public function getFilesInDir($dir_path, array $file_extensions)
    {
        $file_paths = [];

        /** @var \RecursiveDirectoryIterator */
        $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir_path));
        $iterator->rewind();

        while ($iterator->valid()) {
            if (!$iterator->isDot()) {
                $extension = $iterator->getExtension();
                if (in_array($extension, $file_extensions, true)) {
                    $file_paths[] = (string)$iterator->getRealPath();
                }
            }

            $iterator->next();
        }

        return $file_paths;
    }
477670
public static function HmacStringFromFile ($file_path, $key, $algo = self::DEFAULT_HASH_ALGORITHM) {
		return hash_hmac_file($algo, $file_path, $key, false);
	}
893552
public function mkdir($path, $mode, $options)
    {
        if (array_has(self::$folders, $path)) {
            return true;
        }

        $parentEnd = strrpos($path, '/');
        $parent = substr($path, 0, $parentEnd);

        if (array_has(self::$folders, $parent)) {
            self::$folders[] = $path;
            return true;
        }

        if (! ($options & STREAM_MKDIR_RECURSIVE)) {
            return false;
        }

        while ($path !== self::PROTOCOL.':/') {
            if (array_has(self::$folders, $path)) {
                break;
            } else {
                self::$folders[] = $path;
            }

            $path = substr($path, 0, $parentEnd);
            $parentEnd = strrpos($path, '/');
        }

        return true;
    }
1121656
public static function EncryptFile ($file_path, $key, $options = []) {
		$options['module'] = \MCRYPT_MODE_CBC;
		return static::Encrypt(file_get_contents($file_path), $key, $options);
	}
799913
function _stream_open($path, $mode, $options, &$opened_path)
    {
        $path = $this->_parse_path($path);

        if ($path === false) {
            return false;
        }
        $this->path = $path;

        $this->size = $this->sftp->size($path);
        $this->mode = preg_replace('#[bt]$#', '', $mode);
        $this->eof = false;

        if ($this->size === false) {
            if ($this->mode[0] == 'r') {
                return false;
            } else {
                $this->sftp->touch($path);
                $this->size = 0;
            }
        } else {
            switch ($this->mode[0]) {
                case 'x':
                    return false;
                case 'w':
                    $this->sftp->truncate($path, 0);
                    $this->size = 0;
            }
        }

        $this->pos = $this->mode[0] != 'a' ? 0 : $this->size;

        return true;
    }
52141
public function findRealPath($file_path)
    {
        if (@file_exists($file_path)) {
            return realpath($file_path);
        }
        if (@file_exists($this->web_root_path.$file_path)) {
            return $this->web_root_path.$file_path;
        }
        return null;
    }
376224
public function fileOpen(string $path, string $mode, int $options)
    {
        $entity = $this->getEntity($path);

        $filePointer = null;
        if (null !== $entity) {
            $exists = $entity->file_exists();

            if ($exists && !$entity->is_file()) {
                $filePointer = null;
            } else {
                $fopenWillFail = false;
                $mode = strtolower($mode);
                if ('r' != $mode) {
                    $isVirtual = ($entity instanceof VirtualInterface);
                    if (!$exists || !$isVirtual) {
                        $tmpPath = $this->tempnam();
                        $basename = basename($path);

                        if ($exists) {
                            if ('x' == $mode || 'x+' == $mode) {
                                $fopenWillFail = true;
                            } else {
                                copy($entity->path(), $tmpPath);
                            }
                        }
                        if (!$fopenWillFail) {
                            $entity = Virtual::newInstance(
                                $entity, $tmpPath, $basename
                            );

                            $changes = $this->getChanges();
                            $changes->add($path, $entity);
                        }
                    }
                }

                if ($fopenWillFail) {
                    $entity = null;
                } else {
                    if ($options & STREAM_REPORT_ERRORS) {
                        $filePointer = fopen($entity->path(), $mode);
                    } else {
                        $filePointer = @fopen($entity->path(), $mode);
                    }
                }
            }
        }

        return $filePointer;
    }
568093
protected function putIntoFile($file_path, $data)
    {
        if ($this->files->isDirectory($this->files->dirname($file_path))) {
            $data = str_replace(["\n", "\r"], '', trim((string) $data));

            return $this->files->put($file_path, $data, $this->use_locking) > 0;
        }

        // @codeCoverageIgnoreStart
        return false;
        // @codeCoverageIgnoreEnd
    }
1102805
public function stream_open($url, $mode, $options, &$openedPath)
  {
    $partition = self::getPartition($url);
    $path = self::getRelativePath($url);

    $this->_filePointer = $partition->fileOpen(
      $path, $mode, $options, $this->_fileEntity
    );

    $result = !!$this->_filePointer;
    if ($result && ($options & STREAM_USE_PATH)) {
      $openedPath = $path;
    }
    return $result;
  }
1073671
public function fileOpen($path, $mode, $options, &$entity)
  {
    $entity = $this->getEntity($path);

    $filePointer = null;
    if (!is_null($entity)) {
      $exists = $entity->file_exists();

      if ($exists && !$entity->is_file()) {
        $filePointer = null;
      } else {
        $fopenWillFail = false;
        $mode = strtolower($mode);
        if ($mode != "r") {
          $isVirtual = ($entity instanceof Entity_Virtual_Interface);
          if (!$exists || !$isVirtual) {
            /* @var $entity Entity */
            $tmpPath = $this->_files->tempnam();
            $basename = basename($path);

            if ($exists) {
              if ($mode == "x" || $mode == "x+") {
                $fopenWillFail = true;
              } else {
                copy($entity->path(), $tmpPath);
              }
            }
            if (!$fopenWillFail) {
              $entity = Entity_Virtual::newInstance(
                $entity, $tmpPath, $basename
              );

              $changes = $this->getChanges();
              $changes->add($path, $entity);
            }
          }
        }

        if ($fopenWillFail) {
          $entity = null;
        } else {
          if ($options & STREAM_REPORT_ERRORS) {
            $filePointer = fopen($entity->path(), $mode);
          } else {
            $filePointer = @fopen($entity->path(), $mode);
          }
        }
      }
    }

    return $filePointer;
  }
712047
public function readFile($filePath = null, array $options = [])
    {
        $filePath = empty($filePath)
            ? $this->filePath
            : $filePath;

        $result = new ArrayIterator();

        if (false !== ($xml = simplexml_load_file($filePath))) {
            $contents = json_decode(json_encode($xml), true); // force to array conversion

            if (count($contents) == 1) {
                $contents = reset($contents);
            }

            if (json_last_error() === JSON_ERROR_NONE) {
                foreach ($contents as $content) {
                    $result[] = new SplArrayObject($content);
                }
            }
        }

        return $result;
    }
612577
public function putFile($path, $file, $options = [])
    {
        return $this->putFileAs($path, $file, $file->hashName(), $options);
    }
388670
public static function ReflectFromIniFile ($ini_file_path, $extension = null, $options = []) {
		$cache_dir		= isset($options['cache']) ? $options['cache'] : null;

		if ($cache_dir) {
			$ini = ArrayCache::GetCache($ini_file_path, $cache_dir, $options);
			if ($ini) {
				static::Set($ini);
				return $ini;
			}
		}

		//ファイル生存系確認：本当はvalidationでやりたい
		FileSystem::IsReadableFile($ini_file_path);

		$allow_parameter_list = array_keys((($extension === null) ? static::GetCurrent() : static::GetCurrent($extension)));
		switch ($extension) {
			case static::SESSION:
				$allow_parameter_list[] = static::URL_REWRITER_TAGS;
				break;
		}

		$ini = IniFile::GetConfig($ini_file_path, $allow_parameter_list, $options);
		if ($cache_dir) {
			ArrayCache::SetCache($ini_file_path, $cache_dir, $ini, $options);
		}

		return static::Set($ini);
	}