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


PHP Folder::get_folders方法代码示例

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


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

示例1: get_available_langs

 public static function get_available_langs()
 {
     $langs_folder = new Folder(PATH_TO_ROOT . '/install/lang');
     $langs_list = $langs_folder->get_folders();
     $available_langs = array();
     foreach ($langs_list as $lang) {
         $available_langs[] = $lang->get_name();
     }
     return $available_langs;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:10,代码来源:InstallationServices.class.php

示例2: list_test_suite_recursive

function list_test_suite_recursive($directory, $recursive = false)
{
    $folders = array();
    $folder = new Folder($directory);
    foreach ($folder->get_folders('`^[^.].+$`') as $folder) {
        $folders[] = preg_replace('`^[\\./]*kernel`', '', $folder->get_path());
        if ($recursive) {
            $folders = array_merge($folders, list_test_suite_recursive($folder->get_path(), true));
        }
    }
    return $folders;
}
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:12,代码来源:phpboost_unit_tests.inc.php

示例3: get_not_installed_themes

 private function get_not_installed_themes()
 {
     $themes_not_installed = array();
     $folder_containing_phpboost_themes = new Folder(PATH_TO_ROOT . '/templates/');
     foreach ($folder_containing_phpboost_themes->get_folders() as $theme) {
         $name = $theme->get_name();
         if ($name !== 'default' && !ThemesManager::get_theme_existed($name)) {
             $themes_not_installed[] = $name;
         }
     }
     sort($themes_not_installed);
     return $themes_not_installed;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:13,代码来源:AdminThemesNotInstalledListController.class.php

示例4: get_not_installed_langs

 private function get_not_installed_langs()
 {
     $langs_not_installed = array();
     $folder_containing_phpboost_langs = new Folder(PATH_TO_ROOT . '/lang/');
     foreach ($folder_containing_phpboost_langs->get_folders() as $lang) {
         $name = $lang->get_name();
         if (!LangsManager::get_lang_existed($name)) {
             $langs_not_installed[] = $name;
         }
     }
     sort($langs_not_installed);
     return $langs_not_installed;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:13,代码来源:AdminLangsNotInstalledListController.class.php

示例5: add_language_bar

 private function add_language_bar()
 {
     $lang = AppContext::get_request()->get_string('lang', self::UPDATE_DEFAULT_LANGUAGE);
     $lang_dir = new Folder(PATH_TO_ROOT . '/lang');
     $langs = array();
     foreach ($lang_dir->get_folders('`^[a-z_-]+$`i') as $folder) {
         $info_lang = load_ini_file(PATH_TO_ROOT . '/lang/', $folder->get_name());
         if (!empty($info_lang['name'])) {
             $langs[] = array('LANG' => $folder->get_name(), 'LANG_NAME' => $info_lang['name'], 'SELECTED' => $folder->get_name() == $lang ? 'selected="selected"' : '');
             if ($folder->get_name() == $lang) {
                 $this->full_view->put('LANG_IDENTIFIER', $info_lang['identifier']);
             }
         }
     }
     $this->full_view->put('lang', $langs);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:16,代码来源:UpdateDisplayResponse.class.php

示例6: add_language_bar

 private function add_language_bar()
 {
     $lang = TextHelper::htmlspecialchars(AppContext::get_request()->get_string('lang', InstallController::DEFAULT_LOCALE));
     $lang = in_array($lang, InstallationServices::get_available_langs()) ? $lang : InstallController::DEFAULT_LOCALE;
     $lang_dir = new Folder(PATH_TO_ROOT . '/lang');
     $langs = array();
     foreach ($lang_dir->get_folders('`^[a-z_-]+$`i') as $folder) {
         $info_lang = load_ini_file(PATH_TO_ROOT . '/lang/', $folder->get_name());
         if (!empty($info_lang['name'])) {
             $langs[] = array('LANG' => $folder->get_name(), 'LANG_NAME' => $info_lang['name'], 'SELECTED' => $folder->get_name() == $lang ? 'selected="selected"' : '');
             if ($folder->get_name() == $lang) {
                 $this->full_view->put('LANG_IDENTIFIER', $info_lang['identifier']);
             }
         }
     }
     $this->full_view->put('lang', $langs);
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:17,代码来源:InstallDisplayResponse.class.php

示例7: find_desc_ini_file

 private static function find_desc_ini_file($module_id)
 {
     $desc_ini_folder = PATH_TO_ROOT . '/' . $module_id . '/lang/';
     $desc_ini_file = $desc_ini_folder . AppContext::get_current_user()->get_locale() . '/desc.ini';
     if (file_exists($desc_ini_file)) {
         return $desc_ini_file;
     }
     $folder = new Folder($desc_ini_folder);
     $folders = $folder->get_folders();
     foreach ($folders as $lang_folder) {
         $desc_ini_file = $lang_folder->get_path() . '/desc.ini';
         if (file_exists($desc_ini_file)) {
             return $desc_ini_file;
         }
     }
     throw new IOException('Module "' . $module_id . '" description desc.ini not found in' . '/' . $module_id . '/lang/');
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:17,代码来源:ModuleConfigurationManager.class.php

示例8: foreach

     foreach ($_POST as $key => $value) {
         if ($value == $LANG['update_module']) {
             $module_name = $key;
         }
     }
     $activ_module = retrieve(POST, $module_name . 'activ', 0);
 }
 $ckeck_module = $Sql->query("SELECT COUNT(*) FROM " . DB_TABLE_MODULES . " WHERE name = '" . strprotect($module_name) . "'", __LINE__, __FILE__);
 if (!empty($ckeck_module)) {
     $info_module = load_ini_file('../' . $module_name . '/lang/', get_ulang());
     $previous_version = $Sql->query("SELECT version FROM " . DB_TABLE_MODULES . " WHERE name = '" . strprotect($module_name) . "'", __LINE__, __FILE__);
     $dir_db_module = get_ulang();
     $dir = '../' . $module_name . '/db';
     import('io/filesystem/folder');
     $folder_path = new Folder($dir . '/' . $dir_db_module);
     foreach ($folder_path->get_folders('`^[a-z0-9_ -]+$`i') as $dir) {
         $dir_db_module = $dir->get_name();
         break;
     }
     $filesupdate = array();
     $dir_db = '../' . urldecode($module_name) . '/db/' . $dir_db_module . '/';
     $folder_path = new Folder($dir_db);
     foreach ($folder_path->get_files('`.*\\.(php|sql)$`i') as $files) {
         $file = $files->get_name();
         if (strpos($file, DBTYPE) !== false) {
             $array_info = explode('_', $file);
             if (isset($array_info[1]) && version_compare($info_module['version'], $array_info[1], '>=') && version_compare($previous_version, $array_info[1], '<')) {
                 $filesupdate[$array_info[1]] = $file;
             }
         }
     }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:admin_modules_update.php

示例9: import

        import('core/cache');
        $Cache = new Cache();
        $Cache->load('config');
        $Cache->load('modules');
        $Cache->load('themes');
        $template->assign_vars(array('C_END' => true, 'CONTENTS' => sprintf($LANG['end_installation']), 'L_ADMIN_INDEX' => $LANG['admin_index'], 'L_SITE_INDEX' => $LANG['site_index'], 'U_ADMIN_INDEX' => '../admin/admin_index.php', 'U_INDEX' => '..' . $CONFIG['start_page']));
        import('core/updates');
        new Updates();
        $Sql->close();
        break;
}
$steps = array(array($LANG['introduction'], 'intro.png', 0), array($LANG['license'], 'license.png', 10), array($LANG['config_server'], 'config.png', 30), array($LANG['database_config'], 'database.png', 40), array($LANG['advanced_config'], 'advanced_config.png', 80), array($LANG['administrator_account_creation'], 'admin.png', 90), array($LANG['end'], 'end.png', 100));
$step_name = $steps[$step - 1][0];
import('io/filesystem/folder');
$lang_dir = new Folder('../lang');
foreach ($lang_dir->get_folders('`[a-z_-]`i') as $folder) {
    $info_lang = load_ini_file('../lang/', $folder->get_name());
    if (!empty($info_lang['name'])) {
        $template->assign_block_vars('lang', array('LANG' => $folder->get_name(), 'LANG_NAME' => $info_lang['name'], 'SELECTED' => $folder->get_name() == $lang ? 'selected="selected"' : ''));
        if ($folder->get_name() == $lang) {
            $template->assign_vars(array('LANG_IDENTIFIER' => $info_lang['identifier']));
        }
    }
}
$template->assign_vars(array('PATH_TO_ROOT' => TPL_PATH_TO_ROOT, 'LANG' => $lang, 'NUM_STEP' => $step, 'PROGRESS_LEVEL' => $steps[$step - 1][2], 'L_TITLE' => $LANG['page_title'] . ' - ' . $step_name, 'L_STEP' => $step_name, 'L_STEPS_LIST' => $LANG['steps_list'], 'L_LICENSE' => $LANG['license'], 'L_INSTALL_PROGRESS' => $LANG['install_progress'], 'L_APPENDICES' => $LANG['appendices'], 'L_DOCUMENTATION' => $LANG['documentation'], 'U_DOCUMENTATION' => $LANG['documentation_link'], 'L_RESTART_INSTALL' => $LANG['restart_installation'], 'L_CONFIRM_RESTART' => $LANG['confirm_restart_installation'], 'L_LANG' => $LANG['change_lang'], 'L_CHANGE' => $LANG['change'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_UNKNOWN' => $LANG['unknown'], 'L_POWERED_BY' => $LANG['powered_by'], 'PHPBOOST_VERSION' => UPDATE_VERSION, 'L_PHPBOOST_RIGHT' => $LANG['phpboost_right'], 'U_RESTART' => add_lang('install.php')));
for ($i = 1; $i <= floor($steps[$step - 1][2] * 24 / 100); $i++) {
    $template->assign_block_vars('progress_bar', array());
}
for ($i = 1; $i <= STEPS_NUMBER; $i++) {
    if ($i < $step) {
        $row_class = 'row_success';
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:install.php

示例10: delete_old_menus

 private function delete_old_menus()
 {
     $menus_folder = new Folder(Url::to_rel('/menus'));
     if ($menus_folder->exists()) {
         foreach ($menus_folder->get_folders() as $menu) {
             $menu_id = 0;
             try {
                 $menu_id = self::$db_querier->get_column_value(DB_TABLE_MENUS, 'id', 'WHERE title LIKE :title', array('title' => $menu->get_name() . '%'));
             } catch (RowNotFoundException $e) {
             }
             if (!empty($menu_id)) {
                 self::$db_querier->delete(DB_TABLE_MENUS, 'WHERE id = :id', array('id' => $menu_id));
                 $this->add_information_to_file('menu ' . $menu->get_name(), 'has been uninstalled because : incompatible with new version');
             }
         }
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:17,代码来源:UpdateServices.class.php

示例11: import

 function update_mini_menus_list($update_cache = true)
 {
     global $Sql;
     import('io/filesystem/folder');
     $m_menus_directory = new Folder(PATH_TO_ROOT . '/menus');
     $m_menus_list = $m_menus_directory->get_folders();
     $menus_names = array();
     $installed_menus_names = array();
     $processed_folders = array();
     foreach ($m_menus_list as $menu) {
         $menus_names[] = $menu->get_name();
     }
     $query = "SELECT title FROM " . DB_TABLE_MENUS . " WHERE\n            class='" . strtolower(MINI_MENU__CLASS) . "';";
     $result = $Sql->query_while($query . ";", __LINE__, __FILE__);
     while ($menu = $Sql->fetch_assoc($result)) {
         $menu_folder = substr($menu['title'], 0, strpos($menu['title'], '/'));
         if (!in_array($menu_folder, $processed_folders)) {
             if (!in_array($menu_folder, $menus_names)) {
                 MenuService::delete_mini_menu($menu_folder);
             } else {
                 $installed_menus_names[] = $menu['title'];
             }
             $processed_folders[] = $menu_folder;
         }
     }
     $Sql->query_close($result);
     foreach ($m_menus_list as $menu) {
         MenuService::add_mini_menu($menu, $installed_menus_names);
     }
     if ($update_cache) {
         MenuService::generate_cache();
     }
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:33,代码来源:menu_service.class.php

示例12: get_modules_not_installed

 private function get_modules_not_installed()
 {
     $modules_not_installed = array();
     $modules_folder = new Folder(PATH_TO_ROOT);
     foreach ($modules_folder->get_folders() as $folder) {
         $folder_name = $folder->get_name();
         if ($folder_name != 'lang' && !ModulesManager::is_module_installed($folder_name)) {
             try {
                 $module = new Module($folder_name);
                 $module_configuration = $module->get_configuration();
                 $modules_not_installed[$folder_name] = $module;
             } catch (IOException $ex) {
                 continue;
             }
         }
     }
     sort($modules_not_installed);
     return $modules_not_installed;
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:19,代码来源:AdminModuleAddController.class.php

示例13: add_classes

 private static function add_classes($directory, $pattern, $recursive = true)
 {
     $files = array();
     $folder = new Folder($directory);
     $relative_path = Path::get_path_from_root($folder->get_path());
     $files = $folder->get_files($pattern);
     foreach ($files as $file) {
         $filename = $file->get_name();
         $classname = $file->get_name_without_extension();
         self::$autoload[$classname] = $relative_path . '/' . $filename;
     }
     if ($recursive) {
         $folders = $folder->get_folders('`^[a-z]{1}.*$`i');
         foreach ($folders as $a_folder) {
             if (!in_array($a_folder->get_path_from_root(), self::$exclude_paths) && !in_array($a_folder->get_name(), self::$exclude_folders_names)) {
                 self::add_classes($a_folder->get_path(), $pattern);
             }
         }
     }
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:20,代码来源:ClassLoader.class.php

示例14: addslashes

 function uninstall_module($module_id, $drop_files)
 {
     global $Cache, $Sql, $CONFIG, $MODULES;
     $module_name = $Sql->query("SELECT name FROM " . DB_TABLE_MODULES . " WHERE id = '" . $module_id . "'", __LINE__, __FILE__);
     if (!empty($module_id) && !empty($module_name)) {
         $Sql->query_inject("DELETE FROM " . DB_TABLE_MODULES . " WHERE id = '" . $module_id . "'", __LINE__, __FILE__);
         $info_module = load_ini_file(PATH_TO_ROOT . '/' . $module_name . '/lang/', get_ulang());
         $Cache->delete_file($module_name);
         if (!empty($info_module['com'])) {
             $Sql->query_inject("DELETE FROM " . DB_TABLE_COM . " WHERE script = '" . addslashes($info_module['com']) . "'", __LINE__, __FILE__);
         }
         if (!empty($info_module)) {
             $Sql->query_inject("DELETE FROM " . DB_TABLE_CONFIGS . " WHERE name = '" . addslashes($module_name) . "'", __LINE__, __FILE__);
         }
         import('core/menu_service');
         MenuService::delete_mini_module($module_name);
         MenuService::delete_module_feeds_menus($module_name);
         $dir_db_module = get_ulang();
         $dir = PATH_TO_ROOT . '/' . $module_name . '/db';
         import('io/filesystem/folder');
         $folder_path = new Folder($dir . '/' . $dir_db_module);
         foreach ($folder_path->get_folders('`^[a-z0-9_ -]+$`i') as $dir) {
             $dir_db_module = $dir->get_name();
             break;
         }
         if (file_exists(PATH_TO_ROOT . '/' . $module_name . '/db/' . $dir_db_module . '/uninstall_' . $module_name . '.' . DBTYPE . '.sql')) {
             $Sql->parse(PATH_TO_ROOT . '/' . $module_name . '/db/' . $dir_db_module . '/uninstall_' . $module_name . '.' . DBTYPE . '.sql', PREFIX);
         }
         if (file_exists(PATH_TO_ROOT . '/' . $module_name . '/db/' . $dir_db_module . '/uninstall_' . $module_name . '.php')) {
             @(include_once PATH_TO_ROOT . '/' . $module_name . '/db/' . $dir_db_module . '/uninstall_' . $module_name . '.php');
         }
         $Cache->Generate_file('modules');
         $Cache->Generate_file('css');
         MenuService::generate_cache();
         import('content/syndication/feed');
         Feed::clear_cache();
         if ($CONFIG['rewrite'] == 1 && !empty($info_module['url_rewrite'])) {
             $Cache->Generate_file('htaccess');
         }
         if ($drop_files) {
             $folder = new Folder(PATH_TO_ROOT . '/' . $module_name);
             if (!$folder->delete()) {
                 return MODULE_FILES_COULD_NOT_BE_DROPPED;
             }
         }
         return MODULE_UNINSTALLED;
     } else {
         return NOT_INSTALLED_MODULE;
     }
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:50,代码来源:packages_manager.class.php

示例15: redirect

    }
    $error = !empty($error) ? '?error=' . $error : '';
    redirect(HOST . SCRIPT . $error);
} else {
    $Template->set_filenames(array('admin_themes_add' => 'admin/admin_themes_add.tpl'));
    $Template->assign_vars(array('THEME' => get_utheme(), 'LANG' => get_ulang(), 'L_THEME_ADD' => $LANG['theme_add'], 'L_UPLOAD_THEME' => $LANG['upload_theme'], 'L_EXPLAIN_ARCHIVE_UPLOAD' => $LANG['explain_archive_upload'], 'L_UPLOAD' => $LANG['upload'], 'L_THEME_MANAGEMENT' => $LANG['theme_management'], 'L_THEME' => $LANG['theme'], 'L_PREVIEW' => $LANG['preview'], 'L_NO_THEME_ON_SERV' => $LANG['no_theme_on_serv'], 'L_RANK' => $LANG['rank'], 'L_AUTHOR' => $LANG['author'], 'L_COMPAT' => $LANG['compat'], 'L_DESC' => $LANG['description'], 'L_ACTIV' => $LANG['activ'], 'L_XHTML' => $LANG['xhtml_version'], 'L_CSS' => $LANG['css_version'], 'L_MAIN_COLOR' => $LANG['main_colors'], 'L_VARIABLE_WIDTH' => $LANG['exensible'], 'L_WIDTH' => $LANG['width'], 'L_YES' => $LANG['yes'], 'L_NO' => $LANG['no'], 'L_INSTALL' => $LANG['install']));
    $get_error = retrieve(GET, 'error', '');
    $array_error = array('e_upload_invalid_format', 'e_upload_invalid_format', 'e_upload_max_weight', 'e_upload_error', 'e_upload_failed_unwritable', 'e_upload_already_exist', 'e_theme_already_exist', 'e_unlink_disabled');
    if (in_array($get_error, $array_error)) {
        $Errorh->handler($LANG[$get_error], E_USER_WARNING);
    }
    $z = 0;
    import('io/filesystem/folder');
    $tpl_array = array();
    $lang_folder_path = new Folder('../templates/');
    foreach ($lang_folder_path->get_folders('`^[a-z0-9_ -]+$`i') as $lang) {
        $tpl_array[] = $lang->get_name();
    }
    $key = array_search('default', $tpl_array);
    if (isset($key)) {
        unset($tpl_array[$key]);
    }
    $result = $Sql->query_while("SELECT theme \n\tFROM " . DB_TABLE_THEMES . "", __LINE__, __FILE__);
    while ($row = $Sql->fetch_assoc($result)) {
        $key = array_search($row['theme'], $tpl_array);
        if ($key !== false) {
            unset($tpl_array[$key]);
        }
    }
    $Sql->query_close($result);
    $array_ranks = array(-1 => $LANG['guest'], 0 => $LANG['member'], 1 => $LANG['modo'], 2 => $LANG['admin']);
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:admin_themes_add.php


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