本文整理汇总了PHP中fn_get_dir_contents函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_dir_contents函数的具体用法?PHP fn_get_dir_contents怎么用?PHP fn_get_dir_contents使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_get_dir_contents函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Gets theme patterns
* @param string $style_id style ID
* @return array theme patterns
*/
public static function get($style_id)
{
$style_id = fn_basename($style_id);
$url = Registry::get('config.current_location') . '/' . fn_get_theme_path('[relative]/[theme]/media/images/patterns/' . $style_id . '/');
$patterns = self::getPath($style_id);
return fn_get_dir_contents($patterns, false, true, '', $url);
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:12,代码来源:Patterns.php
示例2: fn_get_payment_templates
function fn_get_payment_templates()
{
$templates = fn_get_dir_contents(DIR_SKINS . Registry::get('settings.skin_name_customer') . '/customer/views/orders/components/payments/', false, true, '.tpl');
if (is_array($templates)) {
foreach ($templates as $k => $v) {
$templates[$k] = $v;
}
}
return $templates;
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:10,代码来源:payments.php
示例3: fn_settings_variants_addons_hybrid_auth_icons_pack
function fn_settings_variants_addons_hybrid_auth_icons_pack()
{
$available_icons_packs = array();
$theme_name = Settings::instance()->getValue('theme_name', '');
$icons_dir = fn_get_theme_path('[themes]/', 'C') . $theme_name . '/media/images/addons/hybrid_auth/icons/';
$icons_packs = fn_get_dir_contents($icons_dir);
foreach ($icons_packs as $id => $icons_packs_name) {
$available_icons_packs[$icons_packs_name] = $icons_packs_name;
}
return $available_icons_packs;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:11,代码来源:func.php
示例4: fn_settings_variants_appearance_default_image_previewer
function fn_settings_variants_appearance_default_image_previewer()
{
$previewers_path = Registry::get('config.dir.root') . '/js/tygh/previewers';
$previewers = fn_get_dir_contents($previewers_path, false, true, 'js');
$return = array();
foreach ($previewers as $previewer) {
$previewer_description = fn_get_file_description($previewers_path . '/' . $previewer, 'previewer-description');
$return[fn_basename($previewer, '.previewer.js')] = $previewer_description;
}
return $return;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:11,代码来源:variants.functions.php
示例5: removeDirectoryContent
public static final function removeDirectoryContent($path)
{
if (is_array($path)) {
foreach ($path as $dir) {
self::removeDirectoryContent($dir);
}
return true;
}
self::removeFiles(fn_get_dir_contents($path, true, true, '', $path));
return true;
}
开发者ID:askzap,项目名称:ultimate,代码行数:11,代码来源:TwigmoUpgradeMethods.php
示例6: get
/**
* Gets theme patterns
* @param string $style_id style ID
* @param boolean $url_prefix prefix files with URL if set to true
* @return array theme patterns
*/
public function get($style_id, $url_prefix = true)
{
$style_id = fn_basename($style_id);
$patterns = $this->getPath($style_id);
$url = $this->getUrl($style_id);
$prefix = $patterns . '/';
if ($url_prefix) {
$prefix = Registry::get('config.current_location') . '/' . fn_get_rel_dir($this->getPath($style_id) . '/');
}
return fn_get_dir_contents($patterns, false, true, '', $prefix);
}
开发者ID:askzap,项目名称:ultimate,代码行数:17,代码来源:Patterns.php
示例7: create
/**
* Generates new snapshot
* @param array $params params list
*/
public static function create($params)
{
if (empty($params['dir_root'])) {
$params['dir_root'] = Registry::get('config.dir.root');
}
if (empty($params['dist'])) {
$params['dist'] = false;
}
$dir_root = $params['dir_root'];
$dist = $params['dist'];
$folders = array('app', 'js', $params['theme_rel_backend']);
if ($dist) {
$themes_dir = $params['themes_repo'];
$themes_dir_to = $params['themes_frontend'];
} else {
$themes_dir = $params['themes_frontend'];
}
$themes = fn_get_dir_contents($themes_dir);
$snapshot = array('time' => time(), 'files' => array(), 'dirs' => array(), 'themes' => array());
if ($dist) {
$snapshot['db_scheme'] = fn_get_contents($dir_root . '/install/database/scheme.sql');
// remove myslqdump comments
$snapshot['db_scheme'] = preg_replace('|/\\*!.+\\*/;\\n|imSU', '', $snapshot['db_scheme']);
// form list of tables
preg_match_all('/create table `(.+)`/imSU', $snapshot['db_scheme'], $tables);
$snapshot['db_tables'] = !empty($tables[1]) ? $tables[1] : array();
}
$new_snapshot = self::make($dir_root, $folders, array('config.local.php'));
self::arrayMerge($snapshot, $new_snapshot);
foreach ($folders as $folder_name) {
$path = $dir_root . '/' . $folder_name;
$new_snapshot = self::make($path);
self::arrayMerge($snapshot, $new_snapshot);
}
foreach ($themes as $theme_name) {
if (is_numeric($theme_name) && $theme_name === strval($theme_name + 0)) {
continue;
// this is company subfolder
}
$path = "{$themes_dir}/{$theme_name}";
if ($dist) {
$new_snapshot = self::make($path, array(), array(), array($themes_dir => $themes_dir_to), true);
} else {
$new_snapshot = self::make($path, array(), array(), array(), true);
}
$snapshot['themes'][$theme_name]['files'] = $snapshot['themes'][$theme_name]['dirs'] = array();
self::arrayMerge($snapshot['themes'][$theme_name], $new_snapshot);
}
$snapshot['addons'] = fn_get_dir_contents(Registry::get('config.dir.addons'));
fn_mkdir(Registry::get('config.dir.snapshots'));
$snapshot_filename = fn_strtolower(PRODUCT_VERSION . '_' . (PRODUCT_STATUS ? PRODUCT_STATUS . '_' : '') . PRODUCT_EDITION . ($dist ? '_dist' : ''));
$snapshot_filecontent = '<?php $snapshot' . ($dist ? '_dist' : '') . ' = ' . var_export($snapshot, true) . '; ?>';
fn_put_contents(Registry::get('config.dir.snapshots') . "{$snapshot_filename}.php", $snapshot_filecontent);
}
开发者ID:askzap,项目名称:ultimate,代码行数:58,代码来源:Snapshot.php
示例8: _getAddons
/**
* Returns addons list that need be installed for some PRODUCT TYPE
*
* @param string $product_type Product type
* @return array List af addons
*/
private function _getAddons($product_type = PRODUCT_EDITION)
{
$available_addons = fn_get_dir_contents(Registry::get('config.dir.addons'), true, false);
$addons_list = array();
foreach ($available_addons as $addon_name) {
$scheme = SchemesManager::getScheme($addon_name);
if (!empty($scheme)) {
$auto_install = $scheme->autoInstallFor();
if (in_array($product_type, $auto_install)) {
$addons_list[] = $addon_name;
}
}
}
return $addons_list;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:21,代码来源:AddonsSetup.php
示例9: getList
/**
* Gets list of styles
*
* @return array List of available styles
*/
public function getList($params = array())
{
$styles = array();
$style_files = array();
$path = $this->getStylesPath();
$style_files = fn_get_dir_contents($path, false, true, 'less');
fn_set_hook('styles_get_list', $style_files, $params);
if (!empty($style_files)) {
foreach ($style_files as $id => $style_id) {
$style_id = fn_basename($style_id, '.less');
$styles[$style_id] = self::get($style_id, $params);
}
}
return $styles;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:20,代码来源:Styles.php
示例10: rotate
public function rotate()
{
if (file_exists($this->path . $this->filename)) {
if (empty($this->save_name)) {
$this->save_name = date('log_commerceml.txt', TIME);
}
fn_rename($this->path . $this->filename, $this->path . $this->save_name);
$logs_list = fn_get_dir_contents($this->path, false, true);
if (!empty($logs_list) && count($logs_list) > self::MAX_LOGS_FILE) {
rsort($logs_list);
list(, $old_logs) = array_chunk($logs_list, self::MAX_LOGS_FILE);
foreach ($old_logs as $filename) {
fn_rm($this->path . $filename);
}
}
}
}
开发者ID:ambient-lounge,项目名称:site,代码行数:17,代码来源:Logs.php
示例11: fn_mp_get_setting_templates
function fn_mp_get_setting_templates()
{
$templates = array();
$skin_path = fn_get_theme_path('[themes]/[theme]', 'A');
$relative_directory_path = 'addons/maps_provider/settings/';
$template_path = $skin_path . '/templates/' . $relative_directory_path;
$_templates = fn_get_dir_contents($template_path, false, true, '.tpl');
if (!empty($_templates)) {
$needles = array('settings_', '.tpl');
$replacements = array('', '');
foreach ($_templates as $template) {
if (preg_match('/^settings_/', $template, $m)) {
$_template = str_replace($needles, $replacements, $template);
// Get the provider name
$templates[$_template] = $relative_directory_path . $template;
}
}
}
return $templates;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:20,代码来源:addons.pre.php
示例12: getList
/**
* Gets list of styles
*
* @return array List of available styles
*/
public function getList($params = array())
{
$styles = array();
$style_files = array();
$path = $this->getStylesPath();
$style_files = fn_get_dir_contents($path, false, true, 'less');
/**
* Modifies styles list
*
* @param object $this Styles object
* @param array $style_files style files list
* @param array $params search params
*/
fn_set_hook('styles_get_list', $this, $style_files, $params);
if (!empty($style_files)) {
foreach ($style_files as $id => $style_id) {
$style_id = fn_basename($style_id, '.less');
$styles[$style_id] = $this->get($style_id, $params);
}
}
return $styles;
}
开发者ID:askzap,项目名称:ask-zap,代码行数:27,代码来源:Styles.php
示例13: fn_init_skin
/**
* Init skin
*
* @param array $params request parameters
* @return boolean always true
*/
function fn_init_skin($params)
{
if ((Registry::get('settings.skin_name_' . AREA_NAME) == '' || !is_dir(DIR_SKINS . Registry::get('settings.skin_name_' . AREA_NAME))) && !defined('SKINS_PANEL')) {
$all = fn_get_dir_contents(DIR_SKINS, true);
$skin_found = false;
foreach ($all as $sk) {
if (is_file(DIR_SKINS . $sk . '/' . AREA_NAME . '/index.tpl')) {
Registry::set('settings.skin_name' . AREA_NAME, basename($sk));
$skin_found = true;
break;
}
}
if ($skin_found == false) {
die("No skins found");
} else {
echo <<<EOT
\t\t\t\t<div style="background: #ff0000; color: #ffffff; font-weight: bold;" align="center">SELECTED SKIN NOT FOUND. REPLACED BY FIRST FOUND</div>
EOT;
}
}
if (defined('DEVELOPMENT')) {
foreach (Registry::get('config.dev_skins') as $k => $v) {
Registry::set('settings.skin_name_' . $k, $v);
}
}
// Allow user to change the skin during the current session
if (defined('SKINS_PANEL')) {
$demo_skin = fn_get_cookie('demo_skin');
if (!empty($params['demo_skin'][AREA])) {
$tmp_skin = basename($params['demo_skin'][AREA]);
if (is_dir(DIR_SKINS . $tmp_skin)) {
Registry::set('settings.skin_name_' . AREA_NAME, $tmp_skin);
$demo_skin[AREA] = $tmp_skin;
} else {
Registry::set('settings.skin_name_' . AREA_NAME, $demo_skin[AREA]);
}
} elseif (empty($demo_skin[AREA])) {
$demo_skin[AREA] = 'basic';
}
Registry::set('settings.skin_name_' . AREA_NAME, $demo_skin[AREA]);
fn_set_cookie('demo_skin', $demo_skin);
Registry::set('demo_skin', array('selected' => $demo_skin, 'available_skins' => fn_get_available_skins(AREA_NAME)));
}
$skin_name = Registry::get('settings.skin_name_' . AREA_NAME);
Registry::set('config.skin_name', $skin_name);
Registry::set('config.skin_path', Registry::get('config.current_path') . '/skins/' . $skin_name . '/' . AREA_NAME);
Registry::set('config.no_image_path', Registry::get('config.images_path') . 'no_image.gif');
return true;
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:55,代码来源:fn.init.php
示例14: fn_copy_by_ftp
/**
* Copies files using FTP access
*
* @param string $source Absolute path (non-ftp) to source dir/file
* @param string $destination Absolute path (non-ftp) to destination dir/file
* @param array $ftp_access
* array(
* 'hostname',
* 'username',
* 'password',
* 'directory'
* )
* @return bool true if all files were copied or (string) Error message
*/
function fn_copy_by_ftp($source, $destination, $ftp_access)
{
try {
$ftp = new Ftp();
$ftp->connect($ftp_access['hostname']);
$ftp->login($ftp_access['username'], $ftp_access['password']);
$ftp->chdir($ftp_access['directory']);
$files = $ftp->nlist('');
if (!empty($files) && in_array('config.php', $files)) {
$ftp_destination = str_replace(Registry::get('config.dir.root'), '', $destination);
if (is_file($source)) {
// File
try {
$file = ltrim($ftp_destination, '/');
$ftp->put($file, $source, FTP_BINARY);
} catch (FtpException $e) {
throw new FtpException('ftp_access_denied' . ':' . $e->getMessage());
}
} else {
// Dir
$ftp->chdir($ftp_access['directory'] . $ftp_destination);
$struct = fn_get_dir_contents($source, false, true, '', '', true);
foreach ($struct as $file) {
$dir = dirname($file);
if (!$ftp->isDir($dir)) {
try {
$ftp->mkDirRecursive($dir);
} catch (FtpException $e) {
throw new FtpException('ftp_access_denied' . ':' . $e->getMessage());
}
}
try {
$ftp->put($file, $source . $file, FTP_BINARY);
} catch (FtpException $e) {
throw new FtpException('ftp_access_denied' . ':' . $e->getMessage());
}
}
}
return true;
} else {
throw new FtpException('ftp_directory_is_incorrect');
}
} catch (FtpException $e) {
return __('invalid_ftp_access') . ': ' . $e->getMessage();
}
return false;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:61,代码来源:fn.fs.php
示例15: fn_get_file
}
if ($mode == 'getfile' && !empty($_REQUEST['file'])) {
fn_get_file(Registry::get('config.dir.backups') . fn_basename($_REQUEST['file']));
} elseif ($mode == 'manage') {
$view = Tygh::$app['view'];
// Calculate database size and fill tables array
$status_data = db_get_array("SHOW TABLE STATUS");
$database_size = 0;
$all_tables = array();
foreach ($status_data as $k => $v) {
$database_size += $v['Data_length'] + $v['Index_length'];
$all_tables[] = $v['Name'];
}
$view->assign('database_size', $database_size);
$view->assign('all_tables', $all_tables);
$files = fn_get_dir_contents(Registry::get('config.dir.backups'), false, true, array('.sql', '.tgz', '.zip'), '', true);
sort($files, SORT_STRING);
$backup_files = array();
$date_format = Registry::get('settings.Appearance.date_format') . ' ' . Registry::get('settings.Appearance.time_format');
if (is_array($files)) {
$backup_dir = Registry::get('config.dir.backups');
foreach ($files as $file) {
$ext = fn_get_file_ext($backup_dir . $file);
$backup_files[$file]['size'] = filesize($backup_dir . $file);
$backup_files[$file]['create'] = fn_date_format(filemtime($backup_dir . $file), $date_format);
if ($ext == 'sql') {
$backup_files[$file]['type'] = 'database';
} else {
$backup_files[$file]['type'] = DataKeeper::getArchiveType($backup_dir . $file);
}
}
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:datakeeper.php
示例16: fn_generate_file_name
/**
* Create a new filename with postfix
*
* @param string $path
* @param string $file
* @return array ($full_path, $new_filename)
*/
function fn_generate_file_name($path, $file)
{
if (!file_exists($path . $file)) {
return array($path . $file, $file);
}
$files = fn_get_dir_contents($path, false, true);
$num = 1;
$found = false;
$file_ext = fn_get_file_ext($file);
$file_name = basename($path . $file, '.' . $file_ext);
while (!$found) {
$new_filename = $file_name . '_' . $num . '.' . $file_ext;
if (!in_array($new_filename, $files)) {
break;
}
$num++;
}
return array($path . $new_filename, $new_filename);
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:26,代码来源:fn.fs.php
示例17: fn_get_default_layouts_sources
function fn_get_default_layouts_sources($theme_name = '', $themes_path = '')
{
$layouts_sources = array();
if (empty($themes_path)) {
$themes_path = fn_get_theme_path('[themes]', 'C');
}
if (empty($theme_name)) {
$installed_themes = fn_get_dir_contents($themes_path, true);
foreach ($installed_themes as $theme_name) {
$layouts_sources = array_merge($layouts_sources, fn_get_default_layouts_sources($theme_name, $themes_path));
}
} else {
$layouts_path = $themes_path . '/' . $theme_name . '/layouts/';
$layouts = fn_get_dir_contents($layouts_path, false, true, '.xml');
foreach ($layouts as $layout_name) {
$layout_path = fn_normalize_path($layouts_path . $layout_name);
if (file_exists($layout_path)) {
$layout_data = Exim::instance(Registry::get('runtime.company_id'), 0, $theme_name)->getLayoutData($layout_path, false);
if (!empty($layout_data)) {
$layout_data['theme_name'] = $theme_name;
$layout_data['filename'] = $layout_name;
$layouts_sources[] = $layout_data;
}
}
}
}
return $layouts_sources;
}
开发者ID:askzap,项目名称:ultimate,代码行数:28,代码来源:block_manager.php
示例18: db_query
$new_status = $_REQUEST['status'];
if ($old_status != $new_status) {
$func = 'fn_settings_actions_addons_' . $_REQUEST['id'];
if (function_exists($func)) {
$func($new_status, $old_status);
}
if ($old_status != $new_status) {
db_query("UPDATE ?:addons SET status = ?s WHERE addon = ?s", $_REQUEST['status'], $_REQUEST['id']);
fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('status_changed'));
} else {
$ajax->assign('return_status', $old_status);
}
}
exit;
} elseif ($mode == 'manage') {
$all_addons = fn_get_dir_contents(DIR_ADDONS, true, false);
$installed_addons = db_get_hash_array("SELECT a.addon, a.status, d.description as name, b.description, LENGTH(a.options) as has_options, d.object_id, d.object_type FROM ?:addons as a LEFT JOIN ?:addon_descriptions as d ON d.addon = a.addon AND d.object_id = '' AND d.object_type = 'A' AND d.lang_code = ?s LEFT JOIN ?:addon_descriptions as b ON b.addon = a.addon AND b.object_id = '' AND b.object_type = 'D' AND b.lang_code = ?s ORDER BY d.description ASC", 'addon', CART_LANGUAGE, CART_LANGUAGE);
fn_update_lang_objects('installed_addons', $installed_addons);
$addons_list = array();
foreach ($all_addons as $addon) {
if (!empty($installed_addons[$addon])) {
$addons_list[$addon] = $installed_addons[$addon];
} else {
if (file_exists(DIR_ADDONS . $addon . '/addon.xml')) {
$xml = simplexml_load_file(DIR_ADDONS . $addon . '/addon.xml');
$addons_list[$addon] = array('status' => 'N', 'name' => (string) $xml->name);
}
}
}
$view->assign('addons_list', fn_sort_array_by_key($addons_list, 'name', SORT_ASC));
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:addons.php
示例19: fn_get_gift_certificate_templates
function fn_get_gift_certificate_templates()
{
$templates = array();
$dir = fn_get_theme_path('[themes]/[theme]/mail/templates', 'C') . '/addons/gift_certificates/templates';
$files = fn_get_dir_contents($dir, false, true, 'tpl');
foreach ($files as $file) {
$path_parts = explode(".", $file);
$file_name = __($path_parts[0]);
$templates[$file] = !empty($file_name) ? $file_name : ucfirst($path_parts[0]);
}
return $templates;
}
开发者ID:arpad9,项目名称:bygmarket,代码行数:12,代码来源:func.php
示例20: getLangPacksMeta
/**
* Gets meta information from the PO file
*
* @param string $base_path Root dir
* @param string $pack_file PO file name (without .po extension)
* @param bool $reinstall Use this flag, if pack was alread installed before to get META information
* @return array List of lang pack meta information
*/
public static function getLangPacksMeta($base_path = '', $pack_file = '', $reinstall = false, $check_installed = true)
{
$installed_languages = $check_installed ? self::getAll(true) : array();
$path = empty($base_path) ? Registry::get('config.dir.lang_packs') : $base_path;
$return = array();
if (empty($pack_file)) {
$po_file_list = array();
foreach (fn_get_dir_contents($path, true, false) as $pack_directory) {
if (is_dir($path . $pack_directory)) {
$po_file_list[] = $pack_directory . '/core.po';
}
}
} else {
$po_file_list = array($pack_file);
}
foreach ($po_file_list as $po_file_name) {
$po_file_path = $path . $po_file_name;
if (!file_exists($po_file_path)) {
fn_set_notification('E', __('error'), __('incorrect_po_pack_structure', array('[pack_path]' => fn_get_rel_dir(dirname($po_file_path)))));
continue;
}
$metadata = Po::getMeta($po_file_path);
if (is_array($metadata)) {
if (!self::isValidMeta($metadata)) {
fn_set_notification('E', __('error'), __('po_file_is_incorrect', array('[file]' => fn_get_rel_dir($po_file_path))));
continue;
}
} else {
fn_set_notification('E', __('error'), $metadata);
continue;
}
if (isset($installed_languages[$metadata['lang_code']]) && !$reinstall) {
continue;
}
$return[] = $metadata;
}
if (!empty($pack_file) && !empty($return)) {
return reset($return);
}
return $return;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:49,代码来源:Languages.php
注:本文中的fn_get_dir_contents函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论