本文整理汇总了PHP中fn_get_files_dir_path函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_files_dir_path函数的具体用法?PHP fn_get_files_dir_path怎么用?PHP fn_get_files_dir_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_get_files_dir_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDirCommerceML
public static function getDirCommerceML()
{
self::$path_commerceml = fn_get_files_dir_path() . 'exim/1C_' . date('dmY') . '/';
self::$url_commerceml = Registry::get('config.http_location') . '/' . fn_get_rel_dir(self::$path_commerceml);
self::$url_images = Storage::instance('images')->getAbsolutePath('from_1c/');
return array(self::$path_commerceml, self::$url_commerceml, self::$url_images);
}
示例2: getFileName
public function getFileName()
{
$parts = explode('\\', get_class($this));
$type = array_pop($parts);
$type = strtolower($type);
return fn_get_files_dir_path() . 'price_list/price_list_' . CART_LANGUAGE . '.' . $this->price_schema['types'][$type]['extension'];
}
示例3: fn_rus_dellin_uninstall
function fn_rus_dellin_uninstall()
{
$service_ids = db_get_fields('SELECT service_id FROM ?:shipping_services WHERE module = ?s', 'dellin');
if (!empty($service_ids)) {
db_query('DELETE FROM ?:shipping_services WHERE service_id IN (?a)', $service_ids);
db_query('DELETE FROM ?:shipping_service_descriptions WHERE service_id IN (?a)', $service_ids);
}
db_query('DROP TABLE IF EXISTS ?:rus_dellin_cities');
$file_dir = fn_get_files_dir_path() . "dellin/";
fn_rm($file_dir);
}
示例4: __construct
public function __construct($format = 'csv', $price_id = 0)
{
$this->format = $format;
$this->price_id = $price_id;
$this->filename = 'log_tmp_' . $price_id . '.' . $this->format;
$this->path = fn_get_files_dir_path() . 'yml/logs/';
fn_mkdir($this->path);
$file_is_new = !file_exists($this->path . $this->filename);
$this->file = fopen($this->path . $this->filename, 'ab');
if ($file_is_new && $this->format == 'csv') {
fwrite($this->file, 'Type; Object ID; Message;' . PHP_EOL);
}
}
示例5: fn_google_export_add_feed
function fn_google_export_add_feed()
{
$fields = array(array('position' => 0, 'export_field_name' => 'id', 'field' => 'Product id', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'title', 'field' => 'Product name', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'link', 'field' => 'Product URL', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'description', 'field' => 'Google description', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'condition', 'field' => 'Condition', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'price', 'field' => 'Price', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'availability', 'field' => 'Availability', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'image_link', 'field' => 'Image URL', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'gtin', 'field' => 'GTIN', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'brand', 'field' => 'Brand', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'mpn', 'field' => 'MPN', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'google_product_category', 'field' => 'Google product category (US)', 'avail' => 'Y'), array('position' => 0, 'export_field_name' => 'product_type', 'field' => 'Category', 'avail' => 'Y'));
$export_options = array('lang_code' => array(DEFAULT_LANGUAGE), 'category_delimiter' => ' > ', 'features_delimiter' => '///', 'price_dec_sign_delimiter' => '.');
$data = array('categories' => '', 'products' => '', 'fields' => serialize($fields), 'export_location' => '', 'export_by_cron' => 'N', 'ftp_url' => '', 'ftp_user' => '', 'ftp_pass' => '', 'file_name' => 'google_base.csv', 'enclosure' => '', 'csv_delimiter' => 'T', 'exclude_disabled_products' => 'N', 'export_options' => serialize($export_options), 'save_dir' => fn_get_files_dir_path(), 'status' => 'A');
$data_feed_id = db_query("INSERT INTO ?:data_feeds ?e", $data);
foreach (fn_get_translation_languages() as $language) {
db_query("INSERT INTO ?:data_feed_descriptions (datafeed_id, datafeed_name, lang_code) VALUES (?i, 'Google base', ?s);", $data_feed_id, $language['lang_code']);
}
}
示例6: fn_find_file
/**
* Finds file and return real path to it
*
* @param string $prefix path to search in
* @param string $file Filename, can be URL, absolute or relative path
* @return mixed String path to the file or false if file is not found.
*/
function fn_find_file($prefix, $file)
{
$file = Bootstrap::stripSlashes($file);
// Url
if (strpos($file, '://') !== false) {
return $file;
}
$prefix = fn_normalize_path(rtrim($prefix, '/'));
$file = fn_normalize_path($file);
$files_path = fn_get_files_dir_path();
// Absolute path
if (is_file($file) && strpos($file, $files_path) === 0) {
return $file;
}
// Path is relative to files directory
if (is_file($files_path . $file)) {
return $files_path . $file;
}
// Path is relative to prefix inside files directory
if (is_file($files_path . $prefix . '/' . $file)) {
return $files_path . $prefix . '/' . $file;
}
// Prefix is absolute path
if (strpos($prefix, $files_path) === 0 && is_file($prefix . '/' . $file)) {
return $prefix . '/' . $file;
}
return false;
}
示例7: fn_data_feeds_export
function fn_data_feeds_export($datafeed_id, $options = array(), $pattern = '')
{
static $pattern;
if (empty($pattern)) {
$pattern = fn_get_pattern_definition('products');
}
$params['datafeed_id'] = $datafeed_id;
$params['single'] = true;
$params['available_fields'] = 'Y';
$params = array_merge($params, $options);
$datafeed_data = fn_data_feeds_get_data($params, DESCR_SL);
if (empty($pattern) || empty($params['datafeed_id'])) {
fn_set_notification('E', __('error'), __('error_exim_no_data_exported'));
return false;
}
if ($datafeed_data['exclude_disabled_products'] == 'Y') {
$params['status'] = 'A';
}
if (empty($datafeed_data['products']) && empty($datafeed_data['categories'])) {
$params['cid'] = 0;
$params['subcats'] = 'Y';
$params['skip_view'] = 'Y';
$params['extend'] = array('categories');
list($products, $search) = fn_get_products($params);
$pids = array_map(create_function('$product', '$pid = $product["product_id"]; return $pid;'), $products);
} else {
$pids = array();
if (!empty($datafeed_data['products'])) {
$pids = explode(',', $datafeed_data['products']);
}
if (!empty($datafeed_data['categories'])) {
$params['cid'] = explode(',', $datafeed_data['categories']);
$params['subcats'] = 'Y';
$params['skip_view'] = 'Y';
$params['extend'] = array('categories');
list($products, $search) = fn_get_products($params);
$_pids = array_map(create_function('$product', '$pid = $product["product_id"]; return $pid;'), $products);
$pids = array_merge($pids, $_pids);
unset($_pids);
}
$pids = array_unique($pids);
}
if (empty($pids)) {
fn_set_notification('E', __('error'), __('error_exim_no_data_exported'));
return false;
}
$pattern['condition']['conditions']['product_id'] = $pids;
$fields = array();
if (!empty($datafeed_data['fields'])) {
foreach ($datafeed_data['fields'] as $field) {
$fields[$field['field']] = $field['export_field_name'];
}
}
$features = db_get_array('SELECT feature_id, description FROM ?:product_features_descriptions WHERE lang_code = ?s', DESCR_SL);
$features_fields = array();
if (!empty($features)) {
foreach ($features as $feature) {
$features_fields[$feature['description']] = array('process_get' => array('fn_data_feeds_get_product_features', '#key', '#field', '#lang_code'), 'linked' => false);
}
}
$pattern['export_fields'] = array_merge($pattern['export_fields'], $features_fields);
$options = $datafeed_data['export_options'];
$options['delimiter'] = $datafeed_data['csv_delimiter'];
$options['filename'] = $datafeed_data['file_name'];
$options['fields_names'] = true;
$options['force_header'] = true;
$pattern['enclosure'] = !empty($datafeed_data['enclosure']) ? $datafeed_data['enclosure'] : '';
if (!empty($fields)) {
if (fn_export($pattern, $fields, $options) == true) {
$errors = false;
$export_location = empty($params['location']) ? $datafeed_data['export_location'] : $params['location'];
if ($export_location == 'S') {
if (file_exists(fn_get_files_dir_path() . $datafeed_data['file_name']) && is_dir($datafeed_data['save_dir'])) {
fn_rename(fn_get_files_dir_path() . $datafeed_data['file_name'], $datafeed_data['save_dir'] . '/' . $datafeed_data['file_name']);
} else {
$errors = true;
fn_set_notification('E', __('error'), __('check_server_export_settings'));
}
} elseif ($export_location == 'F') {
if (empty($datafeed_data['ftp_url'])) {
$errors = true;
fn_set_notification('E', __('error'), __('ftp_connection_problem'));
} else {
preg_match("/[^\\/^\\^:]+/", $datafeed_data['ftp_url'], $matches);
$host = $matches[0];
preg_match("/.*:([0-9]+)/", $datafeed_data['ftp_url'], $matches);
$port = empty($matches[1]) ? 21 : $matches[1];
preg_match("/[^\\/]+(.*)/", $datafeed_data['ftp_url'], $matches);
$url = empty($matches[1]) ? '' : $matches[1];
$conn_id = @ftp_connect($host, $port);
$result = @ftp_login($conn_id, $datafeed_data['ftp_user'], $datafeed_data['ftp_pass']);
if (!empty($url)) {
@ftp_chdir($conn_id, $url);
}
$filename = fn_get_files_dir_path() . $datafeed_data['file_name'];
if ($result) {
if (@ftp_put($conn_id, $datafeed_data['file_name'], $filename, FTP_ASCII)) {
unlink($filename);
} else {
$errors = true;
//.........这里部分代码省略.........
示例8: elseif
$c->SetGridColour($verification_settings['grid_color']);
if ($verification_settings['char_shadow'] == 'Y') {
$c->DisplayShadow(true);
}
if ($verification_settings['colour'] == 'Y') {
$c->UseColour(true);
}
if ($verification_settings['string_type'] == 'digits') {
$c->SetCharSet(array(2, 3, 4, 5, 6, 8, 9));
} elseif ($verification_settings['string_type'] == 'letters') {
$c->SetCharSet(range('A', 'F'));
} else {
$c->SetCharSet(fn_array_merge(range('A', 'F'), array(2, 3, 4, 5, 6, 8, 9), false));
}
if (!empty($verification_settings['background_image'])) {
$c->SetBackgroundImages(fn_get_files_dir_path() . $verification_settings['background_image']);
}
$c->Create();
exit;
} elseif ($mode == 'custom_image') {
if (empty($_REQUEST['image'])) {
exit;
}
$type = empty($_REQUEST['type']) ? 'T' : $_REQUEST['type'];
$image_path = 'sess_data/' . fn_basename($_REQUEST['image']);
if (Storage::instance('custom_files')->isExist($image_path)) {
$real_path = Storage::instance('custom_files')->getAbsolutePath($image_path);
list(, , $image_type, $tmp_path) = fn_get_image_size($real_path);
if ($type == 'T') {
$thumb_path = $image_path . '_thumb';
if (!Storage::instance('custom_files')->isExist($thumb_path)) {
示例9: fn_sdek_get_ticket_order
function fn_sdek_get_ticket_order($data_auth, $order_id, $chek_id)
{
unset($data_auth['Number']);
$xml = ' ' . RusSdek::arraySimpleXml('OrdersPrint', $data_auth, 'open');
$order_sdek = array('Number' => $order_id . '_' . $chek_id, 'Date' => $data_auth['Date']);
$xml .= ' ' . RusSdek::arraySimpleXml('Order', $order_sdek);
$xml .= ' ' . '</OrdersPrint>';
$response = RusSdek::xmlRequest('http://gw.edostavka.ru:11443/orders_print.php', $xml, $data_auth);
$download_file_dir = fn_get_files_dir_path() . '/sdek' . '/' . $chek_id . '/';
fn_rm($download_file_dir);
fn_mkdir($download_file_dir);
$name = $order_id . '.pdf';
$download_file_path = $download_file_dir . $name;
if (!fn_is_empty($response)) {
fn_put_contents($download_file_path, $response);
}
}
示例10: die
<?php
/***************************************************************************
* *
* (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev *
* *
* This is commercial software, only users who have purchased a valid *
* license and accept to the terms of the License Agreement can install *
* and use this program. *
* *
****************************************************************************
* PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *
****************************************************************************/
if (!defined('BOOTSTRAP')) {
die('Access denied');
}
if ($mode == 'view') {
if (!empty($_REQUEST['page'])) {
$page = intval($_REQUEST['page']);
$filename = fn_get_files_dir_path() . 'google_sitemap/sitemap' . $page . '.xml';
} else {
$page = 0;
$filename = fn_get_files_dir_path() . 'google_sitemap/sitemap.xml';
}
if (file_exists($filename)) {
header("Content-Type: text/xml;charset=utf-8");
readfile($filename);
exit;
}
}
示例11: writeLog
public static function writeLog($data, $file = 'sberbank.log')
{
$path = fn_get_files_dir_path();
fn_mkdir($path);
$file = fopen($path . $file, 'a');
if (!empty($file)) {
fputs($file, 'TIME: ' . date('Y-m-d H:i:s', TIME) . "\n");
fputs($file, fn_array2code_string($data) . "\n\n");
fclose($file);
}
}
示例12: fn_get_schema
Registry::get('view')->assign('datafeed_langs', $datafeed_langs);
$pattern = fn_get_schema('exim', 'products');
Registry::get('view')->assign('pattern', $pattern);
if (empty($datafeed_data['datafeed_id'])) {
return array(CONTROLLER_STATUS_NO_PAGE);
}
Registry::get('view')->assign('export_fields', $pattern['export_fields']);
Registry::get('view')->assign('feature_fields', fn_data_feeds_get_features_fields());
// [Page sections]
Registry::set('navigation.tabs', array('detailed' => array('title' => __('general'), 'js' => true), 'exported_items' => array('title' => __('exported_items'), 'js' => true), 'fields' => array('title' => __('map_fields'), 'js' => true)));
// [/Page sections]
} elseif ($mode == 'download') {
$params['datafeed_id'] = $_REQUEST['datafeed_id'];
$params['single'] = true;
$datafeed_data = fn_data_feeds_get_data($params, DESCR_SL);
$filename = fn_get_files_dir_path() . $datafeed_data['file_name'];
if (file_exists($filename)) {
fn_get_file($filename);
}
exit;
}
function fn_data_feeds_update_feed($feed_data, $feed_id = 0, $lang_code = CART_LANGUAGE)
{
if (!empty($feed_data['fields'])) {
$_fields = array();
foreach ($feed_data['fields'] as $key => $field) {
if (empty($field['export_field_name'])) {
unset($feed_data['fields'][$key]);
} else {
$_fields[intval($field['position'])][] = $field;
}
示例13: fn_exim_import_file
function fn_exim_import_file($product_id, $filename, $path, $delete_files = 'N')
{
$path = fn_get_files_dir_path() . fn_normalize_path($path);
// Clean up the directory above if flag is set
if ($delete_files == 'Y') {
fn_delete_product_file_folders(0, $product_id);
fn_delete_product_files(0, $product_id);
}
// Check if we have several files
$files = fn_explode(',', $filename);
$folders = array();
// Create folders
foreach ($files as $file) {
if (strpos($file, '/') !== false) {
list($folder) = fn_explode('/', $file);
if (!isset($folders[$folder])) {
$folder_data = array('product_id' => $product_id, 'folder_name' => $folder);
$folders[$folder] = fn_update_product_file_folder($folder_data, 0);
}
}
}
// Copy files
foreach ($files as $file) {
if (strpos($file, '/') !== false) {
list($folder_name, $file) = fn_explode('/', $file);
} else {
$folder_name = '';
}
if (strpos($file, '#') !== false) {
list($f, $pr) = fn_explode('#', $file);
} else {
$f = $file;
$pr = '';
}
$file = fn_find_file($path, $f);
if (!empty($file)) {
$uploads = array('file_base_file' => array($file), 'type_base_file' => array('server'));
if (!empty($pr)) {
$preview = fn_find_file($path, $pr);
if (!empty($preview)) {
$uploads['file_file_preview'] = array($preview);
$uploads['type_file_preview'] = array('server');
}
} else {
$uploads['file_file_preview'] = "";
$uploads['type_file_preview'] = "";
}
$_REQUEST = fn_array_merge($_REQUEST, $uploads);
// not good to add data to $_REQUEST
$file_data = array('product_id' => $product_id);
if (!empty($folder_name)) {
$file_data['folder_id'] = $folders[$folder_name];
}
if (fn_update_product_file($file_data, 0) == false) {
return false;
}
}
}
return true;
}
示例14: fn_te_get_root
/**
* Gets section root
* @param string $type path type: full - full path, rel - relative path from root directory, repo - repository path
* @return string path
*/
function fn_te_get_root($type, $section = 'themes')
{
if ($section == 'themes') {
if (fn_allowed_for('MULTIVENDOR') || Registry::get('runtime.company_id')) {
$extra_path = '[theme]/';
} else {
$extra_path = '';
}
if ($type == 'full') {
$path = fn_get_theme_path('[themes]/' . $extra_path, 'C');
} elseif ($type == 'rel') {
$path = fn_get_theme_path('/[relative]/' . $extra_path, 'C');
} elseif ($type == 'repo') {
$path = fn_get_theme_path('[repo]/' . $extra_path, 'C');
}
} elseif ($section == 'files') {
if ($type == 'full') {
$path = fn_get_files_dir_path();
if (!is_dir($path)) {
fn_mkdir($path);
}
} elseif ($type == 'rel') {
$path = '/' . fn_get_rel_dir(fn_get_files_dir_path());
}
} elseif ($section == 'images') {
if ($type == 'full') {
$path = Storage::instance('images')->getAbsolutePath('');
} elseif ($type == 'rel') {
$path = '/' . fn_get_rel_dir(Storage::instance('images')->getAbsolutePath(''));
}
}
fn_set_hook('te_get_root', $type, $section, $path);
return $path;
}
示例15: fn_mailru_write_yml
function fn_mailru_write_yml($filename, $mode, &$yml)
{
$path = fn_get_files_dir_path();
if (!is_dir($path)) {
fn_mkdir($path);
}
$fd = fopen($path . $filename, $mode);
if ($fd) {
if (!is_array($yml)) {
if (Registry::get('addons.rus_tovary_mailru.export_encoding') == 'windows-1251') {
$yml = fn_convert_encoding('UTF-8', 'windows-1251', $yml, 'S');
}
fwrite($fd, $yml);
} else {
foreach ($yml as $key => $content) {
$content = $content . "\n";
if (Registry::get('addons.rus_tovary_mailru.export_encoding') == 'windows-1251') {
$content = fn_convert_encoding('UTF-8', 'windows-1251', $content, 'S');
}
fwrite($fd, $content);
unset($yml[$key]);
}
}
fclose($fd);
@chmod($path . $filename, DEFAULT_FILE_PERMISSIONS);
}
}