當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。