Store the file information in the session
@param mixed
@return mixed
184638
protected function validator($varInput)
    {
        $varReturn = parent::validator($varInput);
        $arrReturn = array_filter((array) $varReturn);
        $intCount = 0;

        foreach ($arrReturn as $varFile) {
            // Get the file model
            if (\Validator::isUuid($varFile)) {
                $objModel = \FilesModel::findByUuid($varFile);

                if ($objModel === null) {
                    continue;
                }

                $varFile = $objModel->path;
            }

            $objFile = new \File($varFile, true);

            $_SESSION['FILES'][$this->strName . '_' . $intCount++] = array
            (
                'name'     => $objFile->name,
                'type'     => $objFile->mime,
                'tmp_name' => TL_ROOT . '/' . $objFile->path,
                'error'    => 0,
                'size'     => $objFile->size,
                'uploaded' => true,
                'uuid'     => ($objModel !== null) ? \StringUtil::binToUuid($objModel->uuid) : ''
            );
        }

        return $varReturn;
    }
332588
protected function storeData()
    {
        if ($this->currentCellIsDirty && !empty($this->currentObjectID)) {
            $this->currentObject->detach();

            fseek($this->fileHandle, 0, SEEK_END);

            $this->cellCache[$this->currentObjectID] = array(
                'ptr' => ftell($this->fileHandle),
                'sz'  => fwrite($this->fileHandle, serialize($this->currentObject))
            );
            $this->currentCellIsDirty = false;
        }
        $this->currentObjectID = $this->currentObject = null;
    }
362899
function storedFileInformation( $object, $objectVersion, $objectLanguage,
                                    $objectAttribute )
    {
        $binaryFile = eZBinaryFile::fetch( $objectAttribute->attribute( "id" ),
                                            $objectAttribute->attribute( "version" ) );
        if ( $binaryFile )
        {
            return $binaryFile->storedFileInfo();
        }
        return false;
    }
1110731
private static function storage($session)
    {
        //Initiat the class
        static::session($session);

        $files = ['Storage'];
        $folder = static::$root.'Storage'.'/';

        self::call($files, $folder);

        $files = ['NotFoundStorageDiskException'];
        $folder = static::$root.'Storage/Exceptions'.'/';

        self::call($files, $folder);
    }
1363190
public function getFile()
    {
        if ($this->_file === null) {
            $this->_file = Yii::$app->storage->getFile($this->getFileId());
        }
        
        return $this->_file;
    }
145382
function store( $atomic = false )
    {
        if ( $this->open( $atomic ) )
        {
            $this->write( "<?php\n" );

            $this->writeElements();

            $this->write( "?>\n" );

            $this->writeChunks();
            $this->flushChunks();
            $this->close();

            if ( !$this->ClusteringEnabled )
            {
                $perm = octdec( eZINI::instance()->variable( 'FileSettings', 'StorageFilePermissions' ) );
                chmod( eZDir::path( array( $this->PHPDir, $this->PHPFile ) ), $perm );
            }

            // Write log message to storage.log
            eZLog::writeStorageLog( $this->PHPFile, $this->PHPDir . '/' );
            return true;
        }
        else
        {
            eZDebug::writeError( "Failed to open file '" . $this->PHPDir . '/' . $this->PHPFile . "'", __METHOD__ );
            return false;
        }
    }
910437
function save(string $file = null)
    {
        if ($file == null) {
            $file = static::$configFile;
        }

        $a = null;
        foreach ($this as $k => $v) {
            $a[$k] = $v;
        }
        return file_put_contents($file, json_encode($a, JSON_PRETTY_PRINT));
    }
1104183
public function storeFile($input = null, $target)
    {
        // The input name and target path must be defined
        if (!isset($input) || !isset($target)) {
            throw new \InvalidArgumentException('Undefined input name or target', 400);
        }

        // Move the uploaded file
        $result = move_uploaded_file($_FILES[$input]['tmp_name'], $target);

        // Check if the file was stored
        if (!$result) {
            throw new \InvalidArgumentException('The file could not be stored', 500);
        }

        // Return the file info
        return $result;
    }
1361973
public function do_read($session_id)
    {
        $file = $this->_getFileName($session_id);

        if (file_exists($file) && filemtime($file) >= time()) {
            return file_get_contents($file);
        } else {
            return '';
        }
    }
1707
public function store()
    {
        $password = Str::random();

        $input = array_merge(Binput::only(['first_name', 'last_name', 'email']), [
            'password'     => $password,
            'activated'    => true,
            'activated_at' => new DateTime(),
        ]);

        $rules = UserRepository::rules(array_keys($input));
        $rules['password'] = 'required|min:6';

        $val = UserRepository::validate($input, $rules, true);
        if ($val->fails()) {
            return Redirect::route('users.create')->withInput()->withErrors($val->errors());
        }

        try {
            $user = UserRepository::create($input);

            $groups = GroupRepository::index();
            foreach ($groups as $group) {
                if (Binput::get('group_'.$group->id) === 'on') {
                    $user->addGroup($group);
                }
            }

            $mail = [
                'url'      => URL::to(Config::get('credentials.home', '/')),
                'password' => $password,
                'email'    => $user->getLogin(),
                'subject'  => Config::get('app.name').' - New Account Information',
            ];

            Mail::queue('credentials::emails.newuser', $mail, function ($message) use ($mail) {
                $message->to($mail['email'])->subject($mail['subject']);
            });

            return Redirect::route('users.show', ['users' => $user->id])
                ->with('success', 'The user has been created successfully. Their password has been emailed to them.');
        } catch (UserExistsException $e) {
            return Redirect::route('users.create')->withInput()->withErrors($val->errors())
                ->with('error', 'That email address is taken.');
        }
    }
167803
public function store()
    {
        $attributes = request()->validate(Page::$rules, Page::$messages);

        $attributes['is_header'] = boolval(input('is_header'));
        $attributes['is_hidden'] = boolval(input('is_hidden'));
        $attributes['is_footer'] = boolval(input('is_footer'));
        $attributes['is_featured'] = boolval(input('is_featured'));
        $attributes['url_parent_id'] = ($attributes['url_parent_id'] == 0 ? $attributes['parent_id'] : $attributes['url_parent_id']);

        $page = $this->createEntry(Page::class, $attributes);

        if ($page) {
            $page->updateUrl()->save();
            $page->banners()->sync(input('banners'));
        }

        return redirect_to_resource();
    }
910846
public function store_destfile_from_string($content) {
        if ($record = $this->get_file_record()) {
            $fs = get_file_storage();
            $existing = $fs->get_file(
                $record['contextid'],
                $record['component'],
                $record['filearea'],
                $record['itemid'],
                $record['filepath'],
                $record['filename']
            );
            if ($existing) {
                $existing->delete();
            }
            $file = $fs->create_file_from_string($record, $content);

            $this->raw_set('destfileid', $file->get_id());
        }

        return $this;
    }
782487
static function storedSessionValue( $name )
    {
        $http = eZHTTPTool::instance();
        if ( !$http->hasSessionVariable( eZPreferences::SESSION_NAME ) )
            return null;
        $preferencesInSession = $http->sessionVariable( eZPreferences::SESSION_NAME );
        if ( !array_key_exists( $name, $preferencesInSession ) )
            return null;
        return $preferencesInSession[$name];
    }
744139
protected function readFile()
	{
		// construct the session file name
		$file = $this->config['file']['path'].$this->config['file']['cookie_name'].'_'.$this->sessionId;

		if (is_file($file) and $handle = fopen($file,'r'))
		{
			// wait for a lock
			while ( ! flock($handle, LOCK_SH));

			if ($size = filesize($file))
			{
				// read the session data
				$payload = fread($handle, $size);
			}
			else
			{
				// file exists, but empty?
				$payload = false;
			}

			//release the lock
			flock($handle, LOCK_UN);

			// close the file
			fclose($handle);

			// return the loaded payload
			return $payload;
		}

		// session file did not exist or could not be opened
		return false;
	}
427237
protected function _get()
	{
		$id_path = $this->identifier_to_path( $this->identifier );
		$file = static::$path.$id_path.'.cache';
		if ( ! is_file($file) or ($size = filesize($file)) == 0)
		{
			return false;
		}

		$handle = fopen($file, 'r');
		if ( ! $handle)
		{
			return false;
		}

		// wait for a lock
		while( ! flock($handle, LOCK_SH));

		// read the session data
		$payload = fread($handle, $size);

		//release the lock
		flock($handle, LOCK_UN);

		// close the file
		fclose($handle);

		try
		{
			$this->unprep_contents($payload);
		}
		catch (\UnexpectedValueException $e)
		{
			return false;
		}

		return true;
	}
975952
function storeCacheFile( $filepath, $transformationData,$extraCode, $type, $charsetName )
    {
        $file = basename( $filepath );
        $dir = dirname( $filepath );
        $php = new eZPHPCreator( $dir, $file );

        $php->addComment( "Cached transformation data" );
        $php->addComment( "Type: $type" );
        $php->addComment( "Charset: $charsetName" );
        $php->addComment( "Cached transformation data" );

        $php->addCodePiece( '$data = ' . eZCharTransform::varExport( $transformationData ) . ";\n" );
        $php->addCodePiece( "\$text = strtr( \$text, \$data['table'] );\n" );

        if ( $extraCode )
        {
            $php->addCodePiece( $extraCode );
        }

        return $php->store( true );
    }
785943
function store( $sub_dir = false, $suffix = false, $mimeData = false )
    {
        if ( !$this->IsTemporary )
        {
            eZDebug::writeError( "Cannot store non temporary file: " . $this->Filename,
                                 "eZHTTPFile" );
            return false;
        }
        $this->IsTemporary = false;

        $ini = eZINI::instance();
//         $storage_dir = $ini->variable( "FileSettings", "VarDir" ) . '/' . $ini->variable( "FileSettings", "StorageDir" );
        $storage_dir = eZSys::storageDirectory();
        if ( $sub_dir !== false )
            $dir = $storage_dir . "/$sub_dir/";
        else
            $dir = $storage_dir . "/";
        if ( $mimeData )
            $dir = $mimeData['dirpath'];

        if ( !$mimeData )
        {
            $dir .= $this->MimeCategory;
        }

        if ( !file_exists( $dir ) )
        {
            if ( !eZDir::mkdir( $dir, false, true ) )
            {
                return false;
            }
        }

        $suffixString = false;
        if ( $suffix != false )
            $suffixString = ".$suffix";

        if ( $mimeData )
        {
            $dest_name = $mimeData['url'];
        }
        else
        {
            $dest_name = $dir . "/" . md5( basename( $this->Filename ) . microtime() . mt_rand() ) . $suffixString;
        }

        if ( !move_uploaded_file( $this->Filename, $dest_name ) )
        {
            eZDebug::writeError( "Failed moving uploaded file " . $this->Filename . " to destination $dest_name" );
            unlink( $dest_name );
            $ret = false;
        }
        else
        {
            $ret = true;
            $this->Filename = $dest_name;
            $perm = $ini->variable( "FileSettings", "StorageFilePermissions" );
            $oldumask = umask( 0 );
            chmod( $dest_name, octdec( $perm ) );
            umask( $oldumask );

            // Write log message to storage.log
            $storageDir = $dir . "/";
            eZLog::writeStorageLog( basename( $this->Filename ), $storageDir );
        }
        return $ret;
    }