Set the name to save file as

@param   string  $saveas  Name to save file as
@return  mixed   String if field is set, NULL if not
968457
public function saveas($saveas = null)
	{
		if (!is_null($saveas))
		{
			$this->_saveas = basename($saveas);
		}

		return $this->_saveas;
	}
304930
public function save($fileName = null)
	{
		file_put_contents(empty($fileName) ? $this->fileName : $fileName, '<?php return ' . var_export($this->data, true) . ';', LOCK_EX);
	}
1009373
public function name($name = null)
    {
        if (!$this->name) {
            $this->name = $name ?: md5(json_encode(array_keys($this->files)));
        }

        return $this;
    }
840879
public function generateToken($save = false)
    {
        $attributes = [
            'token'      => str_random(16),
            'is_used'    => false,
            'user_id'    => $this->id,
            'created_at' => time()
        ];

        $token = App::make(Token::class);
        $token->fill($attributes);
        if ($save) {
            $token->save();
        }

        return $token;
    }
202327
public function filename($filename = null)
    {
        if ($filename === null) {
            return $this->_filename;
        }
        $this->_filename = $filename;
    }
845504
public function save($contents)
	{
		// store the current filename
        $file = $this->file;

        // save it
        $return = parent::save($contents);

        // existing file? saved? and do we need to flush the opcode cache?
        if ($file == $this->file and $return and static::$flush_needed)
        {
			if ($this->file[0] !== '/' and ( ! isset($this->file[1]) or $this->file[1] !== ':'))
			{
				// locate the file
				$file = \Finder::search('config', $this->file, $this->ext);
			}

			// make sure we have a fallback
			$file or $file = APPPATH.'config'.DS.$this->file.$this->ext;

			// flush the opcode caches that are active
			static::$uses_opcache and opcache_invalidate($file, true);
			static::$uses_apc and apc_compile_file($file);
		}

		return $return;
	}
856891
public function setName($name = null)
    {
        $this->fileName = $this->caDataRoot . $name . DS;

        // Create folder for future certificate
        if(!file_exists($this->fileName))
        {
            mkdir($this->fileName, 0777, true);
        }

        return $this;
    }
1290660
public function setSaveOptions($file_name = null, $directory = null, $suffix = null) {
		# Set Directory, or use Old if setted before from instance, or use img src directory
		if ($directory) {
			$this->_save_dir = rtrim($directory, DIRECTORY_SEPARATOR);
		} else if (!$this->_save_dir) {
			$this->_save_dir = $this->_image_info['dirname'];
		}

		// Check Directory
		if (!is_dir($directory)) {
			mkdir($directory, 0755, true);
		} else if (!is_writable($directory)) {
			chmod($directory, 0755);
		}

		# Set Filename
		if ($file_name) {
			$this->_save_name = basename($file_name, '.' . pathinfo($file_name, PATHINFO_EXTENSION)) . $suffix . '.' . $this->_output_format;
		} else if (!$this->_save_name) {
			$this->_save_name = $this->_image_info['filename'] . $suffix . '.' . $this->_output_format;
		}


		$this->_save_path = $this->_save_dir . DIRECTORY_SEPARATOR . $this->_save_name;

		return $this;
		# Method End
	}
1362457
public function save ($name = null)
		{
			if ($name == null)
				$name = StringHelper::random();

			$ext = pathinfo($this->_params[ 'filename' ], PATHINFO_EXTENSION);
			$this->_savedFilename = $name . '.' . $ext;
			if (( $file = fopen($this->_targetDir . '/' . $this->_savedFilename, 'w') ) !== false)
			{
				if (Yii::$app->settings->get('upload_concat') == 'cat')
				{
					fclose($file);
					setlocale(LC_ALL, 'ru_RU.UTF-8');
					for ($i = 1; $i <= $this->_params[ 'totalChunks' ]; $i++)
						shell_exec('cat ' . escapeshellarg($this->getChunkPath($i)) . ' >> ' . escapeshellarg($this->_targetDir . '/' . $this->_savedFilename));
					setlocale(LC_ALL, null);
				}
				else
				{
					for ($i = 1; $i <= $this->_params[ 'totalChunks' ]; $i++)
						fwrite($file, file_get_contents($this->getChunkPath($i)));
					fclose($file);
				}
			}
			FileHelper::removeDirectory($this->_tmpDir);

			return $this->_savedFilename;
		}
510308
public function setName($name)
    {
        $this->name = $name;
        if (isset($_FILES) && array_key_exists($name, $_FILES)) {
            $this->setValue($_FILES[$name]);
        }
        return $this;
    }
356516
public function setName($name) {
        // get the path info of the given name
        $pathinfo = pathinfo($name);
        
        // get the base file name
        $filename = $pathinfo['filename'];
        
        // set the file name
        $this->name = $filename . '.' . $this->extension();

        // done, return the instance of this, to make chaining possible
        return $this;
    }
434364
private function getFileName()
    {
        $name = $this->getArgumentNameOnly();

        switch ($this->option('type')) {
            case 'view':

                break;
            case 'model':
                $name = $this->getModelName();
                break;
            case 'controller':
                $name = $this->getControllerName($name);
                break;
            case 'seed':
                $name = $this->getSeedName($name);
                break;
        }

        // overide the name
        if ($this->option('name')) {
            return $this->option('name') . $this->settings['file_type'];
        }

        return $this->settings['prefix'] . $name . $this->settings['postfix'] . $this->settings['file_type'];
    }
1209330
private static function parseTableName($name)
    {
        // Init buffer
        $buffer = '';
        $strOpen = false;
        $names = array();

        $strLen = strlen($name);
        for($i = 0; $i < $strLen; $i++)
        {
            if($name[$i] == '"')
            {
                // Toggle strings
                if( !$strOpen || ($strOpen && $name[$i - 1] != "\\") )
                {
                    $strOpen = !$strOpen;
                }
            }
            elseif($name[$i] == '.' && !$strOpen)
            {
                // Save and cleanup buffer. Continue.
                $names[] = $buffer;
                $buffer = '';
                continue;
            }

            // Store char
            $buffer .= $name[$i];
        }

        // Save last buffer
        if($buffer != '') {
            $names[] = $buffer;
        }

        return $names;
    }
911437
protected function setWebSafeFileName()
    {
        if ($this->new_file_name == null) {
            $this->setNewFileName();
        }

        // replace multiple spaces to one space.
        $this->new_file_name = preg_replace('#\s+#iu', ' ', $this->new_file_name);
        // replace space to dash.
        $this->new_file_name = str_replace(' ', '-', $this->new_file_name);
        // replace non alpha-numeric to nothing.
        $this->new_file_name = preg_replace('#[^\da-z\-_]#iu', '', $this->new_file_name);
        // replace multiple dashes to one dash.
        $this->new_file_name = preg_replace('#-{2,}#', '-', $this->new_file_name);
    }
1117871
public function getName()
    {
        if ($this->file instanceof UploadedFile) {
            return $this->file->getClientOriginalName();
        }

        return $this->file->getFilename();
    }
477187
function saveFile() {
      if (currentFile) {
        if (!currentFile.oldName) {
          currentFile.oldName = possibleOldName;
        }

        if (!currentFile.newName) {
          currentFile.newName = possibleNewName;
        }

        if (currentFile.newName) {
          files.push(currentFile);
          currentFile = null;
        }
      }

      possibleOldName = undefined;
      possibleNewName = undefined;
    }
422457
public function save( $fileName = NULL )
	{
		if( empty( $fileName ) )
		{
			if( empty( $this->fileName ) )
				throw new Exception( 'No TAR file name for saving given' );
			$fileName = $this->fileName;
		}
		$this->generateZip();																		// Encode processed files into TAR file format
		return File_Writer::save( $fileName, $this->content );										//  write archive file
	}