PHP: Zookeeper::set - Manual


本站和网页 https://www.php.net/manual/zh/zookeeper.set.php 的作者无关,不对其内容负责。快照谨为网络故障时之索引,不代表被搜索网站的即时页面。

PHP: Zookeeper::set - Manual
Downloads
Documentation
Get Involved
Help
phpday 2023
Getting Started
Introduction
A simple tutorial
Language Reference
Basic syntax
Types
Variables
Constants
Expressions
Operators
Control Structures
Functions
Classes and Objects
Namespaces
Enumerations
Errors
Exceptions
Fibers
Generators
Attributes
References Explained
Predefined Variables
Predefined Exceptions
Predefined Interfaces and Classes
Predefined Attributes
Context options and parameters
Supported Protocols and Wrappers
Security
Introduction
General considerations
Installed as CGI binary
Installed as an Apache module
Session Security
Filesystem Security
Database Security
Error Reporting
User Submitted Data
Hiding PHP
Keeping Current
Features
HTTP authentication with PHP
Cookies
Sessions
Dealing with XForms
Handling file uploads
Using remote files
Connection handling
Persistent Database Connections
Command line usage
Garbage Collection
DTrace Dynamic Tracing
Function Reference
Affecting PHP's Behaviour
Audio Formats Manipulation
Authentication Services
Command Line Specific Extensions
Compression and Archive Extensions
Cryptography Extensions
Database Extensions
Date and Time Related Extensions
File System Related Extensions
Human Language and Character Encoding Support
Image Processing and Generation
Mail Related Extensions
Mathematical Extensions
Non-Text MIME Output
Process Control Extensions
Other Basic Extensions
Other Services
Search Engine Extensions
Server Specific Extensions
Session Extensions
Text Processing
Variable and Type Related Extensions
Web Services
Windows Only Extensions
XML Manipulation
GUI Extensions
Keyboard Shortcuts?
This help
Next menu item
Previous menu item
g p
Previous man page
g n
Next man page
Scroll to bottom
g g
Scroll to top
g h
Goto homepage
g s
Goto search(current page)
Focus search box
Zookeeper::setAcl »
« Zookeeper::isRecoverable
PHP 手册 函数参考 其它服务 ZooKeeper Zookeeper
Change language:
English
Brazilian Portuguese
Chinese (Simplified)
French
German
Japanese
Russian
Spanish
Turkish
Other
Submit a Pull Request
Report a Bug
Zookeeper::set
(PECL zookeeper >= 0.1.0)Zookeeper::set — Sets the data associated with a node
说明
public
Zookeeper::set( string $path, string $value, int $version = -1, array &$stat = null): bool
参数
path
The name of the node. Expressed as a file name with slashes separating ancestors of the node.
value
The data to be stored in the node.
version
The expected version of the node. The function will fail if the actual version of the node does not match the expected version. If -1 is used the version check will not take place.
stat
If not NULL, will hold the value of stat for the path on return.
返回值
成功时返回 true, 或者在失败时返回 false。
错误/异常
This method emits PHP error/warning when parameters count or types are wrong or fail to save value to node.
警告
Since version 0.3.0, this method emits ZookeeperException and it's derivatives.
范例
示例 #1 Zookeeper::set() example
Save value to node.
<?php$zookeeper = new Zookeeper('locahost:2181');$path = '/path/to/node';$value = 'nodevalue';$r = $zookeeper->set($path, $value);if ($r) echo 'SUCCESS';else echo 'ERR';?>
以上例程会输出:
SUCCESS
参见
Zookeeper::create() - Create a node synchronously
Zookeeper::get() - Gets the data associated with a node synchronously
ZookeeperException
+add a note
User Contributed Notes
There are no user contributed notes for this page.
Zookeeper
addAuth
close
connect
_&#8203;_&#8203;construct
create
delete
exists
get
getAcl
getChildren
getClientId
getConfig
getRecvTimeout
getState
isRecoverable
set
setAcl
setDebugLevel
setDeterministicConnOrder
setLogStream
setWatcher
Copyright 2001-2022 The PHP Group
My PHP.net
Contact
Other PHP.net sites
Privacy policy