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


PHP Settings::instance方法代碼示例

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


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

示例1: getInstance

 public static function getInstance()
 {
     if (null === self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
開發者ID:pixelproduction,項目名稱:PixelManagerCMS,代碼行數:7,代碼來源:Settings.php

示例2: get_instance

 public static function get_instance()
 {
     if (self::$instance === NULL) {
         self::$instance = new self();
     }
     return self::$instance;
 }
開發者ID:ratatoeskr-cms,項目名稱:r7r-repo,代碼行數:7,代碼來源:models.php

示例3: getInstance

 /**
  * Singleton method that returns a unique instance of the class.
  *
  * @return
  */
 private static function getInstance()
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     return self::$instance;
 }
開發者ID:googlecode-mirror,項目名稱:balrog,代碼行數:12,代碼來源:Settings.class.php

示例4: getInstance

 public static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
開發者ID:OlesKashchenko,項目名稱:SkillsProject2,代碼行數:7,代碼來源:Settings.php

示例5: getInstance

 public static function getInstance()
 {
     if (self::$instance === null) {
         self::$instance = new Settings();
     }
     return self::$instance;
 }
開發者ID:GrapheneProject,項目名稱:Graphene,代碼行數:7,代碼來源:Settings.php

示例6: getInstance

 static function getInstance()
 {
     if (self::$instance == NULL) {
         self::$instance = new Settings();
     }
     return self::$instance;
 }
開發者ID:notUserDeveloper,項目名稱:fl-ru-damp,代碼行數:7,代碼來源:class.settings.php

示例7: initate

 static function initate()
 {
     $class = __CLASS__;
     if (!isset(self::$instance)) {
         self::$instance = new $class();
     }
     return self::$instance;
 }
開發者ID:Rastrian,項目名稱:Donationraptor,代碼行數:8,代碼來源:settings.php

示例8: getInstance

 function getInstance()
 {
     if (!isset(self::$instance)) {
         $c = __CLASS__;
         self::$instance = new $c();
     }
     return self::$instance;
 }
開發者ID:ngardner,項目名稱:BentoCMS,代碼行數:8,代碼來源:Settings.php

示例9: get_post_image_url

 public function get_post_image_url($filename)
 {
     $settings = Settings::instance();
     $supportedFormats = array("jpg", "png", "gif");
     $slug = pathinfo($filename, PATHINFO_FILENAME);
     foreach ($supportedFormats as $fmt) {
         $imgFile = sprintf("%s%s.%s", $settings->posts_dir, $slug, $fmt);
         if (file_exists($imgFile)) {
             return sprintf("%s/%s.%s", "{$blog_url}posts", $slug, $fmt);
         }
     }
     return false;
 }
開發者ID:dangerdan,項目名稱:Dropplets2,代碼行數:13,代碼來源:PostHelper.php

示例10: run

 public function run()
 {
     $menu = Menu::instance();
     $manager = Manager::instance();
     $settings = Settings::instance();
     $attachment_edit = AttachmentEdit::instance();
     $menu->set_manager($manager);
     $menu->set_settings($settings);
     $menu->init_pages();
     add_action('wpod', array($menu, 'add_components'));
     add_action('admin_enqueue_scripts', array($attachment_edit, 'enqueue_scripts'), 10, 1);
     add_action('attachment_submitbox_misc_actions', array($attachment_edit, 'attachment_submitbox_misc_actions'), 100, 0);
     add_filter('map_meta_cap', array($this, 'map_meta_cap'), 10, 4);
 }
開發者ID:felixarntz,項目名稱:wp-gcs-offload,代碼行數:14,代碼來源:Admin.php

示例11: instance

 private static function instance($mailer_settings = array())
 {
     if (empty(self::$default_settings)) {
         self::$default_settings = Settings::instance()->getValues('Emails');
     }
     if (empty($mailer_settings)) {
         $mailer_settings = self::$default_settings;
     }
     if (empty(self::$_mailer)) {
         self::$_mailer = new Mailer();
         self::$_mailer->LE = defined('IS_WINDOWS') ? "\r\n" : "\n";
         self::$_mailer->PluginDir = Registry::get('config.dir.lib') . 'vendor/phpmailer/phpmailer';
     }
     if ($mailer_settings['mailer_send_method'] == 'smtp') {
         self::$_mailer->IsSMTP();
         self::$_mailer->SMTPAuth = $mailer_settings['mailer_smtp_auth'] == 'Y' ? true : false;
         self::$_mailer->Host = $mailer_settings['mailer_smtp_host'];
         self::$_mailer->Username = $mailer_settings['mailer_smtp_username'];
         self::$_mailer->Password = $mailer_settings['mailer_smtp_password'];
         self::$_mailer->SMTPSecure = $mailer_settings['mailer_smtp_ecrypted_connection'];
     } elseif ($mailer_settings['mailer_send_method'] == 'sendmail') {
         self::$_mailer->IsSendmail();
         self::$_mailer->Sendmail = $mailer_settings['mailer_sendmail_path'];
     } else {
         self::$_mailer->IsMail();
     }
     return self::$_mailer;
 }
開發者ID:heg-arc-ne,項目名稱:cscart,代碼行數:28,代碼來源:Mailer.php

示例12: __construct

 public function __construct()
 {
     $this->settings = Settings::instance();
 }
開發者ID:dangerdan,項目名稱:Dropplets2,代碼行數:4,代碼來源:TemplateHelper.php

示例13: init

 public static function init() {
  if(! isset(self::$instance)) {
   self::$instance = new Settings(getrootdirsrvinclude()."settings.php"); 
  }
  return self::$instance;
 }
開發者ID:AragCF,項目名稱:extmail2,代碼行數:6,代碼來源:Settings.php

示例14: getInstance

 /**
  * Get Instance of Singleton Object
  *
  * @return Setting
  */
 public static function getInstance()
 {
     /* Check Instance */
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     /* Return */
     return self::$instance;
 }
開發者ID:REWAdrianGalbraith,項目名稱:erics-idx-collab-preston-guyton,代碼行數:14,代碼來源:Settings.php

示例15: __construct

 public function __construct()
 {
     $this->settings = Settings::instance();
     $this->tools = new Tools();
 }
開發者ID:dangerdan,項目名稱:Dropplets2,代碼行數:5,代碼來源:PostManager.php


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