Overwrite output file if it exists
@param  boolean $var
@return boolean
543690
public function overwrite($var = true)
    {
        switch ($var) 
        {
            case true:
                array_push($this->parameters, '-y');
                return $this;
                break;

            case false:
                array_push($this->parameters, '-n');
                return $this;
                break;

            default:
                return false;
                break;
        }
    }
280726
function doWrite( $data, $length = false )
    {
        if ( $length === false )
            return @fwrite( $this->FileHandler, $data );
        else
            return @fwrite( $this->FileHandler, $data, $length );
    }
639421
public function save($filename, $overwrite = false)
    {

        if ($this->html)
        {
            $this->snappy->generateFromHtml($this->html, $filename, $this->options, $overwrite);
        }
        elseif ($this->file)
        {
            $this->snappy->generate($this->file, $filename, $this->options, $overwrite);
        }

        return $this;
    }
806932
public static function createFile($aimUrl, $overWrite = false) {
		if (is_file($aimUrl) && $overWrite == false) {
			return false;
		} elseif (is_file($aimUrl) && $overWrite == true) {
			self::unlinkFile($aimUrl);
		}
		$aimDir = dirname($aimUrl);
		self::createDir($aimDir);
		touch($aimUrl);
		return true;
	}
1359884
private function isSetConfigVariable($var)
    {
        if (preg_match("/^SW_/", $var)) {
            $var = strtolower(preg_replace("/SW_/", "", $var));
        }
        if (defined("SW_" . strtoupper($var))) {
            return true;
        }

        if (isset($this->variables["config"][$var])) {
            return true;
        } else {
            return false;
        }
    }
397058
private boolean canWrite(File outputFile) {
		boolean fileIsValid = false;
		if (outputFile.exists()) {
			int result = JOptionPane.showConfirmDialog(
					this, "File exists, overwrite?",
					"Warning", JOptionPane.YES_NO_CANCEL_OPTION);
			switch (result) {
			case JOptionPane.YES_OPTION:
				fileIsValid = true;
				break;
			default:
				fileIsValid = false;
			}
		} else {
			fileIsValid = true;
		}
		return fileIsValid;
	}
1163490
public function decodeFile( $fileName, $overwrite = FALSE )
	{
		if( file_exists( $fileName ) )
		{
			if( $this->isEncoded( $fileName ) )
			{
				$file	= new FS_File_Editor( $fileName );
				$php	= $file->readString();
				$code	= $this->encode( $php );
				$dirname	= dirname( $fileName );
				$basename	= basename( $fileName );
				$target	= $dirname."/".substr( $basename, strlen( $this->filePrefix) , -strlen( $this->fileSuffix ) );
				if( $fileName == $target && !$overwrite )
					throw new RuntimeException( 'File cannot be overwritten, use Parameter "overwrite".' );
				$file->writeString( $code );
				return TRUE;
			}
		}
		return FALSE;	
	}
40664
public function dump($var, $or = true)
    {
        $result = '';

        if ($var === null) {
            $result .= $this->dumpNull($or);
        } elseif (is_bool($var)) {
            $result .= $this->dumpBool($var, $or);
        } elseif (is_string($var)) {
            $result .= $this->dumpString($var, $or);
        } elseif (is_int($var)) {
            $result .= $this->dumpInt($var, $or);
        } elseif (is_float($var)) {
            $result .= $this->dumpFloat($var, $or);
        } elseif (is_array($var) || is_object($var)) {
            if ($this->recurseDepth >= $this->maxDepth) {
                $type = is_object($var) ? self::NAME_OBJECT : self::NAME_ARRAY;
                $maxDepthReached = $this->writeStart(false);
                $maxDepthReached .= $this->writeRow('<strong>'.$type.'</strong>');
                $maxDepthReached .= $this->writeRow('<span style="padding-left:10pt;font-style:italic;"><i>'
                    .self::DISPLAY_MAX_DEPTH.'</span>');
                $maxDepthReached .= $this->writeEnd();

                return $maxDepthReached;
            }
            $this->recurseDepth++;
            if (is_array($var)) {
                $result .= $this->dumpArray($var, $or);
            } else {
                $result .= $this->dumpObject($var, $or);
            }
            $this->recurseDepth--;
        } elseif (is_resource($var)) {
            $result .= $this->dumpRes($var, $or);
        } else {
            $result .= '???';
        }

        return $result;
    }
95614
public function lastModified($var = null)
    {
        if ($var !== null) {
            $this->last_modified = $var;
        }
        if (!isset($this->last_modified)) {
            $this->last_modified = (bool)Grav::instance()['config']->get('system.pages.last_modified');
        }

        return $this->last_modified;
    }
756838
public function copy($dest, $overwrite = true)
    {
        if (!$this->exists() || is_file($dest) && !$overwrite) {
            return false;
        }

        return copy($this->path, $dest);
    }
183601
public function assign($vars, $overwrite=true)
	{
		if(!$overwrite)
		{
			$vars = array_merge($this->_vars, $vars);
		}
		$this->_vars = $vars;
		return $this;
	}
268046
public static function files(string $variable, $default = null) {
		return isset(self::$_files[$variable])
			? self::$_files[$variable]
			: $default;
	}
11878
public static function dump($var, $title = false, $return = false) {
        // capture on return
        if($return)
            ob_start();

        // start pre, got title?
        echo '<pre style="'. implode(';', self::$pre) .'">';
        if($title)
            echo '<span style="'. implode(';', self::$title) .'">'. $title .'</span>';

        // do the deed and end pre
        var_dump($var);
        echo "</pre>";

        // return output
        return $return ? ob_get_clean() : true;
    }
1236238
function overwriteFullWithVariable($phpVariable)
    {
        $this->replacedState = self::FULLY_REPLACED;
        $this->phpVariable = $phpVariable;
        $this->setPHPCode('echo '.$phpVariable);
    }
939937
public static function dump($variable, $exit = true)
    {
        if (is_object($variable) && method_exists($variable, '__toString')) {
            echo $variable;
        } else {
            if (is_bool($variable)) {
                var_dump($variable);
            } else {

                $text = sprintf('<pre>%s</pre>', print_r($variable, true));
                print $text;
            }
        }

        if ($exit === true) {
            exit();
        }
    }
521733
public static function _unset($var) {
        Session::init(true);
        if (!Session::check_checksum()) return false;
        unset($_SESSION[$var]);
        $_SESSION[__SESSION_checksum_var] = Session::make_checksum();
        return true;
    }
1030893
public function setSyntax($var)
    {
        GPBUtil::checkString($var, True);
        $this->syntax = $var;
        $this->has_syntax = true;

        return $this;
    }