Write the database

@param string $content the database content

@return boolean
174363
private static function write($content)
	{
		self::lock();
		if ( is_null( self::$authFileP ) ) throw new Exception( 'No lock has been requested' );
		ftruncate( self::$authFileP , 0 );
		fwrite( self::$authFileP , $content );

		return fflush( self::$authFileP );
	}
264239
public static function writeFile($file, $content) {
		if (!@is_file($file)) {
			$changePermissions = TRUE;
		}

		if ($fd = fopen($file, 'wb')) {
			$res = fwrite($fd, $content);
			fclose($fd);

			if ($res === FALSE) {
				return FALSE;
			}

			if ($changePermissions) { // Change the permissions only if the file has just been created
				self::fixPermissions($file);
			}

			return TRUE;
		}

		return FALSE;
	}
969678
public function write($content) {
        if (is_string($content) || is_numeric($content)) {
            $this->writeString($content);
        } elseif (is_bool($content)) {
            $this->writeString($content ? "TRUE" : "FALSE");
        } elseif (is_array($content)) {
            $this->writeString("Array(" . count($content) . ")");
        } elseif (is_object($content) && method_exists($content, "__toString")) {
            $this->writeString(strval($content));
        } elseif (is_null($content)) {
            $this->writeString("NULL");
        } elseif (is_resource($content)) {
            $this->writeString("Resource###");
        } else {
            throw new InvalidContentException();
        }
    }
992387
public function write($content)
    {
        if ($this->isReadable()) {
            throw new \RuntimeException("Cannot write to a readable message");
        }

        $this->writable = true;
        $content = trim($content);
        fwrite($this->resource, $content . "\n");
    }
1236079
public function save($contents)
	{
		// prep the contents
		$this->prep_vars($contents);
		$contents = serialize($contents);

		// update the config in the database
		$result = \DB::update($this->table)->set(array('config' => $contents, 'hash' => uniqid()))->where('identifier', '=', $this->identifier)->execute();

		// if there wasn't an update, do an insert
		if ($result === 0)
		{
			list($notused, $result) = \DB::insert($this->table)->set(array('identifier' => $this->identifier, 'config' => $contents, 'hash' => uniqid()))->execute();
		}

		return $result === 1;
	}
240002
public function setFileContent($content)
    {
        $this->getContent();

        if (!is_resource($content)) {
            $stream = fopen('php://memory', 'rwb+');
            fwrite($stream, $content);
            rewind($stream);
        } else {
            $stream = $content;
        }

        $this->content->setData($stream);

        return $this;
    }
535218
public function append( $content )
    {
        $prefix = $this->getPrefix();

        if (is_string( $prefix )) {
            $this->file->fwrite( $prefix . ': ' );
        }

        if (!is_string( $content )) {
            $content = var_export( $content, true );
        }

        $this->file->fwrite( $content );
        $this->file->fwrite( PHP_EOL );
        $this->file->fwrite( PHP_EOL );

        $this->incrementLineCount();
    }
582813
public function write($string)
    {
        if ($this->fd) {
            $ret = fwrite($this->fd, $string);
            if ($ret !== FALSE) {
                return $ret; 
            }
        }

        return false;
    }
1311438
public static function create(string $content): Stream
    {
        $resource = \fopen('php://temp', 'rwb+');
        $stream   = self::createFromResource($resource);
        $stream->write($content);

        return $stream;
    }
502442
public function setDataContent($content)
    {
        if (is_array($content)) {
            $this->headers->set('Content-Type', 'application/json');
            $content = json_encode($content);
        }

        $this->setContent($content);
    }
1335220
public function write($data)
    {
        if (!$this->connected) {
            if (!$this->connect()) {
                return false;
            }
        }
        return fwrite($this->connection, $data, strlen($data));
    }
798290
public function save($content)
    {
        $this->_isSaved = true;
        $this->_contentSaved = (string) $content;
        $this->_block->updateContent($this->_contentSaved);
        return $this;
    }
487102
private function setContent($content)
    {
        if (strpos($content, 'file://') === 0) {
            $content = $this->readFile($content);
        }

        $this->content = $content;
    }
814316
public function put($content)
    {
        $this->content = SerializationHelper::serialize($content);
        $url = $this->url;
        if (!empty($this->replaceParams)) {
            $url = self::buildUri($url, $this->replaceParams);
        }
        $this->adapter->setResponseTimeout($this->getResponseTimeout());
        $this->adapter->setConnectTimeout($this->getConnectTimeout());

        return $this->adapter->put(
            $url,
            array(
                self::HEADERS => $this->headers,
                self::CONTENT => $this->content,
            )
        );
    }
544931
public function write($key, $content)
    {
        $resource = tmpfile();
        fwrite($resource, $content);
        fseek($resource, 0);

        try {
            $this->client->putFile($key, $resource);
        } catch (\Exception $e) {
            fclose($resource);

            throw $e;
        }

        fclose($resource);

        return Util\Size::fromContent($content);
    }
954953
public function setContent( $content )
	{
		if( $this->content === (string) $content )
			return FALSE;
		$this->content = (string) $content;
		return TRUE;
	}
529440
private function write($content)
    {
        $handle = fopen($this->_config, 'w+');
        fwrite($handle, @json_encode($content));
        fclose($handle);
    }