當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Options::getAll方法代碼示例

本文整理匯總了PHP中Options::getAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Options::getAll方法的具體用法?PHP Options::getAll怎麽用?PHP Options::getAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Options的用法示例。


在下文中一共展示了Options::getAll方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: updateFiles

 protected function updateFiles()
 {
     Cli::pinfo("Update Files");
     foreach (array("composer.json", "index.php", "setup") as $file) {
         Cli::pinfo(" * Update {$file}");
         $content = file_get_contents(getcwd() . DIRECTORY_SEPARATOR . $file);
         foreach (Options::getAll() as $key => $val) {
             $content = str_replace("@{$key}@", $val, $content);
         }
         $content = str_replace("@DATE@", date("r"), $content);
         $gitignore = trim(file_get_contents($this->getDir() . DIRECTORY_SEPARATOR . "project" . DIRECTORY_SEPARATOR . ".gitignore"));
         $content = str_replace("@EXCLUDES@", "\"" . implode(explode("\n", $gitignore), "\", \"") . "\"", $content);
         file_put_contents(getcwd() . DIRECTORY_SEPARATOR . $file, $content);
     }
 }
開發者ID:davbfr,項目名稱:cf,代碼行數:15,代碼來源:Skel.plugin.php

示例2: init

 /**
  * Plugin initialization callback.
  *
  * @global WP $wp
  *
  * @uses apply_filters()
  * @uses load_plugin_textdomain()
  * @uses load_textdomain()
  * @uses trailingslashit()
  */
 public function init()
 {
     global $wp;
     $domain = static::SLUG;
     $locale = \apply_filters('plugin_locale', \get_locale(), 'wp-cas-server');
     \load_textdomain($domain, \trailingslashit(WP_LANG_DIR) . $domain . '/' . $domain . '-' . $locale . '.mo');
     \load_plugin_textdomain($domain, FALSE, basename(\plugin_dir_path(dirname(__FILE__))) . '/languages/');
     if (!Options::getAll()) {
         Options::setDefaults();
     }
     $wp->add_query_var(static::QUERY_VAR_ROUTE);
     $this->addRewriteRules();
 }
開發者ID:goblindegook,項目名稱:wp-cas-server,代碼行數:23,代碼來源:Plugin.php

示例3: validateSettings

 /**
  * Validates and updates CAS server plugin settings.
  *
  * @param  array $input Unvalidated input arguments when settings are updated.
  *
  * @return array        Validated plugin settings to be saved in the database.
  *
  * @since 1.1.0
  */
 public function validateSettings($input)
 {
     $options = Options::getAll();
     $options['attributes'] = (array) $input['attributes'];
     return $options;
 }
開發者ID:rakesh-mohanta,項目名稱:wp-cas-server,代碼行數:15,代碼來源:Admin.php

示例4: cf_options

 public function cf_options($keys = null)
 {
     if ($keys == null) {
         $keys = array();
         foreach (Options::getAll() as $key => $val) {
             if (substr($key, -5) == "_PATH") {
                 $keys[] = $key;
             }
         }
     }
     $options = array();
     foreach (Options::getAll() as $key => $val) {
         if (in_array($key, $keys)) {
             $options[strtolower($key)] = $val;
         }
     }
     if (Session::Has(Session::rights_key)) {
         $options["rights"] = Session::Get(Session::rights_key);
     } else {
         $options["rights"] = array();
     }
     if (Session::Has(AbstractLogin::userid)) {
         $options["user"] = Session::Get(AbstractLogin::userid);
     } else {
         $options["user"] = false;
     }
     foreach (Plugins::dispatchAll("cf_options") as $opt) {
         $options = array_merge($options, $opt);
     }
     echo json_encode($options);
 }
開發者ID:davbfr,項目名稱:cf,代碼行數:31,代碼來源:Template.class.php


注:本文中的Options::getAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。