/** * ブログディレクトリを削除 */ public static function removeBlogDirectory($blog_id) { $upload_path = Config::get('WWW_UPLOAD_DIR') . '/' . App::getBlogLayer($blog_id); system("rm -fr " . $upload_path); $template_path = Config::get('BLOG_TEMPLATE_DIR') . App::getBlogLayer($blog_id); system("rm -fr " . $template_path); }
/** * FC2テンプレートの構文チェック */ public static function fc2PluginSyntax($value) { // フォルダが存在しない場合作成 $plugin_path = Config::get('BLOG_TEMPLATE_DIR') . App::getBlogLayer(Session::get('blog_id')) . '/plugins/syntax.php'; $plugin_dir = dirname($plugin_path); if (!file_exists($plugin_dir)) { mkdir($plugin_dir, 0777, true); } // HTMLをPHPテンプレートに変換してテンプレートファイルの作成 Model::load('BlogTemplates'); $html = BlogTemplatesModel::convertFC2Template($value); file_put_contents($plugin_path, $html); chmod($plugin_path, 0777); // PHPのシンタックスチェック $cmd = 'php -l ' . $plugin_path; $ret = shell_exec($cmd); if (strpos($ret, 'No syntax errors detected') !== false) { return true; } return __('There may be a problem with the template or plug-in, installed in the blog.'); }
/** * CSSのURLを返却 */ public static function getCssUrl($blog_id, $device_type, $isPreview = false) { return '/' . Config::get('UPLOAD_DIR_NAME') . '/' . App::getBlogLayer($blog_id) . '/' . $device_type . '/' . ($isPreview ? 'preview' : 'index') . '.css'; }