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


PHP PersistenceContext类代码示例

本文整理汇总了PHP中PersistenceContext的典型用法代码示例。如果您正苦于以下问题:PHP PersistenceContext类的具体用法?PHP PersistenceContext怎么用?PHP PersistenceContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: synchronize

 public function synchronize()
 {
     $this->bugs_number = array('total' => 0);
     $db_querier = PersistenceContext::get_querier();
     $config = BugtrackerConfig::load();
     $versions = $config->get_versions();
     $result = $db_querier->select("SELECT status, COUNT(*) as bugs_number\r\n\t\tFROM " . BugtrackerSetup::$bugtracker_table . "\r\n\t\tGROUP BY status\r\n\t\tORDER BY status ASC");
     foreach ($result as $row) {
         $this->bugs_number[$row['status']] = $row['bugs_number'];
         $this->bugs_number['total'] += $row['bugs_number'];
     }
     $result->dispose();
     $result = $db_querier->select("SELECT @fixed_in:=fixed_in AS fixed_in, \r\n\t\tCOUNT(*) as bugs_number, \r\n\t\t(SELECT COUNT(*) FROM " . BugtrackerSetup::$bugtracker_table . " WHERE fixed_in = @fixed_in AND status = '" . Bug::FIXED . "') as fixed_bugs_number, \r\n\t\t(SELECT COUNT(*) FROM " . BugtrackerSetup::$bugtracker_table . " WHERE fixed_in = @fixed_in AND (status = '" . Bug::IN_PROGRESS . "' OR status = '" . Bug::REOPEN . "')) as in_progress_bugs_number\r\n\t\tFROM " . BugtrackerSetup::$bugtracker_table . "\r\n\t\tGROUP BY fixed_in\r\n\t\tORDER BY fixed_in ASC");
     foreach ($result as $row) {
         if (!empty($row['fixed_in']) && isset($versions[$row['fixed_in']])) {
             $this->bugs_number_per_version[$row['fixed_in']] = array('all' => $row['bugs_number'], Bug::FIXED => $row['fixed_bugs_number'], Bug::IN_PROGRESS => $row['in_progress_bugs_number']);
         }
     }
     $result->dispose();
     $result = $db_querier->select("SELECT member.*, COUNT(*) as bugs_number\r\n\t\tFROM " . BugtrackerSetup::$bugtracker_table . " bugtracker\r\n\t\tJOIN " . DB_TABLE_MEMBER . " member ON member.user_id = bugtracker.author_id\r\n\t\tWHERE status <> '" . Bug::REJECTED . "'\r\n\t\tGROUP BY author_id\r\n\t\tORDER BY bugs_number DESC\r\n\t\tLIMIT " . $config->get_stats_top_posters_number());
     $i = 1;
     foreach ($result as $row) {
         $author = new User();
         if (!empty($row['user_id'])) {
             $author->set_properties($row);
         } else {
             $author->init_visitor_user();
         }
         $this->top_posters[$i] = array('user' => $author, 'bugs_number' => $row['bugs_number']);
         $i++;
     }
     $result->dispose();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:33,代码来源:BugtrackerStatsCache.class.php

示例2: get_page_authorizations

 private function get_page_authorizations()
 {
     $columns = 'auth';
     $condition = 'WHERE id = :id_in_module';
     $parameters = array('id_in_module' => $this->get_id_in_module());
     return PersistenceContext::get_querier()->get_column_value(PREFIX . 'pages', $columns, $condition, $parameters);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:PagesCommentsTopic.class.php

示例3: build_view

    public function build_view(HTTPRequestCustom $request)
    {
        $authorized_categories = FaqService::get_authorized_categories(Category::ROOT_CATEGORY);
        $mode = $request->get_getstring('sort', FaqUrlBuilder::DEFAULT_SORT_MODE);
        $field = $request->get_getstring('field', FaqUrlBuilder::DEFAULT_SORT_FIELD);
        $sort_mode = $mode == 'asc' ? 'ASC' : 'DESC';
        switch ($field) {
            case 'question':
                $sort_field = FaqQuestion::SORT_ALPHABETIC;
                break;
            default:
                $sort_field = FaqQuestion::SORT_DATE;
                break;
        }
        $result = PersistenceContext::get_querier()->select('SELECT *
		FROM ' . FaqSetup::$faq_table . ' faq
		LEFT JOIN ' . DB_TABLE_MEMBER . ' member ON member.user_id = faq.author_user_id
		WHERE approved = 0
		AND faq.id_category IN :authorized_categories
		' . (!FaqAuthorizationsService::check_authorizations()->moderation() ? ' AND faq.author_user_id = :user_id' : '') . '
		ORDER BY ' . $sort_field . ' ' . $sort_mode, array('authorized_categories' => $authorized_categories, 'user_id' => AppContext::get_current_user()->get_id()));
        $this->tpl->put_all(array('C_QUESTIONS' => $result->get_rows_count() > 0, 'C_PENDING' => true, 'C_MORE_THAN_ONE_QUESTION' => $result->get_rows_count() > 1, 'C_DISPLAY_TYPE_ANSWERS_HIDDEN' => FaqConfig::load()->is_display_type_answers_hidden(), 'QUESTIONS_NUMBER' => $result->get_rows_count()));
        while ($row = $result->fetch()) {
            $faq_question = new FaqQuestion();
            $faq_question->set_properties($row);
            $this->tpl->assign_block_vars('questions', $faq_question->get_array_tpl_vars());
        }
        $result->dispose();
        $this->build_sorting_form($field, $mode);
    }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:30,代码来源:FaqDisplayPendingFaqQuestionsController.class.php

示例4: build_view

    private function build_view($group_id)
    {
        if (!empty($group_id)) {
            $group = $this->groups_cache->get_group($group_id);
            $this->view->put_all(array('C_ADMIN' => AppContext::get_current_user()->check_level(User::ADMIN_LEVEL), 'U_ADMIN_GROUPS' => TPL_PATH_TO_ROOT . '/admin/admin_groups.php?id=' . $group_id, 'GROUP_NAME' => $group['name']));
        } else {
            $this->view->put_all(array('GROUP_NAME' => $this->lang['groups']));
        }
        $user_accounts_config = UserAccountsConfig::load();
        $number_member = 0;
        foreach ($this->get_members_group($group_id) as $user_id) {
            if (!empty($user_id)) {
                $user = PersistenceContext::get_querier()->select('SELECT 
					member.display_name, member.level, member.groups, member.warning_percentage, member.delay_banned, ext_field.user_avatar
					FROM ' . DB_TABLE_MEMBER . ' member
					LEFT JOIN ' . DB_TABLE_MEMBER_EXTENDED_FIELDS . ' ext_field ON ext_field.user_id = member.user_id
					WHERE member.user_id = :user_id
				', array('user_id' => $user_id))->fetch();
                if (!empty($user)) {
                    //Avatar
                    $user_avatar = !empty($user['user_avatar']) ? Url::to_rel($user['user_avatar']) : ($user_accounts_config->is_default_avatar_enabled() ? Url::to_rel('/templates/' . AppContext::get_current_user()->get_theme() . '/images/' . $user_accounts_config->get_default_avatar_name()) : '');
                    $group_color = User::get_group_color($user['groups'], $user['level']);
                    $this->view->assign_block_vars('members_list', array('C_AVATAR' => $user['user_avatar'] || $user_accounts_config->is_default_avatar_enabled(), 'C_GROUP_COLOR' => !empty($group_color), 'PSEUDO' => $user['display_name'], 'LEVEL' => $user['warning_percentage'] < '100' || time() - $user['delay_banned'] < 0 ? UserService::get_level_lang($user['level']) : $this->lang['banned'], 'LEVEL_CLASS' => UserService::get_level_class($user['level']), 'GROUP_COLOR' => $group_color, 'U_PROFILE' => UserUrlBuilder::profile($user_id)->rel(), 'U_AVATAR' => $user_avatar));
                    $number_member++;
                }
            }
        }
        $this->view->put_all(array('C_NOT_MEMBERS' => $number_member == 0, 'SELECT_GROUP' => $this->build_form($group_id)->display()));
    }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:29,代码来源:UserExploreGroupsController.class.php

示例5: insert_data

 private function insert_data()
 {
     $lang = LangLoader::get('install', 'bugtracker');
     PersistenceContext::get_querier()->insert(self::$bugtracker_table, array('id' => 1, 'title' => $lang['bug.1.title'], 'contents' => $lang['bug.1.contents'], 'author_id' => 1, 'submit_date' => time(), 'fix_date' => 0, 'status' => Bug::NEW_BUG, 'severity' => 1, 'priority' => 3, 'type' => 1, 'category' => 1, 'reproductible' => 1, 'reproduction_method' => '', 'detected_in' => 0, 'fixed_in' => 0, 'assigned_to_id' => 0));
     PersistenceContext::get_querier()->insert(self::$bugtracker_table, array('id' => 2, 'title' => $lang['bug.2.title'], 'contents' => $lang['bug.2.contents'], 'author_id' => 1, 'submit_date' => time() - 1000, 'fix_date' => time(), 'status' => Bug::FIXED, 'severity' => 2, 'priority' => 4, 'type' => 1, 'category' => 2, 'reproductible' => 1, 'reproduction_method' => '', 'detected_in' => 0, 'fixed_in' => 0, 'assigned_to_id' => 0));
     PersistenceContext::get_querier()->insert(self::$bugtracker_table, array('id' => 3, 'title' => $lang['bug.3.title'], 'contents' => $lang['bug.3.contents'], 'author_id' => 1, 'submit_date' => time(), 'fix_date' => 0, 'status' => Bug::REOPEN, 'severity' => 3, 'priority' => 5, 'type' => 1, 'category' => 3, 'reproductible' => 1, 'reproduction_method' => '', 'detected_in' => 0, 'fixed_in' => 0, 'assigned_to_id' => 0));
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:BugtrackerSetup.class.php

示例6: update_position

 private function update_position($request)
 {
     $fields_list = json_decode(TextHelper::html_entity_decode($request->get_value('tree')));
     foreach ($fields_list as $position => $tree) {
         PersistenceContext::get_querier()->inject("UPDATE " . DB_TABLE_MEMBER_EXTENDED_FIELDS_LIST . " SET \r\n\t\t\t\tposition = :position\r\n\t\t\t\tWHERE id = :id", array('position' => $position, 'id' => $tree->id));
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:AdminExtendedFieldsMemberListController.class.php

示例7: execute

 public function execute(HTTPRequestCustom $request)
 {
     $lang = LangLoader::get('common');
     $is_admin = AppContext::get_current_user()->check_level(User::ADMIN_LEVEL);
     $number_admins = UserService::count_admin_members();
     $suggestions = array();
     try {
         $result = PersistenceContext::get_querier()->select("SELECT user_id, display_name, level, groups FROM " . DB_TABLE_MEMBER . " WHERE display_name LIKE '" . str_replace('*', '%', $request->get_value('value', '')) . "%'");
         while ($row = $result->fetch()) {
             $user_group_color = User::get_group_color($row['groups'], $row['level']);
             $suggestion = '';
             if ($is_admin) {
                 $edit_link = new LinkHTMLElement(UserUrlBuilder::edit_profile($row['user_id']), '', array('title' => $lang['edit']), 'fa fa-edit');
                 if ($row['level'] != User::ADMIN_LEVEL || $row['level'] == User::ADMIN_LEVEL && $number_admins > 1) {
                     $delete_link = new LinkHTMLElement(AdminMembersUrlBuilder::delete($row['user_id']), '', array('title' => $lang['delete'], 'data-confirmation' => 'delete-element'), 'fa fa-delete');
                 } else {
                     $delete_link = new LinkHTMLElement('', '', array('title' => $lang['delete'], 'onclick' => 'return false;'), 'fa fa-delete icon-disabled');
                 }
                 $suggestion .= $edit_link->display() . '&nbsp;' . $delete_link->display() . '&nbsp;';
             }
             $profile_link = new LinkHTMLElement(UserUrlBuilder::profile($row['user_id'])->rel(), $row['display_name'], array('style' => !empty($user_group_color) ? 'color:' . $user_group_color : ''), UserService::get_level_class($row['level']));
             $suggestion .= $profile_link->display();
             $suggestions[] = $suggestion;
         }
         $result->dispose();
     } catch (Exception $e) {
     }
     return new JSONResponse(array('suggestions' => $suggestions));
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:29,代码来源:AjaxSearchUserAutoCompleteController.class.php

示例8: user_exists

 public function user_exists(FormField $field)
 {
     if ($field->get_value()) {
         return PersistenceContext::get_querier()->row_exists(DB_TABLE_MEMBER, 'WHERE display_name=:display_name', array('display_name' => $field->get_value()));
     }
     return false;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:FormFieldConstraintUserExist.class.php

示例9: delete_question

 private function delete_question(FaqQuestion $question)
 {
     FaqService::delete('WHERE id=:id', array('id' => $question->get_id()));
     PersistenceContext::get_querier()->delete(DB_TABLE_EVENTS, 'WHERE module=:module AND id_in_module=:id', array('module' => 'faq', 'id' => $question->get_id()));
     Feed::clear_cache('faq');
     FaqCache::invalidate();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:7,代码来源:FaqDeleteController.class.php

示例10: get_search_request

 public function get_search_request($args)
 {
     $search = $args['search'];
     $weight = isset($args['weight']) && is_numeric($args['weight']) ? $args['weight'] : 1;
     require_once PATH_TO_ROOT . '/pages/pages_defines.php';
     $categories = PagesCategoriesCache::load()->get_categories();
     $unauth_cats = '';
     if (!AppContext::get_current_user()->check_auth(PagesConfig::load()->get_authorizations(), READ_PAGE)) {
         $unauth_cats .= '0,';
     }
     foreach ($categories as $id => $cat) {
         if (!AppContext::get_current_user()->check_auth($cat['auth'], READ_PAGE)) {
             $unauth_cats .= $id . ',';
         }
     }
     $unauth_cats = !empty($unauth_cats) ? " AND p.id_cat NOT IN (" . trim($unauth_cats, ',') . ")" : '';
     $results = array();
     $result = PersistenceContext::get_querier()->select("SELECT " . $args['id_search'] . " AS `id_search`,\r\n\t\tp.id AS `id_content`,\r\n\t\tp.title AS `title`,\r\n\t\t( 2 * FT_SEARCH_RELEVANCE(p.title, '" . $args['search'] . "') + FT_SEARCH_RELEVANCE(p.contents, '" . $args['search'] . "') ) / 3 * " . $weight . " AS `relevance`,\r\n\t\tCONCAT('" . PATH_TO_ROOT . "/pages/pages.php?title=',p.encoded_title) AS `link`,\r\n\t\tp.auth AS `auth`\r\n\t\tFROM " . PREFIX . "pages p\r\n\t\tWHERE ( FT_SEARCH(title, '" . $args['search'] . "') OR FT_SEARCH(contents, '" . $args['search'] . "') )" . $unauth_cats . "\r\n\t\tLIMIT 100 OFFSET 0");
     while ($row = $result->fetch()) {
         if (!empty($row['auth'])) {
             $auth = unserialize($row['auth']);
             if (!AppContext::get_current_user()->check_auth($auth, READ_PAGE)) {
                 unset($row['auth']);
                 array_push($results, $row);
             }
         } else {
             unset($row['auth']);
             array_push($results, $row);
         }
     }
     $result->dispose();
     return $results;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:33,代码来源:PagesSearchable.class.php

示例11: execute

 function execute(HTTPRequestCustom $request)
 {
     session_start();
     $data = PersistenceContext::get_querier()->select_single_row(PREFIX . 'member', array('user_id'), 'WHERE login=:user_login', array('user_login' => $_SESSION['wpimport']['default_author']));
     $_SESSION['wpimport']['wppath'] = substr($_SESSION['wpimport']['wppath'], -1) != '/' ? $_SESSION['wpimport']['wppath'] . '/' : $_SESSION['wpimport']['wppath'];
     $_SESSION['wpimport']['phpboostpath'] = substr($_SESSION['wpimport']['phpboostpath'], -1) != '/' ? $_SESSION['wpimport']['phpboostpath'] . '/' : $_SESSION['wpimport']['phpboostpath'];
     define('WP_PATH', $_SESSION['wpimport']['wppath']);
     define('PBOOST_PATH', $_SESSION['wpimport']['phpboostpath']);
     define('IMPORTER_LIST', $_SESSION['wpimport']['importer']);
     define('PHPBOOST_CAT_IMAGE', $_SESSION['wpimport']['default_cat_image']);
     define('FILESYSTEM_IMPORT_LOCATION', $_SESSION['wpimport']['import_location']);
     define('DEFAULT_AUTHOR_ID', $data['user_id']);
     ini_set('max_execution_time', 0);
     if (function_exists('xdebug_disable')) {
         xdebug_disable();
     }
     ob_start();
     echo 'Start import : ' . date('H:i:s') . PHP_EOL;
     echo '-----' . PHP_EOL . PHP_EOL;
     $success = (require_once __DIR__ . '/../WP2PhpBoost/wp2phpboost.php');
     echo 'Clean cache...' . PHP_EOL;
     AppContext::get_cache_service()->clear_cache();
     echo PHP_EOL . PHP_EOL;
     echo '-----' . PHP_EOL;
     echo 'End import : ' . date('H:i:s');
     $logs = ob_get_clean();
     return new JSONResponse(array('success' => $success, 'logs' => utf8_decode($logs)));
 }
开发者ID:ppelisset,项目名称:WPImport,代码行数:28,代码来源:WPImportAjaxController.class.php

示例12: execute

 public function execute(HTTPRequestCustom $request)
 {
     $id = $request->get_getint('id', 0);
     if (!empty($id) && AppContext::get_current_user()->check_level(User::MEMBER_LEVEL)) {
         try {
             $this->downloadfile = DownloadService::get_downloadfile('WHERE download.id = :id', array('id' => $id));
         } catch (RowNotFoundException $e) {
             $error_controller = PHPBoostErrors::unexisting_page();
             DispatchManager::redirect($error_controller);
         }
     }
     if ($this->downloadfile !== null && $this->downloadfile->is_visible()) {
         if (!PersistenceContext::get_querier()->row_exists(PREFIX . 'events', 'WHERE id_in_module=:id_in_module AND module=\'download\' AND current_status = 0', array('id_in_module' => $this->downloadfile->get_id()))) {
             $contribution = new Contribution();
             $contribution->set_id_in_module($this->downloadfile->get_id());
             $contribution->set_entitled(StringVars::replace_vars(LangLoader::get_message('contribution.deadlink', 'common'), array('link_name' => $this->downloadfile->get_name())));
             $contribution->set_fixing_url(DownloadUrlBuilder::edit($this->downloadfile->get_id())->relative());
             $contribution->set_description(LangLoader::get_message('contribution.deadlink_explain', 'common'));
             $contribution->set_poster_id(AppContext::get_current_user()->get_id());
             $contribution->set_module('download');
             $contribution->set_type('alert');
             $contribution->set_auth(Authorizations::capture_and_shift_bit_auth(DownloadService::get_categories_manager()->get_heritated_authorizations($this->downloadfile->get_id_category(), Category::MODERATION_AUTHORIZATIONS, Authorizations::AUTH_CHILD_PRIORITY), Category::MODERATION_AUTHORIZATIONS, Contribution::CONTRIBUTION_AUTH_BIT));
             ContributionService::save_contribution($contribution);
         }
         DispatchManager::redirect(new UserContributionSuccessController());
     } else {
         $error_controller = PHPBoostErrors::unexisting_page();
         DispatchManager::redirect($error_controller);
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:30,代码来源:DownloadDeadLinkController.class.php

示例13: on_changeday

 /**
  * {@inheritDoc}
  */
 public function on_changeday(Date $yesterday, Date $today)
 {
     $config = ShoutboxConfig::load();
     if ($config->is_max_messages_number_enabled()) {
         PersistenceContext::get_querier()->delete(ShoutboxSetup::$shoutbox_table, 'WHERE id NOT IN (SELECT * FROM (SELECT id FROM ' . ShoutboxSetup::$shoutbox_table . ' ORDER BY id DESC LIMIT ' . $config->get_max_messages_number() . ') AS temp)');
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:10,代码来源:ShoutboxScheduledJobs.class.php

示例14: build_form

 private function build_form()
 {
     $picture_yes = '<i class="fa fa-success fa-2x" title="' . LangLoader::get_message('yes', 'common') . '"></i>';
     $picture_no = '<i class="fa fa-error fa-2x" title="' . LangLoader::get_message('no', 'common') . '"></i>';
     $picture_unknown = '<i class="fa fa-question fa-2x" title="' . LangLoader::get_message('unknown', 'main') . '"></i>';
     $default_lang_config = LangsManager::get_lang(LangsManager::get_default_lang())->get_configuration();
     $default_theme_config = ThemesManager::get_theme(ThemesManager::get_default_theme())->get_configuration();
     $editors = AppContext::get_content_formatting_service()->get_available_editors();
     $default_editor = $editors[ContentFormattingConfig::load()->get_default_editor()];
     $server_configuration = new ServerConfiguration();
     $general_config = GeneralConfig::load();
     $server_environment_config = ServerEnvironmentConfig::load();
     $sessions_config = SessionsConfig::load();
     $maintenance_config = MaintenanceConfig::load();
     $url_rewriting_available = false;
     $url_rewriting_known = true;
     try {
         $url_rewriting_available = $server_configuration->has_url_rewriting();
     } catch (UnsupportedOperationException $ex) {
         $url_rewriting_known = false;
     }
     $summerization = "---------------------------------System report---------------------------------\n-----------------------------generated by PHPBoost-----------------------------\nSERVER CONFIGURATION-----------------------------------------------------------\nphp version\t\t\t: " . ServerConfiguration::get_phpversion() . "\ndbms version\t\t\t: " . PersistenceContext::get_dbms_utils()->get_dbms_version() . "\ngd library\t\t\t: " . (int) $server_configuration->has_gd_library() . "\nurl rewriting\t\t\t: " . ($url_rewriting_known ? (int) $url_rewriting_available : 'N/A') . "\napcu cache\t\t\t: " . (int) DataStoreFactory::is_apc_available() . "\nPHPBOOST CONFIGURATION---------------------------------------------------------\nphpboost version\t\t: " . Environment::get_phpboost_version() . "\nserver url\t\t\t: " . $general_config->get_site_url() . "\nsite path\t\t\t: " . $general_config->get_site_path() . "\ndefault theme\t\t\t: " . $default_theme_config->get_name() . " (" . LangLoader::get_message('version', 'admin') . " " . $default_theme_config->get_version() . ")\ndefault language\t\t: " . $default_lang_config->get_name() . "\ndefault editor\t\t\t: " . $default_editor . "\nhome page\t\t\t: " . Environment::get_home_page() . "\nurl rewriting\t\t\t: " . (int) $server_environment_config->is_url_rewriting_enabled() . "\napcu cache\t\t\t: " . (int) DataStoreFactory::is_apc_enabled() . "\noutput gzip\t\t\t: " . (int) $server_environment_config->is_output_gziping_enabled() . "\nsession cookie name\t\t: " . $sessions_config->get_cookie_name() . "\nsession duration\t\t: " . $sessions_config->get_session_duration() . "\nactive session duration\t\t: " . $sessions_config->get_active_session_duration() . "\nDIRECTORIES AUTHORIZATIONS-----------------------------------------------------\n";
     $form = new HTMLForm('system-report', '', false);
     $this->get_advises($form);
     $fieldset = new FormFieldsetHTML('report', $this->admin_lang['server']);
     $form->add_fieldset($fieldset);
     $fieldset->add_field(new FormFieldFree('php_version', $this->admin_lang['php_version'], ServerConfiguration::get_phpversion()));
     $fieldset->add_field(new FormFieldFree('dbms_version', $this->admin_lang['dbms_version'], PersistenceContext::get_dbms_utils()->get_dbms_version()));
     $fieldset->add_field(new FormFieldFree('gd_library', $this->admin_lang['gd_library'], $server_configuration->has_gd_library() ? $picture_yes : $picture_no));
     $fieldset->add_field(new FormFieldFree('url_rewriting', $this->admin_lang['url_rewriting'], $url_rewriting_known ? $url_rewriting_available ? $picture_yes : $picture_no : $picture_unknown));
     $fieldset->add_field(new FormFieldFree('apcu_cache', LangLoader::get_message('apcu_cache', 'admin-cache-common'), DataStoreFactory::is_apc_available() ? $picture_yes : $picture_no));
     $fieldset = new FormFieldsetHTML('report', $this->admin_lang['phpboost_config']);
     $form->add_fieldset($fieldset);
     $fieldset->add_field(new FormFieldFree('kernel_version', $this->admin_lang['kernel_version'], Environment::get_phpboost_version()));
     $fieldset->add_field(new FormFieldFree('site_url', LangLoader::get_message('advanced-config.site_url', 'admin-config-common'), $general_config->get_site_url()));
     $fieldset->add_field(new FormFieldFree('site_path', LangLoader::get_message('advanced-config.site_path', 'admin-config-common'), $general_config->get_site_path()));
     $fieldset->add_field(new FormFieldFree('default_theme', LangLoader::get_message('general-config.default_theme', 'admin-config-common'), $default_theme_config->get_name() . " (" . LangLoader::get_message('version', 'admin') . " " . $default_theme_config->get_version() . ")"));
     $fieldset->add_field(new FormFieldFree('default_language', LangLoader::get_message('general-config.default_language', 'admin-config-common'), $default_lang_config->get_name()));
     $fieldset->add_field(new FormFieldFree('default_editor', LangLoader::get_message('content.config.default-formatting-language', 'admin-contents-common'), $default_editor));
     $fieldset->add_field(new FormFieldFree('start_page', LangLoader::get_message('general-config.start_page', 'admin-config-common'), Environment::get_home_page()));
     $fieldset->add_field(new FormFieldFree('phpboost_url_rewriting', $this->admin_lang['url_rewriting'], $server_environment_config->is_url_rewriting_enabled() ? $picture_yes : $picture_no));
     $fieldset->add_field(new FormFieldFree('phpboost_apcu_cache', LangLoader::get_message('apcu_cache', 'admin-cache-common'), DataStoreFactory::is_apc_enabled() ? $picture_yes : $picture_no));
     $fieldset->add_field(new FormFieldFree('output_gz', $this->admin_lang['output_gz'], $server_environment_config->is_output_gziping_enabled() ? $picture_yes : $picture_no));
     $fieldset->add_field(new FormFieldFree('cookie_name', LangLoader::get_message('advanced-config.cookie-name', 'admin-config-common'), $sessions_config->get_cookie_name()));
     $fieldset->add_field(new FormFieldFree('session_length', LangLoader::get_message('advanced-config.cookie-duration', 'admin-config-common'), $sessions_config->get_session_duration()));
     $fieldset->add_field(new FormFieldFree('session_guest_length', LangLoader::get_message('advanced-config.active-session-duration', 'admin-config-common'), $sessions_config->get_active_session_duration()));
     $fieldset = new FormFieldsetHTML('directories_auth', $this->admin_lang['directories_auth']);
     $form->add_fieldset($fieldset);
     $directories_summerization = '';
     foreach (PHPBoostFoldersPermissions::get_permissions() as $key => $folder) {
         $fieldset->add_field(new FormFieldFree(str_replace('/', '_', $key), $key, $folder->is_writable() ? $picture_yes : $picture_no));
         $directories_summerization .= $key . str_repeat('	', 5 - strlen($key) / 8) . ": " . (int) $folder->is_writable() . "\n";
     }
     $fieldset = new FormFieldsetHTML('summerization', $this->admin_lang['system_report_summerization']);
     $form->add_fieldset($fieldset);
     $fieldset->add_field(new FormFieldLabel($this->admin_lang['system_report_summerization_explain']));
     $fieldset->add_field(new FormFieldMultiLineTextEditor('summerization', '', $summerization . $directories_summerization, array('rows' => 20, 'cols' => 15, 'class' => 'system-report')));
     $this->form = $form;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:59,代码来源:AdminServerSystemReportController.class.php

示例15: synchronize

 /**
  * {@inheritdoc}
  */
 public function synchronize()
 {
     $this->stats = array();
     $querier = PersistenceContext::get_querier();
     $nbr_members = $querier->count(DB_TABLE_MEMBER);
     $last_member = $querier->select_single_row(DB_TABLE_MEMBER, array('user_id', 'display_name', 'level', 'groups'), 'ORDER BY registration_date DESC LIMIT 1 OFFSET 0');
     $this->stats = array('nbr_members' => $nbr_members, 'last_member_login' => $last_member['display_name'], 'last_member_id' => $last_member['user_id'], 'last_member_level' => $last_member['level'], 'last_member_groups' => $last_member['groups']);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:11,代码来源:StatsCache.class.php


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