• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP userfiles_path函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: templates_path

function templates_path()
{
    static $folder;
    if (!$folder) {
        $folder = userfiles_path() . MW_TEMPLATES_FOLDER_NAME . DIRECTORY_SEPARATOR;
    }
    return $folder;
}
开发者ID:microweber,项目名称:microweber,代码行数:8,代码来源:paths.php


示例2: run

 public function run()
 {
     $removed = 0;
     $value = mw()->cache_manager->get('create_batch', $this->cache_group);
     if (isset($value['total']) and $value['total'] > 0) {
         if (isset($value['remaining']) and $value['remaining'] > 0) {
             $batch = mw()->media_manager->get_all('limit=30000');
             if ($batch) {
                 foreach ($batch as $k => $v) {
                     if (isset($v['id']) and isset($v['filename']) and $v['filename'] != false) {
                         $process = false;
                         if (stristr($v['filename'], '{SITE_URL}')) {
                             $process = true;
                         } else {
                             if (stristr($v['filename'], site_url())) {
                                 $process = true;
                             }
                         }
                         if ($process) {
                             $v['filename'] = str_ireplace('{SITE_URL}', '', $v['filename']);
                             $v['filename'] = str_ireplace(site_url(), '', $v['filename']);
                             $is_file = false;
                             $file1 = normalize_path(public_path() . DS . $v['filename'], false);
                             $file2 = normalize_path(base_path() . DS . $v['filename'], false);
                             $file3 = normalize_path(media_base_path() . DS . $v['filename'], false);
                             $file4 = normalize_path(userfiles_path() . DS . $v['filename'], false);
                             if (is_file($file1)) {
                                 $is_file = true;
                             } elseif (is_file($file2)) {
                                 $is_file = true;
                             } elseif (is_file($file3)) {
                                 $is_file = true;
                             } elseif (is_file($file4)) {
                                 $is_file = true;
                             }
                             if ($is_file == false) {
                                 mw()->media_manager->delete($v['id']);
                                 $removed++;
                             }
                         }
                     }
                 }
             }
         }
     }
     mw()->cache_manager->delete($this->cache_group);
     $resp = array('success' => "Removed " . $removed . ' items');
     return $resp;
 }
开发者ID:hyrmedia,项目名称:microweber,代码行数:49,代码来源:Worker.php


示例3: export_to_excel

 public function export_to_excel($params)
 {
     //this function is experimental
     set_time_limit(0);
     $adm = $this->app->user_manager->is_admin();
     if ($adm == false) {
         return array('error' => 'Error: not logged in as admin.' . __FILE__ . __LINE__);
     }
     if (!isset($params['id'])) {
         return array('error' => 'Please specify list id! By posting field id=the list id ');
     } else {
         $lid = intval($params['id']);
         $data = get_form_entires('limit=100000&list_id=' . $lid);
         $surl = $this->app->url_manager->site();
         $csv_output = '';
         if (is_array($data)) {
             $csv_output = 'id,';
             $csv_output .= 'created_at,';
             $csv_output .= 'user_ip,';
             foreach ($data as $item) {
                 if (isset($item['custom_fields'])) {
                     foreach ($item['custom_fields'] as $k => $v) {
                         $csv_output .= $this->app->format->no_dashes($k) . ",";
                         $csv_output .= "\t";
                     }
                 }
             }
             $csv_output .= "\n";
             foreach ($data as $item) {
                 if (isset($item['custom_fields'])) {
                     $csv_output .= $item['id'] . ",";
                     $csv_output .= "\t";
                     $csv_output .= $item['created_at'] . ",";
                     $csv_output .= "\t";
                     $csv_output .= $item['user_ip'] . ",";
                     $csv_output .= "\t";
                     foreach ($item['custom_fields'] as $item1 => $val) {
                         $output_val = $val;
                         $output_val = str_replace('{SITE_URL}', $surl, $output_val);
                         $csv_output .= $output_val . ",";
                         $csv_output .= "\t";
                     }
                     $csv_output .= "\n";
                 }
             }
         }
         $filename = 'export' . "_" . date("Y-m-d_H-i", time()) . uniqid() . '.csv';
         $filename_path = userfiles_path() . 'export' . DS . 'forms' . DS;
         $filename_path_index = userfiles_path() . 'export' . DS . 'forms' . DS . 'index.php';
         if (!is_dir($filename_path)) {
             mkdir_recursive($filename_path);
             if (!is_file($filename_path_index)) {
                 @touch($filename_path_index);
             }
         }
         $filename_path_full = $filename_path . $filename;
         file_put_contents($filename_path_full, $csv_output);
         $download = $this->app->url_manager->link_to_file($filename_path_full);
         return array('success' => 'Your file has been exported!', 'download' => $download);
     }
 }
开发者ID:biggtfish,项目名称:microweber,代码行数:61,代码来源:FormsManager.php


示例4: only_admin_access

only_admin_access();
/**
 * Simple file browser
 *
 * Gets all files from dir and output them in a template
 *
 * @package		modules
 * @subpackage	files
 * @category	modules
 */
// Explore the files via a web interface.
$script = $config['url'];
// the name of this script
$path = media_base_path();
// the path the script should access
$path_restirct = userfiles_path();
// the path the script should access
if (isset($params['path']) and trim($params['path']) != '' and trim($params['path']) != 'false') {
    $path = $params['path'];
    // the path the script should access
}
$path = str_replace('./', '', $path);
$path = str_replace('..', '', $path);
$path = urldecode($path);
$path = str_replace($path_restirct, '', $path);
//$data = rglob($path);
$params_get_files = array();
$params_get_files['directory'] = $path_restirct . $path;
if (isset($params['search'])) {
    $params_get_files['search'] = $params['search'];
}
开发者ID:hyrmedia,项目名称:microweber,代码行数:31,代码来源:browser.php


示例5: media_base_path

$target_path = media_base_path() . DS;
$target_path = media_base_path() . DS . $host_dir . DS . 'uploaded' . DS;
$target_path = normalize_path($target_path, 0);
$path_restirct = userfiles_path();
// the path the script should access
if (isset($_REQUEST['path']) and trim($_REQUEST['path']) != '' and trim($_REQUEST['path']) != 'false') {
    $path = urldecode($_REQUEST['path']);
    $path = html_entity_decode($path);
    $path = htmlspecialchars_decode($path, ENT_NOQUOTES);
    //$path = urldecode($path);
    $path = str_replace('%2F', '/', $path);
    //$path = str_replace('%25252F','/',$path);
    $path = normalize_path($path, 0);
    $path = str_replace('..', '', $path);
    $path = str_replace($path_restirct, '', $path);
    $target_path = userfiles_path() . DS . $path;
    $target_path = normalize_path($target_path, 1);
}
$targetDir = $target_path;
if (!is_dir($targetDir)) {
    mkdir_recursive($targetDir);
}
//$targetDir = 'uploads';
$cleanupTargetDir = true;
// Remove old files
$maxFileAge = 5 * 3600;
// Temp file age in seconds
// 5 minutes execution time
@set_time_limit(5 * 60);
// Uncomment this one to fake upload time
// usleep(5000);
开发者ID:microweber,项目名称:microweber,代码行数:31,代码来源:plupload.php


示例6: delete_media_file

 public function delete_media_file($params)
 {
     only_admin_access();
     $target_path = media_base_path() . 'uploaded' . DS;
     $target_path = normalize_path($target_path, 0);
     $path_restirct = userfiles_path();
     $fn_remove_path = $_REQUEST["path"];
     $resp = array();
     if ($fn_remove_path != false and is_array($fn_remove_path)) {
         foreach ($fn_remove_path as $key => $value) {
             $fn_remove = $this->app->url_manager->to_path($value);
             if (isset($fn_remove) and trim($fn_remove) != '' and trim($fn_remove) != 'false') {
                 $path = urldecode($fn_remove);
                 $path = normalize_path($path, 0);
                 $path = str_replace('..', '', $path);
                 $path = str_replace($path_restirct, '', $path);
                 $target_path = userfiles_path() . DS . $path;
                 $target_path = normalize_path($target_path, false);
                 if (stristr($target_path, media_base_path())) {
                     if (is_dir($target_path)) {
                         mw('Microweber\\Utils\\Files')->rmdir($target_path, false);
                         $resp = array('success' => 'Directory ' . $target_path . ' is deleted');
                     } else {
                         if (is_file($target_path)) {
                             unlink($target_path);
                             $resp = array('success' => 'File ' . basename($target_path) . ' is deleted');
                         } else {
                             $resp = array('error' => 'Not valid file or folder ' . $target_path . ' ');
                         }
                     }
                 } else {
                     $resp = array('error' => 'Not allowed to delete on ' . $target_path . ' ');
                 }
             }
         }
     }
     return $resp;
 }
开发者ID:kamilmiesiac,项目名称:microweber,代码行数:38,代码来源:MediaManager.php


示例7: _e

         $is_pdo_loaded = false;
     }
 }
 if ($is_pdo_loaded == false) {
     $check_pass = false;
     $server_check_errors['pdo'] = "The PDO MYSQL PHP extension must be loaded";
 }
 if (extension_loaded('gd') && function_exists('gd_info')) {
 } else {
     $check_pass = false;
     $server_check_errors['gd'] = _e("The GD extension must be loaded in PHP", true);
 }
 if (defined('userfiles_path()') and is_dir(userfiles_path()) and !is_writable(userfiles_path())) {
     $check_pass = false;
     $must_be = userfiles_path();
     $server_check_errors['userfiles_path()'] = _e("The directory " . userfiles_path() . " must be writable", true);
 }
 if (defined('MW_CACHE_ROOT_DIR') and is_dir(MW_CACHE_ROOT_DIR) and !is_writable(MW_CACHE_ROOT_DIR)) {
     $check_pass = false;
     $must_be = MW_CACHE_ROOT_DIR;
     $server_check_errors['MW_CACHE_ROOT_DIR'] = _e("The directory " . MW_CACHE_ROOT_DIR . " must be writable", true);
 }
 if (defined('MW_CACHE_ROOT_DIR') and is_dir(MW_CACHE_ROOT_DIR) and !is_writable(MW_CACHE_ROOT_DIR)) {
     $check_pass = false;
     $must_be = MW_CACHE_ROOT_DIR;
     $server_check_errors['MW_CACHE_ROOT_DIR'] = _e("The directory " . MW_CACHE_ROOT_DIR . " must be writable", true);
 }
 if (defined('media_base_path()') and is_dir(media_base_path()) and !is_writable(media_base_path())) {
     $check_pass = false;
     $must_be = media_base_path();
     $server_check_errors['media_base_path()'] = _e("The directory " . media_base_path() . " must be writable", true);
开发者ID:newaltcoin,项目名称:microweber,代码行数:31,代码来源:index.php


示例8: modules_url

    <td><?php 
print modules_url();
?>
</td>
  </tr>
  <tr>
    <td>modules_path</td>
    <td><?php 
print modules_path();
?>
</td>
  </tr>
  <tr>
    <td>userfiles_path</td>
    <td><?php 
print userfiles_path();
?>
</td>
  </tr>
  <tr>
    <td>userfiles_folder</td>
    <td><?php 
print modules_url();
?>
</td>
  </tr>
  <tr>
    <td>site_url</td>
    <td><?php 
print site_url();
?>
开发者ID:hyrmedia,项目名称:microweber,代码行数:31,代码来源:variables.php


示例9: modules_url

    <td><?php 
echo modules_url();
?>
</td>
  </tr>
  <tr>
    <td>modules_path</td>
    <td><?php 
echo modules_path();
?>
</td>
  </tr>
  <tr>
    <td>userfiles_path</td>
    <td><?php 
echo userfiles_path();
?>
</td>
  </tr>
  <tr>
    <td>userfiles_folder</td>
    <td><?php 
echo modules_url();
?>
</td>
  </tr>
  <tr>
    <td>site_url</td>
    <td><?php 
echo site_url();
?>
开发者ID:microweber,项目名称:microweber,代码行数:31,代码来源:variables.php


示例10: clear_cache

 public function clear_cache()
 {
     $userfiles_dir = userfiles_path();
     $userfiles_cache_dir = normalize_path($userfiles_dir . 'cache' . DS);
     if (is_dir($userfiles_cache_dir)) {
         if (function_exists('rmdir_recursive')) {
             rmdir_recursive($userfiles_cache_dir);
         }
     }
 }
开发者ID:kamilmiesiac,项目名称:microweber,代码行数:10,代码来源:Template.php


示例11: template_save_css

 function template_save_css($params)
 {
     $is_admin = $this->app->user_manager->is_admin();
     if ($is_admin == false) {
         return false;
     }
     if (is_string($params)) {
         $params = parse_params($params);
     }
     $ref_page = false;
     if (!isset($params['active_site_template'])) {
         if (!isset($params['content_id'])) {
             if (isset($_SERVER['HTTP_REFERER'])) {
                 $ref_page_url = $_SERVER['HTTP_REFERER'];
                 if ($ref_page_url != '') {
                     $ref_page_url_rel = str_ireplace(site_url(), '', $ref_page_url);
                     if ($ref_page_url_rel == '') {
                         $ref_page1 = $this->app->content_manager->homepage();
                     } else {
                         $ref_page1 = $this->app->content_manager->get_by_url($ref_page_url, true);
                     }
                     if (isset($ref_page1['id'])) {
                         $ref_page = $this->app->content_manager->get_by_id(intval($ref_page1['id']));
                     }
                 }
             }
         } else {
             $ref_page = $this->app->content_manager->get_by_id(intval($params['content_id']));
         }
         if (isset($ref_page['id']) and isset($ref_page['content_type']) and $ref_page['content_type'] != 'page') {
             $ref_page_parent = $this->app->content_manager->get_by_id(intval($ref_page['id']));
             if (isset($ref_page_partent['parent']) and intval($ref_page_partent['parent']) != 0) {
                 $ref_page = $this->app->content_manager->get_by_id(intval($ref_page_partent['id']));
             } else {
                 $ref_page_parents = $this->app->content_manager->get_parents(intval($ref_page['id']));
                 if (!empty($ref_page_parents)) {
                     $ref_page_parent = array_pop($ref_page_parents);
                     $ref_page = $this->app->content_manager->get_by_id($ref_page_parent);
                 }
             }
         }
     } else {
         $ref_page = $params;
     }
     if (!is_array($ref_page) or empty($ref_page)) {
         return false;
     }
     $pd = $ref_page;
     if ($is_admin == true and is_array($pd)) {
         $save_page = $pd;
         if (isset($save_page["layout_file"]) and $save_page["layout_file"] == 'inherit') {
             $inherit_from_id = $this->app->content_manager->get_inherited_parent($save_page["id"]);
             $inherit_from = $this->app->content_manager->get_by_id($inherit_from_id);
             if (is_array($inherit_from) and isset($inherit_from['active_site_template'])) {
                 $save_page['active_site_template'] = $inherit_from['active_site_template'];
                 $save_page['layout_file'] = $inherit_from['layout_file'];
             }
         }
         $template = false;
         if (!isset($save_page['active_site_template']) or $save_page['active_site_template'] == '') {
             $template = 'default';
         } else {
             if (isset($save_page['active_site_template'])) {
                 $template = $save_page['active_site_template'];
             }
         }
         if ($template == 'default') {
             $site_template_settings = $this->app->option_manager->get('current_template', 'template');
             if ($site_template_settings != false and $site_template_settings != 'default') {
                 $template = $site_template_settings;
             }
         }
         $final_file_blocks = array();
         if ($template != false) {
             if (isset($_POST['save_template_settings'])) {
                 $json = json_encode($_POST);
                 $option = array();
                 $option['option_value'] = $json;
                 $option['option_key'] = 'template_settings';
                 $option['option_group'] = 'template_' . $template;
                 save_option($option);
             }
             $template_folder = templates_path() . $template . DS;
             $template_url = templates_url() . $template . '/';
             $this_template_url = THIS_TEMPLATE_URL;
             $template_folder = userfiles_path() . 'css' . DS . $template . DS;
             if (!is_dir($template_folder)) {
                 mkdir_recursive($template_folder);
             }
             $live_edit_css = $template_folder . 'live_edit.css';
             $fcont = '';
             if (is_file($live_edit_css)) {
                 $fcont = file_get_contents($live_edit_css);
             }
             $css_cont = $fcont;
             $css_cont_new = $css_cont;
             //@import on top
             $sort_params = array();
             $sort_params2 = array();
             foreach ($params as $item) {
//.........这里部分代码省略.........
开发者ID:hyrmedia,项目名称:microweber,代码行数:101,代码来源:LayoutsManager.php


示例12: get_import_location

 function get_import_location()
 {
     if (defined('MW_CRON_EXEC')) {
     } else {
         if (!is_admin()) {
             return false;
         }
     }
     $loc = $this->imports_folder;
     if ($loc != false) {
         return $loc;
     }
     $folder_root = false;
     if (function_exists('userfiles_path')) {
         $folder_root = userfiles_path();
     } elseif (mw_cache_path()) {
         $folder_root = normalize_path(mw_cache_path());
     }
     $here = $folder_root . "import" . DS;
     if (!is_dir($here)) {
         mkdir_recursive($here);
         $hta = $here . '.htaccess';
         if (!is_file($hta)) {
             touch($hta);
             file_put_contents($hta, 'Deny from all');
         }
     }
     $here = $folder_root . "import" . DS . get_table_prefix() . DS;
     $here2 = $this->app->option_manager->get('import_location', 'admin/import');
     if ($here2 != false and is_string($here2) and trim($here2) != 'default' and trim($here2) != '') {
         $here2 = normalize_path($here2, true);
         if (!is_dir($here2)) {
             mkdir_recursive($here2);
         }
         if (is_dir($here2)) {
             $here = $here2;
         }
     }
     if (!is_dir($here)) {
         mkdir_recursive($here);
     }
     $loc = $here;
     $this->imports_folder = $loc;
     return $here;
 }
开发者ID:newaltcoin,项目名称:microweber,代码行数:45,代码来源:Import.php


示例13: install_log

 private function install_log($text)
 {
     $log_file = userfiles_path() . 'install_log.txt';
     if (!is_file($log_file)) {
         @touch($log_file);
     }
     if (is_file($log_file)) {
         $json = array('date' => date('H:i:s'), 'msg' => $text);
         if ($text == 'done' or $text == 'Preparing to install') {
             @file_put_contents($log_file, $text . "\n");
         } else {
             @file_put_contents($log_file, $text . "\n", FILE_APPEND);
         }
     }
 }
开发者ID:newaltcoin,项目名称:microweber,代码行数:15,代码来源:InstallController.php


示例14: thumbnails_path

 public function thumbnails_path()
 {
     $userfiles_dir = userfiles_path();
     $userfiles_cache_dir = normalize_path($userfiles_dir . 'cache' . DS . 'thumbnails' . DS);
     // media_base_path() . 'thumbnail' . DS;
     return $userfiles_cache_dir;
 }
开发者ID:microweber,项目名称:microweber,代码行数:7,代码来源:MediaManager.php


示例15: export_orders1

 public function export_orders1()
 {
     $data = get_orders('no_limit=true&order_completed=1');
     if (!$data) {
         return array('error' => 'You do not have any orders');
     }
     $csv_output = '';
     $head = reset($data);
     foreach ($head as $k => $v) {
         $csv_output .= $this->app->format->no_dashes($k) . ',';
         // $csv_output .= "\t";
     }
     $csv_output .= "\n";
     foreach ($data as $item) {
         foreach ($item as $k => $v) {
             $csv_output .= $this->app->format->no_dashes($v) . ',';
             //  $csv_output .= "\t";
         }
         $cart_items = mw()->shop_manager->order_items($item['id']);
         if (!empty($cart_items)) {
         }
         dd($cart_items);
         $csv_output .= "\n";
     }
     //dd($csv_output);
     $filename = 'orders' . '_' . date('Y-m-d_H-i', time()) . uniqid() . '.csv';
     $filename_path = userfiles_path() . 'export' . DS . 'orders' . DS;
     $filename_path_index = userfiles_path() . 'export' . DS . 'orders' . DS . 'index.php';
     if (!is_dir($filename_path)) {
         mkdir_recursive($filename_path);
     }
     if (!is_file($filename_path_index)) {
         @touch($filename_path_index);
     }
     $filename_path_full = $filename_path . $filename;
     file_put_contents($filename_path_full, $csv_output);
     $download = $this->app->url_manager->link_to_file($filename_path_full);
     return array('success' => 'Your file has been exported!', 'download' => $download);
     dd('export_orders');
 }
开发者ID:microweber,项目名称:microweber,代码行数:40,代码来源:OrderManager.php


示例16: editor_tools


//.........这里部分代码省略.........
         // $is_admin = $this->app->user_manager->is_admin();
         $default_css = '<link rel="stylesheet" href="' . mw_includes_url() . 'default.css" type="text/css" />';
         $headers = event_trigger('site_header', TEMPLATE_NAME);
         $template_headers_append = '';
         $one = 1;
         if (is_array($headers)) {
             foreach ($headers as $modify) {
                 if ($modify != false and is_string($modify) and $modify != '') {
                     $template_headers_append = $template_headers_append . $modify;
                 }
             }
             if ($template_headers_append != false and $template_headers_append != '') {
                 $layout = str_ireplace('</head>', $template_headers_append . '</head>', $l, $one);
             }
         }
         if (function_exists('template_headers_src')) {
             $template_headers_src = template_headers_src();
             if ($template_headers_src != false and $template_headers_src != '') {
                 $layout = str_ireplace('</head>', $template_headers_src . '</head>', $l, $one);
             }
         }
         if (isset($page['active_site_template'])) {
             if ($page['active_site_template'] == '') {
                 $page['active_site_template'] = 'default';
             }
             if ($page['active_site_template'] == 'default') {
                 $active_site_template = $this->app->option_manager->get('current_template', 'template');
             } else {
                 $active_site_template = $page['active_site_template'];
                 if ($active_site_template == 'mw_default') {
                     $active_site_template = 'default';
                 }
             }
             $live_edit_css_folder = userfiles_path() . 'css' . DS . $active_site_template . DS;
             $custom_live_edit = $live_edit_css_folder . DS . 'live_edit.css';
             if (is_file($custom_live_edit)) {
                 $live_edit_url_folder = userfiles_url() . 'css/' . $active_site_template . '/';
                 $custom_live_editmtime = filemtime($custom_live_edit);
                 $liv_ed_css = '<link rel="stylesheet" href="' . $live_edit_url_folder . 'live_edit.css?version=' . $custom_live_editmtime . '" id="mw-template-settings" type="text/css" />';
                 $layout = str_ireplace('</head>', $liv_ed_css . '</head>', $l);
             }
         }
     }
     if (isset($_REQUEST['plain'])) {
         if (is_file($p)) {
             $p = new \Microweber\View($p);
             $p->params = $params;
             $layout = $p->__toString();
             echo $layout;
             return;
         }
     } elseif (is_file($p)) {
         $p = new \Microweber\View($p);
         $p->params = $params;
         $layout_tool = $p->__toString();
         $layout = str_replace('{content}', $layout_tool, $layout);
     } else {
         $layout = str_replace('{content}', 'Not found!', $layout);
     }
     $category = false;
     if (defined('CATEGORY_ID')) {
         $category = $this->app->category_manager->get_by_id(CATEGORY_ID);
     }
     //    $page['render_file'] = $render_file;
     if (!$standalone_edit) {
         if (isset($page['render_file'])) {
开发者ID:microweber,项目名称:microweber,代码行数:67,代码来源:DefaultController.php


示例17: create_full

 public function create_full()
 {
     if (!defined('INI_SYSTEM_CHECK_DISABLED')) {
         define('INI_SYSTEM_CHECK_DISABLED', ini_get('disable_functions'));
     }
     if (!strstr(INI_SYSTEM_CHECK_DISABLED, 'ini_set')) {
         ini_set('memory_limit', '512M');
     }
     if (!strstr(INI_SYSTEM_CHECK_DISABLED, 'set_time_limit')) {
         set_time_limit(600);
     }
     $backup_actions = array();
     $backup_actions[] = 'make_db_backup';
     $userfiles_folder = userfiles_path();
     $media_folder = media_base_path();
     $all_images = $this->app->media_manager->get_all('limit=10000');
     if (!empty($all_images)) {
         foreach ($all_images as $image) {
             if (isset($image['filename']) and $image['filename'] != false) {
                 $fn = url2dir($image['filename']);
                 if (is_file($fn)) {
                     $backup_actions[] = $fn;
                 }
             }
         }
     }
     $host = parse_url(site_url());
     $host_dir = false;
     if (isset($host['host'])) {
         $host_dir = $host['host'];
         $host_dir = str_ireplace('www.', '', $host_dir);
         $host_dir = str_ireplace('.', '-', $host_dir);
     }
     $userfiles_folder_uploaded = $media_folder . DS . $host_dir . DS . 'uploaded' . DS;
     $userfiles_folder_uploaded = $media_folder . DS . $host_dir . DS;
     $userfiles_folder_uploaded = \normalize_path($userfiles_folder_uploaded);
     $folders = \rglob($userfiles_folder_uploaded . '*', GLOB_NOSORT);
     if (!is_array($folders)) {
         $folders = array();
     }
     $cust_css_dir = $userfiles_folder . 'css' . DS;
     if (is_dir($cust_css_dir)) {
         $more_folders = \rglob($cust_css_dir . '*', GLOB_NOSORT);
         if (!empty($more_folders)) {
             $folders = array_merge($folders, $more_folders);
         }
     }
     if (!empty($folders)) {
         $text_files = array();
         foreach ($folders as $fold) {
             if (!stristr($fold, 'backup')) {
                 if (stristr($fold, '.php') or stristr($fold, '.js') or stristr($fold, '.css')) {
                     $text_files[] = $fold;
                 } else {
                     $backup_actions[] = $fold;
                 }
             }
         }
         if (!empty($text_files)) {
             $backup_actions = array_merge($text_files, $backup_actions);
         }
     }
     $cache_id = 'backup_queue';
     $cache_id_loc = 'backup_progress';
     $cache_state_id = 'backup_zip_state';
     $this->app->cache_manager->save($backup_actions, $cache_id, 'backup');
     $this->app->cache_manager->save(false, $cache_id_loc, 'backup');
     $this->app->cache_manager->save(false, $cache_state_id, 'backup');
     if (!defined('MW_NO_SESSION')) {
         define('MW_NO_SESSION', 1);
     }
     return;
 }
开发者ID:microweber,项目名称:microweber,代码行数:73,代码来源:Backup.php


示例18: _mw_get_language_file_content_namespaced

function _mw_get_language_file_content_namespaced($namespace)
{
    if ($namespace == false) {
        return false;
    }
    global $mw_language_content_namespace;
    $namespace = trim($namespace);
    $namespace = str_replace(' ', '', $namespace);
    $namespace = str_replace('..', '', $namespace);
    $namespace = str_replace('\\', '/', $namespace);
    if (isset($mw_language_content_namespace[$namespace]) and !empty($mw_language_content_namespace[$namespace])) {
        return $mw_language_content_namespace[$namespace];
    }
    $lang = current_lang();
    $lang_file = userfiles_path() . $namespace . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR . $lang . '.json';
    $lang_file = normalize_path($lang_file, false);
    $lang_file2 = userfiles_path() . 'language' . DIRECTORY_SEPARATOR . $namespace . DIRECTORY_SEPARATOR . $lang . '.json';
    $lang_file2 = normalize_path($lang_file2, false);
    $lang_file3 = userfiles_path() . $namespace . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR . 'en.json';
    $lang_file3 = normalize_path($lang_file3, false);
    if (!isset($mw_language_content_namespace[$namespace])) {
        $mw_language_content_namespace[$namespace] = array();
    }
    if (is_file($lang_file2)) {
        $language_str = file_get_contents($lang_file2);
        $language = json_decode($language_str, true);
        if (isset($language) and is_array($language)) {
            foreach ($language as $k => $v) {
                if (isset($mw_language_content[$namespace][$k]) == false) {
                    $mw_language_content_namespace[$namespace][$k] = $v;
                }
            }
        }
    }
    if (is_file($lang_file)) {
        $language_str = file_get_contents($lang_file);
        $language = json_decode($language_str, true);
        if (isset($language) and is_array($language)) {
            foreach ($language as $k => $v) {
                if (isset($mw_language_content_namespace[$namespace][$k]) == false) {
                    $mw_language_content_namespace[$namespace][$k] = $v;
                }
            }
        }
    }
    if (is_file($lang_file3)) {
        $language_str = file_get_contents($lang_file3);
        $language = json_decode($language_str, true);
        if (isset($language) and is_array($language)) {
            foreach ($language as $k => $v) {
                if (isset($mw_language_content_namespace[$namespace][$k]) == false) {
                    $mw_language_content_namespace[$namespace][$k] = $v;
                }
            }
        }
    }
    return $mw_language_content_namespace[$namespace];
}
开发者ID:microweber,项目名称:microweber,代码行数:58,代码来源:lang.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP usergetdate函数代码示例发布时间:2022-05-23
下一篇:
PHP useredit_update_user_preference函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap