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


PHP Hash::init方法代码示例

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


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

示例1: insertData

 /**
  * insert the data
  *
  * @since 2.4.0
  *
  * @param array $optionArray options of the installation
  */
 public function insertData($optionArray = null)
 {
     $language = Language::getInstance();
     $language->init();
     /* articles */
     Db::forTablePrefix('articles')->create()->set(['title' => 'Welcome', 'alias' => 'welcome', 'author' => $optionArray['adminUser'], 'text' => file_get_contents('database/html/articles/welcome.phtml'), 'category' => 1, 'comments' => 1, 'rank' => 1])->save();
     /* categories */
     Db::forTablePrefix('categories')->create()->set(['title' => 'Home', 'alias' => 'home', 'author' => $optionArray['adminUser'], 'rank' => 1])->save();
     /* extras */
     $extrasArray = ['categories' => ['category' => null, 'headline' => 1, 'status' => 1], 'articles' => ['category' => null, 'headline' => 1, 'status' => 1], 'comments' => ['category' => null, 'headline' => 1, 'status' => 1], 'languages' => ['category' => null, 'headline' => 1, 'status' => 0], 'templates' => ['category' => null, 'headline' => 1, 'status' => 0], 'teaser' => ['category' => 1, 'headline' => 0, 'status' => 0]];
     $extrasRank = 0;
     /* process extras array */
     foreach ($extrasArray as $key => $value) {
         Db::forTablePrefix('extras')->create()->set(['title' => ucfirst($key), 'alias' => $key, 'author' => $optionArray['adminUser'], 'text' => file_get_contents('database/html/extras/' . $key . '.phtml'), 'category' => $value['category'], 'headline' => $value['headline'], 'status' => $value['status'], 'rank' => ++$extrasRank])->save();
     }
     /* comments */
     Db::forTablePrefix('comments')->create()->set(['author' => $optionArray['adminUser'], 'email' => $optionArray['adminEmail'], 'text' => file_get_contents('database/html/comments/hello.phtml'), 'article' => 1, 'rank' => 1])->save();
     /* groups */
     Db::forTablePrefix('groups')->create()->set(['name' => 'Administrators', 'alias' => 'administrators', 'description' => 'Unlimited access', 'categories' => '1, 2, 3', 'articles' => '1, 2, 3', 'extras' => '1, 2, 3', 'comments' => '1, 2, 3', 'groups' => '1, 2, 3', 'users' => '1, 2, 3', 'modules' => '1, 2, 3', 'settings' => 1, 'filter' => 0])->save();
     Db::forTablePrefix('groups')->create()->set(['name' => 'Members', 'alias' => 'members', 'description' => 'Default members group'])->save();
     /* modules */
     if (is_dir('modules/CallHome')) {
         $callHome = new Modules\CallHome\CallHome();
         $callHome->install();
     }
     if (is_dir('modules/Validator')) {
         $validator = new Modules\Validator\Validator();
         $validator->install();
     }
     /* settings */
     $settingArray = ['language' => 'detect', 'template' => 'default', 'title' => $language->get('name', '_package'), 'author' => $optionArray['adminName'], 'copyright' => null, 'description' => $language->get('description', '_package'), 'keywords' => null, 'robots' => null, 'email' => $optionArray['adminEmail'], 'subject' => $language->get('name', '_package'), 'notification' => 0, 'charset' => 'utf-8', 'divider' => ' - ', 'time' => 'H:i', 'date' => 'd.m.Y', 'homepage' => 0, 'limit' => 10, 'order' => 'asc', 'pagination' => 1, 'registration' => 1, 'verification' => 0, 'recovery' => 1, 'moderation' => 0, 'captcha' => 0, 'version' => $language->get('version', '_package')];
     /* process settings array */
     foreach ($settingArray as $name => $value) {
         Db::forTablePrefix('settings')->create()->set(['name' => $name, 'value' => $value])->save();
     }
     /* users */
     $passwordHash = new Hash(Config::getInstance());
     $passwordHash->init($optionArray['adminPassword']);
     Db::forTablePrefix('users')->create()->set(['name' => $optionArray['adminName'], 'user' => $optionArray['adminUser'], 'password' => $passwordHash->getHash(), 'email' => $optionArray['adminEmail'], 'description' => 'God admin', 'groups' => '1'])->save();
 }
开发者ID:redaxmedia,项目名称:redaxscript,代码行数:47,代码来源:Installer.php

示例2: ini_set

    //on the cloud change this with false
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL);
    error_reporting(E_ALL);
}
//--------------- 2. INCLUDES -------------------------------------------------------
file_exists(APP_PATH . '/application/util_func.php') ? include_once APP_PATH . "/application/util_func.php" : "";
file_exists(APP_PATH . '/library/Core.php') ? include_once APP_PATH . "/library/Core.php" : "";
if (file_exists(APP_PATH . '/library/recaptchalib.php')) {
    require_once APP_PATH . '/library/recaptchalib.php';
}
//------------ 3 INI CLASSES -------------------------------------------------------
Core::initialize();
Sessions::init();
CSRF::init();
Hash::init();
//----------------------4 ERROR REPORTING ---------------------------------------------
if ($local == false) {
    //set_error_handler('Errors::my_error_handler_prod');
    set_error_handler('Errors::my_error_handler', E_ALL);
    if (isset($_SESSION['system_error_message'])) {
        error_log($_SESSION['system_error_message'] . "\n", 3, "/home/remb4372/public_html/traian4/new-pdo/error.log");
    }
} else {
    set_error_handler('Errors::my_error_handler', E_ALL);
    if (isset($_SESSION['system_error_message'])) {
        error_log($_SESSION['system_error_message'] . "\n", 3, "C:\\Users\\victor92\\OneDrive\\htdocs\\traian4\\new-pdo\\error.log");
    }
}
// ------------ 5 CONFIG KEYS, ENCRYPTION FROM INI FILE ----------------------------
$sec = Config_ini::getConfig("sec");
开发者ID:TraianAlex,项目名称:dev,代码行数:31,代码来源:config.php


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