• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_option_value函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_option_value函数的典型用法代码示例。如果您正苦于以下问题:PHP get_option_value函数的具体用法?PHP get_option_value怎么用?PHP get_option_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_option_value函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getBookmarksFile

/**
 * Get the bookmarks file as a string
 *
 * Uses the -f or --file parameter to open and read a
 * a bookmarks file
 *
 * @return string Contents of the file
 */
function getBookmarksFile()
{
    $filename = get_option_value('f', 'file');
    if (empty($filename)) {
        show_help();
        exit(1);
    }
    if (!file_exists($filename)) {
        // TRANS: Exception thrown when a file upload cannot be found.
        // TRANS: %s is the file that could not be found.
        throw new Exception(sprintf(_m('No such file "%s".'), $filename));
    }
    if (!is_file($filename)) {
        // TRANS: Exception thrown when a file upload is incorrect.
        // TRANS: %s is the irregular file.
        throw new Exception(sprintf(_m('Not a regular file: "%s".'), $filename));
    }
    if (!is_readable($filename)) {
        // TRANS: Exception thrown when a file upload is not readable.
        // TRANS: %s is the file that could not be read.
        throw new Exception(sprintf(_m('File "%s" not readable.'), $filename));
    }
    // TRANS: %s is the filename that contains a backup for a user.
    printfv(_m('Getting backup from file "%s".') . "\n", $filename);
    $html = file_get_contents($filename);
    return $html;
}
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:35,代码来源:importbookmarks.php


示例2: sphinx_base

function sphinx_base()
{
    if (have_option('base')) {
        return get_option_value('base');
    } else {
        return "/usr/local/sphinx";
    }
}
开发者ID:microcosmx,项目名称:experiments,代码行数:8,代码来源:sphinx-utils.php


示例3: init

function init($worker)
{
    Redis::setCacheServer(get_option_value($worker->config, 'resources.cache', '127.0.0.1:6379'));
    Redis::setQueueServer(get_option_value($worker->config, 'resources.queue', '127.0.0.1:6379'));
    $worker->tarthTimerLastTime = 0;
    $currentTime = time();
    $minBacktrackTime = $currentTime - MAX_BACKTRACK_SECONDS;
    //读取上次执行到的时间
    $dir = get_option_value($worker->config, 'main.working_dir', '/tmp');
    $worker->tarthTimerLastTimeFile = "{$dir}/timer-last-{$worker->index}";
    if (file_exists($worker->tarthTimerLastTimeFile)) {
        $worker->tarthTimerLastTime = intval(file_get_contents($worker->tarthTimerLastTimeFile));
    }
    if ($minBacktrackTime > $worker->tarthTimerLastTime) {
        $worker->tarthTimerLastTime = $minBacktrackTime;
    } elseif ($worker->tarthTimerLastTime > $currentTime) {
        $worker->tarthTimerLastTime = $currentTime;
    }
}
开发者ID:pythias,项目名称:Tarth,代码行数:19,代码来源:timer.php


示例4: getActivityStreamDocument

function getActivityStreamDocument()
{
    $filename = get_option_value('f', 'file');
    if (empty($filename)) {
        show_help();
        exit(1);
    }
    if (!file_exists($filename)) {
        throw new Exception("No such file '{$filename}'.");
    }
    if (!is_file($filename)) {
        throw new Exception("Not a regular file: '{$filename}'.");
    }
    if (!is_readable($filename)) {
        throw new Exception("File '{$filename}' not readable.");
    }
    // TRANS: Commandline script output. %s is the filename that contains a backup for a user.
    printfv(_("Getting backup from file '%s'.") . "\n", $filename);
    $xml = file_get_contents($filename);
    return $xml;
}
开发者ID:microcosmx,项目名称:experiments,代码行数:21,代码来源:restoreuser.php


示例5: getBookmarksFile

/**
 * Get the bookmarks file as a string
 * 
 * Uses the -f or --file parameter to open and read a
 * a bookmarks file
 *
 * @return string Contents of the file
 */
function getBookmarksFile()
{
    $filename = get_option_value('f', 'file');
    if (empty($filename)) {
        show_help();
        exit(1);
    }
    if (!file_exists($filename)) {
        throw new Exception("No such file '{$filename}'.");
    }
    if (!is_file($filename)) {
        throw new Exception("Not a regular file: '{$filename}'.");
    }
    if (!is_readable($filename)) {
        throw new Exception("File '{$filename}' not readable.");
    }
    // TRANS: %s is the filename that contains a backup for a user.
    printfv(_("Getting backup from file '%s'.") . "\n", $filename);
    $html = file_get_contents($filename);
    return $html;
}
开发者ID:microcosmx,项目名称:experiments,代码行数:29,代码来源:importbookmarks.php


示例6: siteStreamForOwner

function siteStreamForOwner(User $user)
{
    // The user we auth as must be the owner of the application.
    $auth = twitterAuthForUser($user);
    if (have_option('apiroot')) {
        $stream = new TwitterSiteStream($auth, get_option_value('apiroot'));
    } else {
        $stream = new TwitterSiteStream($auth);
    }
    // Pull Twitter user IDs for all users we want to pull data for
    $userIds = array();
    $flink = new Foreign_link();
    $flink->service = TWITTER_SERVICE;
    $flink->find();
    while ($flink->fetch()) {
        if (($flink->noticesync & FOREIGN_NOTICE_RECV) == FOREIGN_NOTICE_RECV) {
            $userIds[] = $flink->foreign_id;
        }
    }
    $stream->followUsers($userIds);
    return $stream;
}
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:22,代码来源:streamtest.php


示例7: getAtomFeedDocument

function getAtomFeedDocument()
{
    $filename = get_option_value('f', 'file');
    if (empty($filename)) {
        show_help();
        exit(1);
    }
    if (!file_exists($filename)) {
        throw new Exception("No such file '{$filename}'.");
    }
    if (!is_file($filename)) {
        throw new Exception("Not a regular file: '{$filename}'.");
    }
    if (!is_readable($filename)) {
        throw new Exception("File '{$filename}' not readable.");
    }
    $xml = file_get_contents($filename);
    $dom = DOMDocument::loadXML($xml);
    if ($dom->documentElement->namespaceURI != Activity::ATOM || $dom->documentElement->localName != 'feed') {
        throw new Exception("'{$filename}' is not an Atom feed.");
    }
    return $dom;
}
开发者ID:microcosmx,项目名称:experiments,代码行数:23,代码来源:importtwitteratom.php


示例8: define

 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../..'));
$shortoptions = "e:";
$helptext = <<<END_OF_REGISTERBYEMAIL_HELP
USAGE: registerbyemail.php
Registers a new user by email address and sends a confirmation email

  -e email     Email to register

END_OF_REGISTERBYEMAIL_HELP;
require_once INSTALLDIR . '/scripts/commandline.inc';
$email = get_option_value('e', 'email');
$parts = explode('@', $email);
$nickname = common_nicknamize($parts[0]);
$user = User::getKV('nickname', $nickname);
if (!empty($user)) {
    $confirm = new Confirm_address();
    $confirm->user_id = $user->id;
    $confirm->address_type = 'email';
    if ($confirm->find(true)) {
        $url = common_local_url('confirmfirstemail', array('code' => $confirm->code));
        print "{$url}\n";
    } else {
        print "User not waiting for confirmation.\n";
    }
    exit;
}
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:31,代码来源:registerbyemail.php


示例9: substr

            $is_en = substr($locale, 0, 2) == 'en';
            foreach ($languages as $language) {
                $return[] = array(isset($languages_self_list[$language]) ? $languages_self_list[$language] : $languages_list[$language] => array((isset($languages_list[$language]) ? $languages_list[$language] : $language) . ($is_en ? '' : ' - ' . $language) => $language));
            }
            if (!in_array('en', $languages) && !in_array('en_US', $languages) && !in_array('en_GB', $languages)) {
                $return[] = array('English' => array(is_eng_array('English', 'language', ' - ') => 'en_US'));
            }
            return $return;
        }
        function get_option_value($option, $default)
        {
            $value = get_option($option);
            return empty($value) ? $default : $value;
        }
        // TODO: Array for Settings.
        $options = array(array('title' => __('General'), 'id' => 'general', 'type' => 'panelstart'), array('title' => __('General'), 'type' => 'subtitle'), array('name' => is_eng_array('Language'), 'desc' => is_eng_array('If you want the system auto detect users browser language to show pages please select "Detect" option.'), 'id' => 'language', 'type' => 'select', 'options' => languages_options(), 'optgroup' => true, 'std' => defined("DCRM_LANG") ? DCRM_LANG : 'Detect'), array('name' => __('Rewrite Mod'), 'desc' => sprintf(__('<b>Elegant Mod</b> - Enable all rewrite rules, the url will show like %s.<br/><b>Normal Mod</b> - Compatible earlier than v1.7 configuration, only enbale a part of rewrite rules for HotLinks.<br/><b>Disabled</b> - This will disable all rewrite rules, so HotLinks will not work.<br/>Notice: You should update your rewrite config first if you want to use Elegant Mod.'), '<code>' . htmlspecialchars(base64_decode(DCRM_REPOURL)) . 'packages/1</code>'), 'id' => 'rewrite_mod', 'type' => 'select', 'options' => array(1 => __('Disable'), 2 => __('Normal'), 3 => __('Elegant')), 'std' => get_option_value('rewrite_mod', 2)), array('title' => __('Login Information'), 'type' => 'subtitle'), array('name' => __('Username'), 'id' => 'username', 'type' => 'text', 'attributes' => array('required' => 'required', 'minlength' => 4, 'maxlength' => 20, 'data-validation-minlength-message' => __('Username length must be between 4-20 characters!'), 'data-validation-regex-regex' => '^[0-9a-zA-Z\\_]*$', 'data-validation-regex-message' => __('Username can only use numbers, letters and underline!')), 'std' => htmlspecialchars($_SESSION['username'])), array('name' => __('New Password'), 'id' => 'pass1', 'type' => 'text', 'desc' => __('If you would like to change the password type a new one. Otherwise leave this blank.')), array('name' => __('Repeat New Password'), 'id' => 'pass2', 'type' => 'text', 'desc' => __('Type your new password again.'), 'attributes' => array('data-validation-match-match' => 'pass1', 'data-validation-match-message' => __('Your password do not match.')), 'special' => 'pass-strength-result'));
        function show_select($variable, $false_text = '', $true_text = '')
        {
            $select_array = array($_false ? $_false : 1 => $false_text ? $false_text : __('Disabled'), $_true ? $_true : 2 => $true_text ? $true_text : __('Enabled'));
            foreach ($select_array as $key => $value) {
                echo "<option value=\"{$key}\" " . ($key == $variable ? 'selected="selected"' : '') . ">{$value}</option>\n";
            }
        }
        ?>
				<h2><?php 
        _e('Preferences');
        ?>
</h2>
				<br />
				<form class="form-horizontal settingsform" method="POST" action="settings.php?action=set">
					<fieldset>
开发者ID:PONBBS,项目名称:WEIPDCRM,代码行数:31,代码来源:settings.php


示例10: common_log

                        Subscription::start($profile, $friend_profile);
                        common_log(LOG_INFO, $this->name() . ' - Subscribed ' . "{$friend_profile->nickname} to {$profile->nickname}.");
                    } catch (Exception $e) {
                        common_debug($this->name() . ' - Tried and failed subscribing ' . "{$friend_profile->nickname} to {$profile->nickname} - " . $e->getMessage());
                    }
                }
            }
        }
        return true;
    }
}
$id = null;
$debug = null;
if (have_option('i')) {
    $id = get_option_value('i');
} else {
    if (have_option('--id')) {
        $id = get_option_value('--id');
    } else {
        if (count($args) > 0) {
            $id = $args[0];
        } else {
            $id = null;
        }
    }
}
if (have_option('d') || have_option('debug')) {
    $debug = true;
}
$syncer = new SyncTwitterFriendsDaemon($id, 60, 2, $debug);
$syncer->runOnce();
开发者ID:phpsource,项目名称:gnu-social,代码行数:31,代码来源:synctwitterfriends.php


示例11: Webfinger

  -w --password Password of remote user
  -y --yes      do not wait for confirmation

Remote user identity must be a Webfinger ([email protected]) or 
an HTTP or HTTPS URL (http://example.com/social/site/user/nickname).

END_OF_MOVEUSER_HELP;
require_once INSTALLDIR . '/scripts/commandline.inc';
try {
    $user = getUser();
    $remote = get_option_value('r', 'remote');
    if (empty($remote)) {
        show_help();
        exit(1);
    }
    $password = get_option_value('w', 'password');
    if (!have_option('y', 'yes')) {
        print "WARNING: EXPERIMENTAL FEATURE! Moving accounts will delete data from the source site.\n";
        print "\n";
        print "About to PERMANENTLY move user '{$user->nickname}' to {$remote}. Are you sure? [y/N] ";
        $response = fgets(STDIN);
        if (strtolower(trim($response)) != 'y') {
            print "Aborting.\n";
            exit(0);
        }
    }
    $qm = QueueManager::get();
    $qm->enqueue(array($user, $remote, $password), 'acctmove');
} catch (Exception $e) {
    print $e->getMessage() . "\n";
    exit(1);
开发者ID:microcosmx,项目名称:experiments,代码行数:31,代码来源:moveuser.php


示例12: get_setting_array

function get_setting_array($item_id = '', $default = '', $echo = false, $offset = -1)
{
    return get_option_value($item_id, $default, $echo, true, $offset);
}
开发者ID:rinodung,项目名称:myfreetheme,代码行数:4,代码来源:spyropress-core-functions.php


示例13: get_option_value

  -k key       Key to look up; other args are ignored

ENDOFHELP;
require_once INSTALLDIR . '/scripts/commandline.inc';
$karg = get_option_value('k');
if (!empty($karg)) {
    $k = common_cache_key($karg);
} else {
    $table = get_option_value('t');
    if (empty($table)) {
        die("No table or key specified\n");
    }
    $column = get_option_value('c');
    if (empty($column)) {
        $column = 'id';
    }
    $value = get_option_value('v');
    $k = Memcached_DataObject::cacheKey($table, $column, $value);
}
print "Checking key '{$k}'...\n";
$c = common_memcache();
if (empty($c)) {
    die("Can't initialize cache object!\n");
}
$obj = $c->get($k);
if (empty($obj)) {
    print "Empty.\n";
} else {
    var_dump($obj);
    print "\n";
}
开发者ID:Br3nda,项目名称:laconica,代码行数:31,代码来源:showcache.php


示例14: init

function init($worker)
{
    Redis::setCacheServer(get_option_value($worker->config, 'resources.cache', '127.0.0.1:6379'));
    Redis::setQueueServer(get_option_value($worker->config, 'resources.queue', '127.0.0.1:6379'));
}
开发者ID:pythias,项目名称:Tarth,代码行数:5,代码来源:processor.php


示例15: get_option_value

$helptext = <<<END_OF_VERIFY_HELP
  verifycreds.php [options]
  Use an access token to verify credentials thru the api

    -o --oauth_token       access token
    -s --token_secret      access token secret

END_OF_VERIFY_HELP;
$token = null;
$token_secret = null;
require_once INSTALLDIR . '/scripts/commandline.inc';
if (have_option('o', 'oauth_token')) {
    $token = get_option_value('oauth_token');
}
if (have_option('s', 'token_secret')) {
    $token_secret = get_option_value('s', 'token_secret');
}
if (empty($token)) {
    print "Please specify an access token.\n";
    exit(1);
}
if (empty($token_secret)) {
    print "Please specify an access token secret.\n";
    exit(1);
}
$ini = parse_ini_file("oauth.ini");
$test_consumer = new OAuthConsumer($ini['consumer_key'], $ini['consumer_secret']);
$endpoint = $ini['apiroot'] . '/account/verify_credentials.xml';
print "{$endpoint}\n";
$at = new OAuthToken($token, $token_secret);
$parsed = parse_url($endpoint);
开发者ID:sukhjindersingh,项目名称:PHInest-Solutions,代码行数:31,代码来源:verifycreds.php


示例16: define

 * @author   Alvaro Ortego <[email protected]>
 *
 */
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
$shortoptions = 'n';
$longoptions = array('noticeid=');
$helptext = <<<END_OF_REGISTERUSER_HELP
grade.php [options]
read grades associated to a notice

  -n --noticeid id of the notice to grade

END_OF_REGISTERUSER_HELP;
require_once INSTALLDIR . '/scripts/commandline.inc';
require_once INSTALLDIR . '/local/plugins/Grades/classes/Grades.php';
$noticeid = get_option_value('n', 'noticeid');
if (empty($noticeid)) {
    print "Must provide a  notice id.\n";
    exit(1);
}
try {
    $notice = Notice::staticGet('notice', $noticeid);
    if (empty($notice)) {
        throw new Exception("A notice with id '{$noticeid}' must exists.");
    }
    print 'Current grade is :' . Grades::getNoticeGrade($noticeid) . ' ';
} catch (Exception $e) {
    print $e->getMessage() . "\n";
    print $e->getTraceAsString();
    exit(1);
}
开发者ID:Grasia,项目名称:bolotweet,代码行数:31,代码来源:graderead.php


示例17: add_procedures_fields

function add_procedures_fields($value, $column_name, $id)
{
    switch ($column_name) {
        case 'cws_proc_thumb':
            $fa_icon = get_option_value('cws-clinico-proc-fa', $id);
            if (!empty($fa_icon)) {
                echo '<i class="fa fa-' . $fa_icon . ' fa-2x"></i>';
            }
            break;
        case 'url':
            $url = get_option_value('cws-clinico-proc-url', $id);
            if (!empty($url)) {
                echo '<a href="' . $url . '">' . $url . '</a>';
            }
            break;
    }
}
开发者ID:evinw,项目名称:project_gg_studios,代码行数:17,代码来源:staff.php


示例18: define

 *
 */
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
$shortoptions = 'g';
$longoptions = array('groupnick=');
$helptext = <<<END_OF_REGISTERUSER_HELP
grade.php [options]
read grades associated to a notice

  -n --noticeid id of the notice to grade

END_OF_REGISTERUSER_HELP;
require_once INSTALLDIR . '/scripts/commandline.inc';
require_once INSTALLDIR . '/local/plugins/Grades/classes/Grades.php';
require_once INSTALLDIR . '/classes/Local_group.php';
$groupnick = get_option_value('g', 'groupnick');
try {
    if (empty($groupnick)) {
        $groups = Grades::getGroupsWithGrades();
        foreach ($groups as $key => $storedgroupnick) {
            reportGroupGrades($storedgroupnick);
        }
    } else {
        reportGroupGrades($groupnick);
    }
} catch (Exception $e) {
    print $e->getMessage() . "\n";
    print $e->getTraceAsString();
    exit(1);
}
function reportGroupGrades($groupnick)
开发者ID:Grasia,项目名称:bolotweet,代码行数:31,代码来源:gradereport.php


示例19: get_option_value

    -t --oauth_token        authorized request token
    -s --oauth_token_secret authorized request token secret
    -v --oauth_verifier     authorized request token verifier


END_OF_ETOKENS_HELP;
require_once INSTALLDIR . '/scripts/commandline.inc';
$token = $secret = $verifier = null;
if (have_option('t', 'oauth_token')) {
    $token = get_option_value('t', 'oauth_token');
}
if (have_option('s', 'oauth_token_secret')) {
    $secret = get_option_value('s', 'oauth_token_secret');
}
if (have_option('v', 'oauth_verifier')) {
    $verifier = get_option_value('v', 'oauth_verifier');
}
if (empty($token)) {
    print "Please specify the request token (--help for help).\n";
    exit(1);
}
if (empty($secret)) {
    print "Please specify the request token secret (--help for help).\n";
    exit(1);
}
if (empty($verifier)) {
    print "Please specify the request token verifier (--help for help).\n";
    exit(1);
}
$rtok = new OAuthToken($token, $secret);
$parsed = parse_url($endpoint);
开发者ID:microcosmx,项目名称:experiments,代码行数:31,代码来源:fetch_token_creds.php


示例20: have_option

    if (Validate::email($uri)) {
        $oprofile = LooseOstatusProfile::updateWebfinger($uri);
    } else {
        if (Validate::uri($uri)) {
            $oprofile = LooseOstatusProfile::updateProfileURL($uri);
        } else {
            print "Sorry, we could not reach the address: {$uri}\n";
            return false;
        }
    }
    return $oprofile;
}
$quiet = have_option('q', 'quiet');
$lop = new LooseOstatusProfile();
if (have_option('u', 'uri')) {
    $lop->uri = get_option_value('u', 'uri');
} else {
    if (!have_option('a', 'all')) {
        show_help();
        exit(1);
    }
}
$cnt = $lop->find();
if (!empty($cnt)) {
    if (!$quiet) {
        echo "Found {$cnt} OStatus profiles:\n";
    }
} else {
    if (have_option('u', 'uri')) {
        if (!$quiet) {
            echo "Couldn't find an existing OStatus profile with that URI.\n";
开发者ID:Grasia,项目名称:bolotweet,代码行数:31,代码来源:update_ostatus_profiles.php



注:本文中的get_option_value函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_options函数代码示例发布时间:2022-05-15
下一篇:
PHP get_option_tree函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap