Writes the failed actions file

@param string $fileName
@param type $actions
558582
protected function writeFailedActions($fileName, $actions)
    {
        $fileName = $this->basePath . '/' . $fileName;
        $this->filesystem->remove($fileName);
        if (!empty($actions)) $this->encode($fileName, $actions);
    }
830967
public static function writeFile($filePath, $fileData, $mode = 0600)
    {
        if (false === file_put_contents($filePath, $fileData)) {
            throw new RuntimeException(sprintf('unable to write file "%s"', $filePath));
        }
        if (false === chmod($filePath, $mode)) {
            throw new RuntimeException(sprintf('unable to set permissions on file "%s"', $filePath));
        }
    }
7403
public function save($fileName = null)
	{
		$file = fopen(empty($fileName) ? $this->fileName : $fileName,'w');
		flock($file,LOCK_EX);
		foreach($this->data as $section => $data)
		{
			fwrite($file, '[' . $section . ']' . PHP_EOL);
			foreach($data as $key => $value)
			{
				fwrite($file, $key . '=' . $value . PHP_EOL);
			}
		}
		fclose($file);
	}
828496
protected function callAction($actionName, $arguments = [])
    {
        // Keep the event as we might get called recursively.
        $keepEvent = $this->event;
        $event     = new ActionEvent($this->getEnvironment(), new Action($actionName, $arguments));
        $this->getEnvironment()->getEventDispatcher()->dispatch(DcGeneralEvents::ACTION, $event);
        // Restore the event as we might get called recursively.
        $this->event = $keepEvent;

        $this->getEvent()->setResponse($event->getResponse());
    }
734318
function write($filename,$content){
		if(!Config::read('App.Base.enable_cache')){
			return;
		}
		$expire = time() + ($this->getConfig('cache_expiration') * 60);

		$filename = md5($filename);
		$filepath = $this->getConfig('cache_path').$filename.'.tmp';

		if ( ! $fp = @fopen($filepath, 'w')){
			Loader::getClass('Sky.core.Log')->write(400,'Unable to write cache file: '.$filepath);
			Exceptions::showError('error', "Unable to write cache file: ".$filepath);
			
		}
		if (flock($fp, LOCK_EX))
		{
			fwrite($fp, $expire.'T_SKY-->'.$content);
			flock($fp, LOCK_UN);
		}
		else{
			Loader::getClass('Sky.core.Log')->write(300,'Unable to secure a file lock for file at: '.$filepath);
			return;
		}
		fclose($fp);
		@chmod($filepath,0755);
		
	}
1227053
public function execute(Config $config, IO $io, Repository $repository, Config\Action $action) : void
    {
        $changedPHPFiles = $repository->getIndexOperator()->getStagedFilesOfType('php');

        $io->write('linting files:', true, IO::VERBOSE);
        foreach ($changedPHPFiles as $file) {
            $io->write('  - ' . $file, true, IO::VERBOSE);
            if ($this->hasSyntaxErrors($file)) {
                throw new ActionFailed('syntax errors in file: ' . $file);
            }
        }
        $io->write('<info>No syntax errors detected</info>');
    }
1193926
public function writeFixedSizeFile($fileName, $fileSize)
    {
        $this->createFile($fileName, '');
        $this->inCurrentDir(function() use ($fileName, $fileSize) {
            $fh = fopen($fileName, 'w');
            fseek($fh, $fileSize - 1);
            fwrite($fh, "\0", 1);
            fclose($fh);
        });
    }
1227169
public function write( $fileName )
	{
		$lines	= array();
		if( $this->useSections )
		{
			foreach( $this->data as $section => $sectionPairs )
			{
				$lines[]	= "[".$section."]";
				foreach ( $sectionPairs as $key => $data )
				{
					$value		= $data['value'];
					$comment	= $data['comment'];
					$lines[]	= $this->buildLine( $key, $value, $comment);
				}
				$lines[]	= "";
			}
		}
		else
		{
			foreach( $this->data as $key => $data )
			{
				$value		= $data['value'];
				$comment	= $data['comment'];
				$lines[]	= $this->buildLine( $key, $value, $comment);
			}
			$lines[]	= "";
		}
		$file		= new FS_File_Writer( $fileName, 0664 );
		return $file->writeArray( $lines );
	}
331191
public static function putContents($filename, $contents)
    {
        $result = file_put_contents($filename, $contents, \LOCK_EX | \LOCK_NB);
        if ($result === false) {
            throw new \RuntimeException("Cannot write the file: " . $filename);
        }
    }
762478
static function writeFile( $filename,  $fileContent,  $flags=null){
        mkdir(dirname($filename), 0777, true);
        file_put_contents($filename,$fileContent,$flags);
    }
315266
public function write($content, $filename, $pathToFile = null, $mode = "w")
    {
        if ($pathToFile == null) {
            $pathToFile = $this->_filePath;
        }

        $this->createDir($pathToFile);

        $fileHandle = fopen($pathToFile."/".$filename, $mode);
        $success = fwrite($fileHandle, $content);
        fclose($fileHandle);

        return $success;
    }
179754
public function writeYamlFile($filename, $data)
    {
        try {
            // @todo Allow the inline and indent variables to be set via command line option.
            $yaml = Yaml::dump($data->export(), 3, 2);
        } catch (\Exception $e) {
            $this->output->writeln("<error>There was an error dumping the YAML contents for $filename.</error>");
            $this->output->writeln($e->getMessage());

            return false;
        }

        try {
            // @todo Use Symfony file system instead so that exceptions can be caught.
            file_put_contents($filename, $yaml);
        } catch (\Exception $e) {
            $this->output->writeln("<error>There was an writing to $filename.</error>");
            $this->output->writeln($e->getMessage());

            return false;
        }

        return true;
    }
899299
public function withAction(string $actionName)
    {
        if (!isset($this->actions[$actionName])) {
            throw InvalidArgumentException::format(
                'Invalid action name supplied to %s: expecting one of (%s), \'%s\' given',
                __METHOD__, Debug::formatValues(array_keys($this->actions)), $actionName
            );
        }

        call_user_func($this->callback, new ActionWidget($this->name, $this->label, $this->authSystem, $this->requiredPermissions, $this->actions[$actionName]));
    }
667057
public function executeActionsFromFile($fileName)
    {
        $actions = array();
        if (file_exists($fileName)) {
            $actionsClasses = $this->decode($fileName);

            foreach ($actionsClasses as $bundleName => $actionsClass){
                $this->actionManagerGenerator->generate($actionsClass);
                $actions[$bundleName] = $this->actionManagerGenerator->getActionManager();
            }

            $this->filesystem->remove($fileName);
        }
        $this->executeActions($actions);
    }
654335
protected function executeAction($actionName, $data)
    {
        $actionManager = $this->getActionManager();

        $currentAction = $actionManager->getAction();

        $actionManager->setAction($actionName);
        $actionManager->run($data);

        $actionManager->setAction($currentAction);
    }
46898
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->generateTar();																		// Encode processed files into TAR file format
		return FS_File_Writer::save( $fileName, $this->content );										//  write archive file
	}
575311
public static void write(String fileName, Collection<? extends Object> entries) {
        if (fileName == null) {
            throw new IllegalArgumentException("Must specify a file name to write to");
        }
        PrintWriter writer = null;
        File file = new File(fileName);
        try {
            file.mkdirs();
            if (file.exists()) {
                file.delete();
            }
            writer = new PrintWriter(new FileWriter(file), true);
            for (Object entry : entries) {
                writer.println(String.valueOf(entry));
            }
        }
        catch (Exception e) {
            throw new RuntimeException("Problem writing to " + file.getAbsolutePath(), e);
        }
        finally {
            try {
            	if(writer != null) {
            		writer.close();
                }
            }
            catch (Exception e) {
                //
            }
        }
    }