本文整理汇总了PHP中array_search_ex函数的典型用法代码示例。如果您正苦于以下问题:PHP array_search_ex函数的具体用法?PHP array_search_ex怎么用?PHP array_search_ex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了array_search_ex函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_cmd_output
function create_cmd_output(&$action, &$a_mount, &$fullname)
{
$cmdout = CMDOUT_PARA_WOHINT;
ob_end_flush();
$retvalue = <<<EOD
{$cmdout}
EOD;
/* Get the id of the mount array entry. */
$id = array_search_ex($fullname, $a_mount, "fullname");
/* Get the mount data. */
$mount = $a_mount[$id];
switch ($action) {
case "mount":
$diskinit_str = gettext("Mounting '{$fullname}'...") . "<br />";
$result = disks_mount_fullname($fullname);
break;
case "umount":
$diskinit_str = gettext("Umounting '{$fullname}'...") . "<br />";
$result = disks_umount_fullname($fullname);
break;
}
/* Display result */
0 == $result ? $diskinit_str .= gettext("Successful") : ($diskinit_str .= gettext("Failed"));
$retvalue .= <<<EOD
<div id="ismounted_out" style="font-family: Courier, monospace; font-size: small;">
<pre style="font-family: Courier, monospace; font-size: small; font-style: italic;">{$diskinit_str}</pre>
</div>
EOD;
return $retvalue;
}
示例2: zfszpool_process_updatenotification
function zfszpool_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
$retval = zfs_zpool_configure($data);
break;
case UPDATENOTIFY_MODE_MODIFIED:
$retval = zfs_zpool_properties($data);
break;
case UPDATENOTIFY_MODE_DIRTY:
$cnid = array_search_ex($data, $config['zfs']['pools']['pool'], "uuid");
if (FALSE !== $cnid) {
zfs_zpool_destroy($data);
unset($config['zfs']['pools']['pool'][$cnid]);
write_config();
// remove existing pool cache
conf_mount_rw();
unlink_if_exists("{$g['cf_path']}/boot/zfs/zpool.cache");
conf_mount_ro();
}
break;
}
return $retval;
}
示例3: strip_exists
function strip_exists($device, &$a_vdevice)
{
if (false !== array_search_ex($diskv['devicespecialfile'], $a_vdevice, "device")) {
return true;
}
foreach ($a_vdevice as $vdevs) {
foreach ($vdevs['device'] as $dev) {
// label
$tmp = disks_label_to_device($dev);
if (strcmp($tmp, $device) == 0) {
return true;
}
// label+partition
$tmp = strip_partition($tmp);
if (strcmp($tmp, $device) == 0) {
return true;
}
// partition
$tmp = strip_partition($dev);
if (strcmp($tmp, $device) == 0) {
return true;
}
}
}
return false;
}
示例4: get_fs_type
function get_fs_type($devicespecialfile)
{
global $a_disk;
$index = array_search_ex($devicespecialfile, $a_disk, "devicespecialfile");
if (false === $index) {
return "";
}
return $a_disk[$index]['fstype'];
}
示例5: userdbgroup_process_updatenotification
function userdbgroup_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
$index = array_search_ex($data, $config['access']['group'], "uuid");
if (false !== $index) {
unset($config['access']['group'][$index]);
write_config();
}
break;
}
return $retval;
}
示例6: afpshare_process_updatenotification
function afpshare_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
$cnid = array_search_ex($data, $config['afp']['share'], "uuid");
if (FALSE !== $cnid) {
unset($config['afp']['share'][$cnid]);
write_config();
}
break;
}
return $retval;
}
示例7: routes_process_updatenotification
function routes_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
$cnid = array_search_ex($data, $config['staticroutes']['route'], "uuid");
if (FALSE !== $index) {
rc_exec_service("routing delete conf_" . strtr($config['staticroutes']['route'][$cnid]['uuid'], "-", "_"));
unset($config['staticroutes']['route'][$cnid]);
write_config();
}
break;
}
return $retval;
}
示例8: geli_process_updatenotification
function geli_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_DIRTY:
$cnid = array_search_ex($data, $config['geli']['vdisk'], "uuid");
if (FALSE !== $cnid) {
// Kill encrypted volume.
disks_geli_kill($config['geli']['vdisk'][$cnid]['devicespecialfile']);
// Reset disk file system type attribute ('fstype') in configuration.
set_conf_disk_fstype($config['geli']['vdisk'][$cnid]['device'][0], "");
unset($config['geli']['vdisk'][$cnid]);
write_config();
}
break;
}
return $retval;
}
示例9: rsynclocal_process_updatenotification
function rsynclocal_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
$cnid = array_search_ex($data, $config['rsync']['rsynclocal'], "uuid");
if (FALSE !== $cnid) {
unset($config['rsync']['rsynclocal'][$cnid]);
write_config();
}
@unlink("/var/run/rsync_local_{$data}.sh");
break;
}
return $retval;
}
示例10: ftpd_mod_ban_process_updatenotification
function ftpd_mod_ban_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
if (is_array($config['ftpd']['mod_ban']['rule'])) {
$index = array_search_ex($data, $config['ftpd']['mod_ban']['rule'], "uuid");
if (false !== $index) {
unset($config['ftpd']['mod_ban']['rule'][$index]);
write_config();
}
}
break;
}
return $retval;
}
示例11: zfszpool_process_updatenotification
function zfszpool_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
$retval = zfs_zpool_configure($data);
break;
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
$cnid = array_search_ex($data, $config['zfs']['pools']['pool'], "uuid");
if (FALSE !== $cnid) {
zfs_zpool_destroy($data);
unset($config['zfs']['pools']['pool'][$cnid]);
write_config();
}
break;
}
return $retval;
}
示例12: rcconf_process_updatenotification
function rcconf_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
break;
case UPDATENOTIFY_MODE_DIRTY:
if (is_array($config['system']['rcconf']['param'])) {
$index = array_search_ex($data, $config['system']['rcconf']['param'], "uuid");
if (false !== $index) {
mwexec2("/usr/local/sbin/rconf attribute remove {$config['system']['rcconf']['param'][$index]['name']}");
unset($config['system']['rcconf']['param'][$index]);
write_config();
}
}
break;
}
return $retval;
}
示例13: loaderconf_process_updatenotification
function loaderconf_process_updatenotification($mode, $data)
{
global $config;
$retval = 0;
switch ($mode) {
case UPDATENOTIFY_MODE_NEW:
case UPDATENOTIFY_MODE_MODIFIED:
write_loader_config();
write_config();
break;
case UPDATENOTIFY_MODE_DIRTY:
if (is_array($config['system']['loaderconf']['param'])) {
$index = array_search_ex($data, $config['system']['loaderconf']['param'], "uuid");
if (false !== $index) {
unset($config['system']['loaderconf']['param'][$index]);
write_loader_config();
write_config();
}
}
break;
}
return $retval;
}
示例14: gettext
if (is_ipv4addr($_POST['gateway']) && !is_ipv4addr($_POST['network'])) {
$input_errors[] = gettext("You must enter the same IP type for network and gateway.");
} else {
if (is_ipv6addr($_POST['gateway']) && !is_ipv6addr($_POST['network'])) {
$input_errors[] = gettext("IP type mismatch for network and gateway.");
}
}
}
// Check for overlaps
// gen_subnet work for IPv4 only... This function permit to fix user input error for network number.
if (is_ipv4addr($_POST['network'])) {
$osn = gen_subnet($_POST['network'], $_POST['network_subnet']) . "/" . $_POST['network_subnet'];
} else {
$osn = $_POST['network'] . "/" . $_POST['network_subnet'];
}
$index = array_search_ex($osn, $a_routes, "network");
if (FALSE !== $index) {
if (!(FALSE !== $cnid && $a_routes[$cnid]['uuid'] === $a_routes[$index]['uuid'])) {
$input_errors[] = gettext("A route to this destination network already exists.");
}
}
if (!$input_errors) {
$route = array();
$route['uuid'] = $_POST['uuid'];
$route['interface'] = $_POST['interface'];
$route['network'] = $osn;
$route['gateway'] = $_POST['gateway'];
$route['descr'] = $_POST['descr'];
if (isset($uuid) && FALSE !== $cnid) {
$a_routes[$cnid] = $route;
$mode = UPDATENOTIFY_MODE_MODIFIED;
示例15: gettext
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="22%" valign="top" class="vncellreq"><?php
echo gettext("Disk");
?>
</td>
<td width="78%" class="vtable">
<select name="name" class="formfld" id="name">
<?php
foreach ($a_phy_disk as $diskk => $diskv) {
?>
<?php
// Do not display disks that are already configured. (Create mode);
?>
<?php
if (!isset($uuid) && false !== array_search_ex($diskk, $a_disk, "name")) {
continue;
}
?>
<option value="<?php
echo $diskk;
?>
" <?php
if ($diskk == $pconfig['name']) {
echo "selected=\"selected\"";
}
?>
><?php
echo htmlspecialchars($diskk . ": " . $diskv['size'] . " (" . $diskv['model'] . ")");
?>
</option>