本文整理匯總了PHP中PDF_Common::initialise_WP_filesystem_API方法的典型用法代碼示例。如果您正苦於以下問題:PHP PDF_Common::initialise_WP_filesystem_API方法的具體用法?PHP PDF_Common::initialise_WP_filesystem_API怎麽用?PHP PDF_Common::initialise_WP_filesystem_API使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PDF_Common
的用法示例。
在下文中一共展示了PDF_Common::initialise_WP_filesystem_API方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: do_template_migration
public static function do_template_migration()
{
/*
* Initialise the Wordpress Filesystem API
*/
if (PDF_Common::initialise_WP_filesystem_API(array(), 'gfpdfe_migrate') === false) {
return 'false';
}
/*
* If we got here we should have $wp_filesystem available
*/
global $wp_filesystem, $gfpdfe_data;
/*
* Convert paths for SSH/FTP users who are rooted to a directory along the server absolute path
*/
$base_template_directory = self::get_basedir($gfpdfe_data->template_location);
$current_pdf_path = self::get_basedir($gfpdfe_data->template_site_location);
if (is_dir($gfpdfe_data->old_template_location)) {
$previous_pdf_path = self::get_basedir($gfpdfe_data->old_template_location);
} elseif (is_dir($gfpdfe_data->old_3_6_template_site_location)) {
$previous_pdf_path = self::get_basedir($gfpdfe_data->old_3_6_template_site_location);
}
/* create the base template directory */
if (self::create_base_template_dir($base_template_directory) === false) {
return false;
}
/* create the site template directory */
if (self::create_site_template_dir($current_pdf_path) === false) {
return false;
}
if ($wp_filesystem->is_dir($previous_pdf_path)) {
if (is_dir($gfpdfe_data->old_template_location)) {
/* swap back to TRUE to delete the theme folder */
if (!self::pdf_extended_copy_directory($previous_pdf_path, $current_pdf_path, true, true, true)) {
return false;
}
} elseif (is_dir($gfpdfe_data->old_3_6_template_site_location)) {
/* swap back to TRUE to delete the theme folder */
if (!self::pdf_extended_copy_directory($previous_pdf_path, $current_pdf_path, true, false, true)) {
return false;
}
}
/*
* Clean up the DB
*/
delete_option('gfpdfe_automated_install');
}
return true;
}