public static function write($filename, $data, $permission = 0777, $flags = LOCK_EX, $relative = true) {
		// if we have relative path we convert it to full path
		if ($relative && $filename[0] == '.') {
			$path = \Application::get('application.path_full');
			$info = pathinfo($filename);
			$filename = realpath($path . $info['dirname']) . DIRECTORY_SEPARATOR . $info['basename'];
		}
		// write file
		if (file_put_contents($filename, $data, $flags) !== false) {
			@chmod($filename, $permission);
			return true;
		}
		return false;
	}
public static function write($filename, $data, $permission = 0777, $flags = LOCK_EX, $relative = true) {
		// if we have relative path we convert it to full path
		if ($relative && $filename[0] == '.') {
			$path = \Application::get('application.path_full');
			$info = pathinfo($filename);
			$filename = realpath($path . $info['dirname']) . DIRECTORY_SEPARATOR . $info['basename'];
		}
		// write file
		if (file_put_contents($filename, $data, $flags) !== false) {
			@chmod($filename, $permission);
			return true;
		}
		return false;
	}
public static function write ( $ filename , $ data , $ permission = 0777 , $ flags = LOCK_EX , $ relative = true ) { // if we have relative path we convert it to full path if ( $ relative && $ filename [ 0 ] == '.' ) { $ path = \ Application :: get ( 'application.path_full' ) ; $ info = pathinfo ( $ filename ) ; $ filename = realpath ( $ path . $ info [ 'dirname' ] ) . DIRECTORY_SEPARATOR . $ info [ 'basename' ] ; } // write file if ( file_put_contents ( $ filename , $ data , $ flags ) !== false ) { @ chmod ( $ filename , $ permission ) ; return true ; } return false ; }
Write content to file and sets permissions

@param string $filename
@param mixed $data
@param int $permission
@param int $flags
@param boolean $relative
Write content to file and sets permissions