当前位置: 首页>>代码示例>>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;未经允许,请勿转载。