本文整理匯總了PHP中PDF_Common::get_upload_dir方法的典型用法代碼示例。如果您正苦於以下問題:PHP PDF_Common::get_upload_dir方法的具體用法?PHP PDF_Common::get_upload_dir怎麽用?PHP PDF_Common::get_upload_dir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PDF_Common
的用法示例。
在下文中一共展示了PDF_Common::get_upload_dir方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: set_directory_structure
/**
* Used to set up our PDF template folder,
* save folder and font folder
*/
public function set_directory_structure()
{
$upload_dir = PDF_Common::get_upload_dir();
$site_name = PDF_Common::get_site_name();
/*
* As of Gravity PDF 3.7 we'll be dropping the 'site_name' folder for single installs
* And changing multisite installs to their site ID
*/
$this->template_location = apply_filters('gfpdfe_template_location', $upload_dir['basedir'] . '/' . PDF_SAVE_FOLDER . '/', $upload_dir['basedir'], PDF_SAVE_FOLDER);
$this->template_site_location = $this->template_location;
$this->template_save_location = $this->template_location . 'output/';
$this->template_font_location = $this->template_location . 'fonts/';
$this->template_location_url = apply_filters('gfpdfe_template_location_uri', $upload_dir['baseurl'] . '/' . PDF_SAVE_FOLDER . '/', $upload_dir['baseurl'], PDF_SAVE_FOLDER);
$this->template_site_location_url = $this->template_location_url;
$this->template_save_location_url = $this->template_location_url . 'output/';
$this->template_font_location_url = $this->template_location_url . 'fonts/';
$this->old_3_6_template_site_location = $this->template_location . $site_name . '/';
/*
* Use the network ID for multisite installs
*/
if (is_multisite()) {
$blog_id = get_current_blog_id();
$this->template_site_location = $this->template_location . $blog_id . '/';
$this->template_save_location = $this->template_site_location . 'output/';
$this->template_font_location = $this->template_site_location . 'fonts/';
$this->template_site_location_url = $this->template_location_url . $blog_id . '/';
$this->template_save_location_url = $this->template_site_location_url . 'output/';
$this->template_font_location_url = $this->template_site_location_url . 'fonts/';
$this->old_3_6_template_site_location = $this->template_location . $site_name . '/';
}
/*
* Include old template locations to help with migrations
*/
$this->old_template_location = get_stylesheet_directory() . '/' . PDF_SAVE_FOLDER . '/';
$this->upload_dir = $upload_dir['basedir'];
/*
* Include relative paths for display on the support pages
*/
$this->relative_output_location = str_replace(ABSPATH, '/', $this->template_save_location);
$this->relative_font_location = str_replace(ABSPATH, '/', $this->template_font_location);
$this->relative_mpdf_tmp = str_replace(ABSPATH, '/', PDF_PLUGIN_DIR) . 'mPDF/tmp/';
}