putContent

@param mixed $file
@param mixed $content

@access private
@return boolean
765297
private function putContent($file, $content)
    {
        $this->ensureExists(dirname($file));
        touch($file);

        return file_put_contents($file, serialize($content));
    }
1180990
public function addContent($content)
    {
        $freeBufferLength = $this->chunkSize - StringHelper::byteLength($this->_buffer);
        $contentLength = StringHelper::byteLength($content);
        if ($contentLength > $freeBufferLength) {
            $this->_buffer .= StringHelper::byteSubstr($content, 0, $freeBufferLength);
            $this->flushBuffer(true);
            return $this->addContent(StringHelper::byteSubstr($content, $freeBufferLength));
        } else {
            $this->_buffer .= $content;
            $this->flushBuffer();
        }

        return $this;
    }
1300354
public function write($file, $content, $type='sandbox')
	{
		$url = 'https://api-content.dropbox.com/1/files_put/';
		$result = $this->doOAuthCall($url,'PUT',null,$type,$file,$content);
		$result_body = json_decode($result['body'],true);
		if (!array_key_exists('error', $result_body)) {
			return $result_body;
		} else {
			trigger_error(sprintf(self::E_APIERROR, $result_body['error']));
			return false;
		}
	}
896202
public function compactContents($file, $contents)
    {
        foreach ($this->compactors as $compactor) {
            /** @var $compactor CompactorInterface */
            if ($compactor->supports($file)) {
                $contents = $compactor->compact($contents);
            }
        }

        return $contents;
    }
776425
protected static function setFile($content)
    {
        $root = Process::root;

        if (file_exists(Process::root.'config/alias.php')) {
            $file = fopen(Process::root.'config/alias.php', 'w');
            fwrite($file, $content);
            fclose($file);
            //
            return true;
        }

        return false;
    }
1338634
public function setContent($content)
	{
		if ($content instanceof \ArrayObject || is_array($content))
		{
			$this->headers['Content-Type'] = array('application/json');

			$content = json_encode($content);
		}

		$this->content = $content;
	}
561941
public static void saveFile(File file, String content) throws IOException {
        saveFile(file, content, false);
    }
1338156
private function setContent($name, $content)
    {
        $filename = $this->getCacheFileName($name);

        if ($this->options['thread_safe']) {
            $fd = fopen($filename, 'w+');
            flock($fd, LOCK_EX);
            $fr = fwrite($fd, $content);
            fclose($fd);

            return $fr;
        } else {
            return file_put_contents($filename, $content);
        }
    }
1293081
public function setContent($content)
    {
        $contentAttribute = $this->contentAttribute;
        if ($contentAttribute === false) {
            return;
        }
        if (is_array($contentAttribute)) {
            foreach ($contentAttribute as $key => $value) {
                $this->$value = $content[$key];
            }
            return;
        }
        $this->$contentAttribute = $content;
    }
423236
public function createFile($content, $node)
	{
		if(!file_exists(dirname($this->config['dir']['site'] . '/' . $node->getUrl())))
    	mkdir(dirname($this->config['dir']['site'] . '/' . $node->getUrl()), 0777, true);

    file_put_contents($this->config['dir']['site'] . '/' . $node->getUrl(), $content);
	}
954818
private function setContent($content)
    {
        $this->content = $content;

        if (empty($this->contentType)) {
            return;
        }

        //Remove charset from Content-Type
        if (strpos($this->contentType, ';') !== false) {
            list($mime, $charset) = array_map('trim', explode(';', $this->contentType));

            $this->contentType = $mime;
            $charset = str_replace(['"', "'"], '', substr(strstr($charset, '='), 1));
            $this->content = Utils::toUtf8($content, trim($charset));
        }
    }
417827
public function dump($file, $contents)
    {
        $filesystem = new Filesystem();
        $filesystem->dumpFile($file, $contents);
        $filesystem->chmod($file, 0644);
    }
1096793
protected function saveMap($file, $content){
		$dir = dirname($file);
		// directory does not exist
		if( !is_dir($dir) ){
			// FIXME: create the dir automatically?
			throw new Exception(sprintf('The directory "%s" does not exist. Cannot save the source map.', $dir));
		}
		// FIXME: proper saving, with dir write check!
		if(file_put_contents($file, $content) === false){
			throw new Exception(sprintf('Cannot save the source map to "%s"', $file));
		}
		return true;
	}
338437
public function putContents($file, $contents, $flag = null, $context = null)
    {
        $file = $this->basePath.'/'.ltrim($file, '/\\');

        return file_put_contents($file, $contents, $flag, $context);
    }
249707
public function save($path, $content)
    {
        $path = $this->getRealPath($path);
        if (!is_dir(dirname($path))) {
            @mkdir(dirname($path), 0755, true);
        }
        
        return file_put_contents($path, $content);
    }
798290
public function save($content)
    {
        $this->_isSaved = true;
        $this->_contentSaved = (string) $content;
        $this->_block->updateContent($this->_contentSaved);
        return $this;
    }
601566
public static function touch($filename, $content = '')
    {
        self::mkdir(dirname($filename));
        file_put_contents($filename, $content);
    }