当前位置: 首页>>代码示例>>PHP>>正文


PHP Settings::__construct方法代码示例

本文整理汇总了PHP中Settings::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::__construct方法的具体用法?PHP Settings::__construct怎么用?PHP Settings::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Settings的用法示例。


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

示例1: __construct

 public function __construct($path)
 {
     parent::__construct();
     //echo "__construct path='".$path."'<br/>";
     //normalize path string
     $path = trim($path, '/');
     //set full path of object
     $this->path = $path;
     $this->fullPath = $this->dataPrefix . '/' . $path;
     //echo "this->path = '".$this->path."'<br/>";
     //echo "this->fullPath = ".$this->fullPath."<br/>";
     //determine type
     if (!is_dir($this->fullPath)) {
         $ex = $this->getExtension();
     }
     if (is_dir($this->fullPath)) {
         $this->type = self::DIR;
     } else {
         if (in_array($ex, $this->video) && substr($this->getBaseName(), 0, 10) == 'converted_') {
             $this->type = self::VIDEO;
         } else {
             if (in_array($ex, $this->image)) {
                 $this->type = self::IMAGE;
             } else {
                 $this->type = self::UNKNOWN;
             }
         }
     }
 }
开发者ID:kabell,项目名称:gallery,代码行数:29,代码来源:gallery.php

示例2: __construct

 public function __construct($parentPage, $WordpressInsertPage, $selfPage)
 {
     parent::__construct($parentPage);
     $this->WordpressInsertPage = $WordpressInsertPage;
     $this->selfPage = $selfPage;
     $this->insertFacebookSDK();
 }
开发者ID:MythicAngel,项目名称:Wordpress-Solutions,代码行数:7,代码来源:fb.newPost.php

示例3: __construct

 public function __construct($mode = 'php', Misc $misc)
 {
     $this->mode = $mode;
     $this->misc = $misc;
     // Execute parent constructor
     parent::__construct();
     // Check if PHP version is the minimum required
     if (version_compare(PHP_VERSION, '5.3.3') < 0) {
         $version_parts = explode('-', PHP_VERSION);
         $version = current($version_parts);
         throw new Exception('PHP ' . $version . ' is too old. Must be at least version 5.3.3.');
     }
     // Check for Blowfish hashing support
     if ((defined('CRYPT_BLOWFISH') and CRYPT_BLOWFISH) === false) {
         throw new Exception('Failed to find CRYPT_BLOWFISH. Blowfish hashing support is required.');
     }
     // Exit if notification email is set to the default
     if ($this->notificationEmail === 'example@example.com') {
         throw new Exception('You must use a UNIQUE notification e-mail in ' . __FILE__);
     }
     // Exit if encryption key is set to the default
     if ($this->encryptionKey === '8CharKey') {
         throw new Exception('You must use a UNIQUE encryption key in ' . __FILE__);
     }
     // Exit if administrative password is set to the default
     if ($this->adminPassword === 'password') {
         throw new Exception('You must use a UNIQUE admin password in ' . __FILE__);
     }
     // Error if the script wasn't requested by this server
     if ($this->mode === 'javascript' and $this->refererCheck() === false) {
         throw new Exception('External use not allowed.');
     }
     // Instantiate encryption class
     $this->encryption = new Encryption($this->encryptionKey);
     // Disable password if name is disabled
     if ($this->fieldOptions['name'] === false) {
         $this->fieldOptions['password'] = false;
     }
     // Disable login if name or password is disabled
     if ($this->fieldOptions['name'] === false or $this->fieldOptions['password'] === false) {
         $this->allowsLogin = false;
     }
     // Disable autologin if login is disabled
     if ($this->allowsLogin === false) {
         $this->usesAutoLogin = false;
     }
     // Check if visitor is on mobile device
     if (!empty($_SERVER['HTTP_USER_AGENT'])) {
         if (preg_match('/(android|blackberry|phone)/i', $_SERVER['HTTP_USER_AGENT'])) {
             // Adjust settings to accommodate
             $this->isMobile = true;
             $this->imageFormat = 'svg';
         }
     }
     // Check for JSON settings file; parse it if it exists
     if (file_exists($this->rootDirectory . '/' . $this->JSONSettingsFile)) {
         $this->JSONSettings($this->rootDirectory . '/' . $this->JSONSettingsFile);
     }
 }
开发者ID:taophp,项目名称:hashover-next,代码行数:59,代码来源:setup.php

示例4: __construct

 public function __construct($settingsPage, $GroupInsertPage, $selfPage)
 {
     parent::__construct($settingsPage);
     $this->GroupInsertPage = $GroupInsertPage;
     $this->sql = new sqlService();
     $this->selfPage = $selfPage;
     $this->insertFacebookSDK();
 }
开发者ID:MythicAngel,项目名称:Wordpress-Solutions,代码行数:8,代码来源:fb.importGroups.php

示例5: __construct

 public function __construct($name, $display_name, $path)
 {
     parent::__construct($name, $display_name, $path);
     $this->_smartyPath = PATH_SMARTY_TPL . '/web' . $path;
 }
开发者ID:Auwibana,项目名称:babesk,代码行数:5,代码来源:ChangeEmail.php

示例6: __construct

 public function __construct($settingsPage, $EventInsertPage)
 {
     parent::__construct($settingsPage);
     $this->EventInsertPage = $EventInsertPage;
 }
开发者ID:MythicAngel,项目名称:Wordpress-Solutions,代码行数:5,代码来源:rss.php

示例7: __construct

 public function __construct($module)
 {
     parent::__construct(CONFIG_DIR . '/' . $module . '.json');
     $this->name = $module;
     $this->config = $this->read();
 }
开发者ID:Reeska,项目名称:restinpi,代码行数:6,代码来源:config.lib.php

示例8: __construct

 public function __construct($mode = 'javascript', $page_url, $page_title = '')
 {
     parent::__construct();
     // Check if PHP version is the minimum required
     if (version_compare(PHP_VERSION, '5.3.3') < 0) {
         $version_parts = explode('-', PHP_VERSION);
         $version = current($version_parts);
         exit($this->escapeOutput('<b>HashOver</b>: PHP ' . $version . ' is too old. Must be at least version 5.3.3.', 'single'));
     }
     // Check for Blowfish hashing support
     if ((defined('CRYPT_BLOWFISH') and CRYPT_BLOWFISH) === false) {
         exit($this->escapeOutput('<b>HashOver</b>: Failed to find CRYPT_BLOWFISH. Blowfish hashing support is required.', 'single'));
     }
     // Exit if encryption key is set to the default
     if ($this->encryptionKey === '8CharKey') {
         exit($this->escapeOutput('<b>HashOver</b>: You must use a UNIQUE encryption key in /hashover/scripts/settings.php', 'single'));
     }
     // Exit if notification email is set to the default
     if ($this->notificationEmail === 'example@example.com') {
         exit($this->escapeOutput('<b>HashOver</b>: You must use a UNIQUE notification e-mail in /hashover/scripts/settings.php', 'single'));
     }
     // Exit if administrative nickname is set to the default
     if ($this->adminName === 'admin') {
         exit($this->escapeOutput('<b>HashOver</b>: You must use a UNIQUE admin nickname in /hashover/scripts/settings.php', 'single'));
     }
     // Exit if administrative password is set to the default
     if ($this->adminPassword === 'password') {
         exit($this->escapeOutput('<b>HashOver</b>: You must use a UNIQUE admin password in /hashover/scripts/settings.php', 'single'));
     }
     // Set mode
     $this->mode = $mode;
     // Set page URL
     if (!empty($page_url)) {
         $this->pageURL = $page_url;
     } else {
         // Error on failure
         exit($this->escapeOutput('<b>HashOver</b>: Failed to obtain page URL.', 'single'));
     }
     // Set page title
     if (!empty($page_title)) {
         $this->pageTitle = $page_title;
     }
     // Instantiate encryption class
     $this->encryption = new Encryption($this->encryptionKey);
     // Strip escape slashes from POST, GET, and COOKIE data
     if (get_magic_quotes_gpc()) {
         $_GET = array_map('stripslashes', $_GET);
         $_COOKIE = array_map('stripslashes', $_COOKIE);
         $_POST = array_map('stripslashes', $_POST);
     }
     // Cookie replacement search patterns
     $cookie_search = array('&', '<', '>', '"', "'", '/');
     // Cookie replacement characters
     $cookie_replace = array('&amp;', '&lt;', '&gt;', '&quot;', '&#x27;', '&#x2F;');
     // Remove harmful characters from cookies
     foreach ($_COOKIE as $name => $value) {
         $_COOKIE[$name] = str_replace($cookie_search, $cookie_replace, $value);
     }
     // Setup user name via cookie
     if (!empty($_COOKIE['name']) and $_COOKIE['name'] !== $this->defaultName) {
         $this->userName = $_COOKIE['name'];
     }
     // Setup user password via cookie
     if (!empty($_COOKIE['password'])) {
         $this->userPassword = $_COOKIE['password'];
     }
     // Setup user e-mail via cookie
     if (!empty($_COOKIE['email'])) {
         $encrypted_email = trim(html_entity_decode($_COOKIE['email'], ENT_COMPAT, 'UTF-8'), " \r\n\t");
         $encryption_keys = !empty($_COOKIE['encryption']) ? $_COOKIE['encryption'] : '';
         $decrypted_email = $this->encryption->decrypt($encrypted_email, $encryption_keys);
         if (filter_var($decrypted_email, FILTER_VALIDATE_EMAIL)) {
             $this->userEmail = $decrypted_email;
         }
     }
     // Setup user website via cookie
     if (!empty($_COOKIE['website'])) {
         $this->userWebsite = $_COOKIE['website'];
     }
     // Check if user is logged in
     if (!empty($_COOKIE['hashover-login'])) {
         $this->userIsLoggedIn = true;
         // Check if user is logged in as admin
         if ($this->userName === $this->adminName) {
             if ($this->userPassword === $this->adminPassword) {
                 $this->userIsAdmin = true;
             }
         }
     }
     // Turn page URL into array
     $this->parsedURL = parse_url($this->pageURL);
     // Set initial path
     if (empty($this->parsedURL['path']) or $this->parsedURL['path'] === '/') {
         $this->threadDirectory = 'index';
     } else {
         // Remove starting slash
         $this->threadDirectory = substr($this->parsedURL['path'], 1);
     }
     if (!empty($this->parsedURL['query'])) {
         $this->parsedURL['query'] = explode('&', $this->parsedURL['query']);
//.........这里部分代码省略.........
开发者ID:archcidburnziso,项目名称:hashover-next,代码行数:101,代码来源:setup.php

示例9: __construct

 public function __construct()
 {
     $this->file = 'general.json';
     parent::__construct();
 }
开发者ID:TeNNoX,项目名称:Salic,代码行数:5,代码来源:GeneralSettings.php

示例10: __construct

 public function __construct($settingsPage, $EventInsertPage)
 {
     parent::__construct($settingsPage);
     $this->EventInsertPage = $EventInsertPage;
     $this->insertFacebookSDK();
 }
开发者ID:MythicAngel,项目名称:Wordpress-Solutions,代码行数:6,代码来源:fb.importEvent.php


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