diff --git a/210x/cpi/readme.txt b/210x/cpi/readme.txt
deleted file mode 100755
index 19fbb9c..0000000
--- a/210x/cpi/readme.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# 簡単セットアップについて
-
-「簡単セットアップ」を利用すると 10KB程度の PHP ファイルをアップロードして、ブラウザで表示させるだけで a-blog cms のパッケージのダウンロードや ionCube Loader の設定が可能です。
-
-## 利用できるサーバー
-
-* Windows XAMPP
-* macOS MAMP
-* KDDI ウェブコミュニケーションズ CPI ACE01
-* さくらインターネット レンタルサーバ
-* ファーストサーバー Zenlogic
-* エックスサーバー
-* GMO ペパボ ヘテムル / ロリポップ
-
-## 利用方法
-
-「簡単セットアップ」を利用することで以下の作業を自動化してくれます。
-
-1. 利用されるPHPのバージョンに合わせた a-blog cms のパッケージを直接サーバー上にダウンロード
-2. ダウンロードした Zipファイルを解凍し、設置先に移動
-3. サーバーにあわせた ionCube Loader を直接ダウンロード
-4. ダウンロードした ionCube Loader の Zipファイルを解凍
-5. ionCube Loader 等を利用する設定を php.ini に設定
-6. .htaccess を有効にし、サーバーにあわせた設定
-7. ダウンロードした Zipファイルや、必要のないフォルダの削除
-8. a-blog cms インストーラーを起動
-
-
-
diff --git a/210x/cpi/setup.php b/210x/cpi/setup.php
deleted file mode 100755
index 38ec62a..0000000
--- a/210x/cpi/setup.php
+++ /dev/null
@@ -1,473 +0,0 @@
-open($zipFile);
-
-if($res === true){
- $zip->extractTo($installPath);
- $zip->close();
-
-} else {
- echo 'a-blog cms unZip Error ! : '. $zipFile;
- exit;
-}
-
-// --------------------------
-// a-blog cms ディレクトリを移動
-// --------------------------
-
-if ($handle = opendir($ablogcmsDir)) {
- while(false !== ($entry = readdir($handle))) {
- if ($entry != "." && $entry != "..") {
- rename($ablogcmsDir.$entry, $installPath ."/". $entry);
- }
- }
- closedir($handle);
-} else {
- echo 'a-blog cms move Error ! :'.$ablogcmsDir;
- exit;
-}
-
-
-// --------------------------
-// ioncube ファイルをダウンロード
-// --------------------------
-
-$fp = fopen($downloadIoncube, "r");
-if ($fp !== FALSE) {
- file_put_contents($zipFileIoncube, "");
- while(!feof($fp)) {
- $buffer = fread($fp, 4096);
- if ($buffer !== FALSE) {
- file_put_contents($zipFileIoncube, $buffer, FILE_APPEND);
- }
- }
- fclose($fp);
-} else {
- echo 'ioncube loader download Error ! : '.$download;
- exit;
-}
-
-// --------------------------
-// ioncube ファイルを解凍
-// --------------------------
-
-$zip = new ZipArchive();
-$res = $zip->open($zipFileIoncube);
-
-if($res === true){
- $zip->extractTo($installPath);
- $zip->close();
-
-} else {
- echo 'ioncube loader unZip Error ! : '. $zipFileIoncube;
- exit;
-}
-
-// --------------------------
-// php.ini の設定
-// --------------------------
-
-$iniFileName = "php.ini";
-$iniData = sprintf("date.timezone = 'Asia/Tokyo'\nzend_extension = \"%s/ioncube/ioncube_loader_fre_%s.so\"",$installPath,$ioncubePhpVersion);
-file_put_contents($installPath."/".$iniFileName, $iniData, FILE_APPEND | LOCK_EX);
-
-# setupディレクトリにも php.ini が必要な時のために
-copy($installPath."/php.ini", $installPath."/setup/php.ini");
-
-
-
-// --------------------------
-// .htaccess の設定
-// --------------------------
-
-rename($installPath."/htaccess.txt", $installPath.'/.htaccess');
-rename($installPath."/archives/htaccess.txt", $installPath.'/archives/.htaccess');
-rename($installPath."/archives_rev/htaccess.txt", $installPath.'/archives_rev/.htaccess');
-rename($installPath."/media/htaccess.txt", $installPath.'/media/.htaccess');
-rename($installPath."/private/htaccess.txt", $installPath.'/private/.htaccess');
-rename($installPath."/themes/htaccess.txt", $installPath.'/themes/.htaccess');
-
-$htaccess = file_get_contents($installPath."/.htaccess");
-
-$new = sprintf("
%s%s にアクセスしてください。
',$mampRestart, $jump, $jump); - -// -------------------------- -// ディレクトリを操作 function ( move / copy / delete ) -// -------------------------- - -function dir_shori ($shori, $nowDir , $newDir="") { - - if ($shori != "delete") { - if (!is_dir($newDir)) { - mkdir($newDir); - } - } - - if (is_dir($nowDir)) { - if ($handle = opendir($nowDir)) { - while (($file = readdir($handle)) !== false) { - if ($file != "." && $file != "..") { - if ($shori == "copy") { - if (is_dir($nowDir."/".$file)) { - dir_shori("copy", $nowDir."/".$file, $newDir."/".$file); - } else { - copy($nowDir."/".$file, $newDir."/".$file); - } - } elseif ($shori == "move") { - rename($nowDir."/".$file, $newDir."/".$file); - } elseif ($shori == "delete") { - if (filetype($nowDir."/".$file) == "dir") { - dir_shori("delete", $nowDir."/".$file, ""); - } else { - unlink($nowDir."/".$file); - } - } - } - } - closedir($handle); - } - } - - if ($shori == "move" || $shori == "delete") { - rmdir($nowDir); - } - - return true; -} - -function download_version_check () { - - // Version 2.10.x のチェック用 - // 正常にチェックできない場合には 空 でかえす。 - - $options['ssl']['verify_peer']=false; - $options['ssl']['verify_peer_name']=false; - $html=file_get_contents('https://developer.a-blogcms.jp/download/', false, stream_context_create($options)); - preg_match('/コントロールパネルの「php.ini設定のphp.ini直接編集」にアクセスし何も変更せずに保存するか、
しばらく時間をおいてアクセスしてみてください。
設定した php.ini が有効になりインストーラーが起動します。
a-blog cms Ver %s ( php %s ) をインストールしました。
',$ablogcmsVersion,$version); - -$jump = "http://".$_SERVER['HTTP_HOST'].str_replace($phpName, "", $_SERVER['SCRIPT_NAME']); -echo sprintf('%s%s にアクセスしてください。
',$mampRestart, $jump, $jump); - -// -------------------------- -// ディレクトリを操作 function ( move / copy / delete ) -// -------------------------- - -function dir_shori ($shori, $nowDir , $newDir="") { - - if ($shori != "delete") { - if (!is_dir($newDir)) { - mkdir($newDir); - } - } - - if (is_dir($nowDir)) { - if ($handle = opendir($nowDir)) { - while (($file = readdir($handle)) !== false) { - if ($file != "." && $file != "..") { - if ($shori == "copy") { - if (is_dir($nowDir."/".$file)) { - dir_shori("copy", $nowDir."/".$file, $newDir."/".$file); - } else { - copy($nowDir."/".$file, $newDir."/".$file); - } - } elseif ($shori == "move") { - rename($nowDir."/".$file, $newDir."/".$file); - } elseif ($shori == "delete") { - if (filetype($nowDir."/".$file) == "dir") { - dir_shori("delete", $nowDir."/".$file, ""); - } else { - unlink($nowDir."/".$file); - } - } - } - } - closedir($handle); - } - } - - if ($shori == "move" || $shori == "delete") { - rmdir($nowDir); - } - - return true; -} - -function download_version_check () { - - // Version 2.11.x のチェック用 - // 正常にチェックできない場合には 空 でかえす。 - - $options['ssl']['verify_peer']=false; - $options['ssl']['verify_peer_name']=false; - $html=file_get_contents('https://developer.a-blogcms.jp/download/', false, stream_context_create($options)); - preg_match('/コントロールパネルの「高度な設定 > PHP の php.ini編集」から(内容を編集)ボタンをクリックし、
「上記の注意事項を確認しました」のチェックをクリックして(編集する)ボタンをクリックしてください。
設定した php.ini が有効になりインストーラーが起動します。
%sを再起動して %s にアクセスしてください。
',$systemName,$jump,$jump); - -// -------------------------- -// ディレクトリを操作 function ( move / copy / delete ) -// -------------------------- - -function dir_shori ($shori, $nowDir , $newDir="") { - - if ($shori != "delete") { - if (!is_dir($newDir)) { - mkdir($newDir); - } - } - - if (is_dir($nowDir)) { - if ($handle = opendir($nowDir)) { - while (($file = readdir($handle)) !== false) { - if ($file != "." && $file != "..") { - if ($shori == "copy") { - if (is_dir($nowDir."/".$file)) { - dir_shori("copy", $nowDir."/".$file, $newDir."/".$file); - } else { - copy($nowDir."/".$file, $newDir."/".$file); - } - } elseif ($shori == "move") { - rename($nowDir."/".$file, $newDir."/".$file); - } elseif ($shori == "delete") { - if (filetype($nowDir."/".$file) == "dir") { - dir_shori("delete", $nowDir."/".$file, ""); - } else { - unlink($nowDir."/".$file); - } - } - } - } - closedir($handle); - } - } - - if ($shori == "move" || $shori == "delete") { - rmdir($nowDir); - } - - return true; -} - -function download_version_check () { - - // Version 2.11.x のチェック用 - // 正常にチェックできない場合には 空 でかえす。 - - $options['ssl']['verify_peer']=false; - $options['ssl']['verify_peer_name']=false; - $html=file_get_contents('https://developer.a-blogcms.jp/download/', false, stream_context_create($options)); - preg_match('/コントロールパネルの「php.ini設定のphp.ini直接編集」にアクセスし何も変更せずに保存するか、
しばらく時間をおいてアクセスしてみてください。
設定した php.ini が有効になりインストーラーが起動します。
%s%s にアクセスしてください。
',$mampRestart, $jump, $jump); - -// -------------------------- -// ディレクトリを操作 function ( move / copy / delete ) -// -------------------------- - -function dir_shori ($shori, $nowDir , $newDir="") { - - if ($shori != "delete") { - if (!is_dir($newDir)) { - mkdir($newDir); - } - } - - if (is_dir($nowDir)) { - if ($handle = opendir($nowDir)) { - while (($file = readdir($handle)) !== false) { - if ($file != "." && $file != "..") { - if ($shori == "copy") { - if (is_dir($nowDir."/".$file)) { - dir_shori("copy", $nowDir."/".$file, $newDir."/".$file); - } else { - copy($nowDir."/".$file, $newDir."/".$file); - } - } elseif ($shori == "move") { - rename($nowDir."/".$file, $newDir."/".$file); - } elseif ($shori == "delete") { - if (filetype($nowDir."/".$file) == "dir") { - dir_shori("delete", $nowDir."/".$file, ""); - } else { - unlink($nowDir."/".$file); - } - } - } - } - closedir($handle); - } - } - - if ($shori == "move" || $shori == "delete") { - rmdir($nowDir); - } - - return true; -} - -function download_version_check () { - - // Version 2.8.x のチェック用 - // 正常にチェックできない場合には 空 でかえす。 - - $options['ssl']['verify_peer']=false; - $options['ssl']['verify_peer_name']=false; - $html=file_get_contents('https://developer.a-blogcms.jp/download/', false, stream_context_create($options)); - preg_match('/コントロールパネルの「php.ini設定のphp.ini直接編集」にアクセスし何も変更せずに保存するか、
しばらく時間をおいてアクセスしてみてください。
設定した php.ini が有効になりインストーラーが起動します。
%s%s にアクセスしてください。
',$mampRestart, $jump, $jump); - -// -------------------------- -// ディレクトリを操作 function ( move / copy / delete ) -// -------------------------- - -function dir_shori ($shori, $nowDir , $newDir="") { - - if ($shori != "delete") { - if (!is_dir($newDir)) { - mkdir($newDir); - } - } - - if (is_dir($nowDir)) { - if ($handle = opendir($nowDir)) { - while (($file = readdir($handle)) !== false) { - if ($file != "." && $file != "..") { - if ($shori == "copy") { - if (is_dir($nowDir."/".$file)) { - dir_shori("copy", $nowDir."/".$file, $newDir."/".$file); - } else { - copy($nowDir."/".$file, $newDir."/".$file); - } - } elseif ($shori == "move") { - rename($nowDir."/".$file, $newDir."/".$file); - } elseif ($shori == "delete") { - if (filetype($nowDir."/".$file) == "dir") { - dir_shori("delete", $nowDir."/".$file, ""); - } else { - unlink($nowDir."/".$file); - } - } - } - } - closedir($handle); - } - } - - if ($shori == "move" || $shori == "delete") { - rmdir($nowDir); - } - - return true; -} - -function download_version_check () { - - // Version 2.9.x のチェック用 - // 正常にチェックできない場合には 空 でかえす。 - - $options['ssl']['verify_peer']=false; - $options['ssl']['verify_peer_name']=false; - $html=file_get_contents('https://developer.a-blogcms.jp/download/', false, stream_context_create($options)); - preg_match('/コントロールパネルの「php.ini設定のphp.ini直接編集」にアクセスし何も変更せずに保存するか、
しばらく時間をおいてアクセスしてみてください。
設定した php.ini が有効になりインストーラーが起動します。
a-blog cms のインストール準備が完了しました。
+この ファイルについては削除済みです。
+ + + + + +a-blog cms のパッケージのダウンロードとファイルのリネーム作業を行います。
+ +%s
",$msg); + } + } + + + +} + +exit; +?> + + +(.*)<\/a><\/h1>/', $html, $matches); + + if (is_numeric($matches[2])) { + return "3.0." . $matches[2]; + } else { + return; + } +} diff --git a/30x/update/readme.txt b/30x/update/readme.txt new file mode 100755 index 0000000..5a20170 --- /dev/null +++ b/30x/update/readme.txt @@ -0,0 +1,39 @@ +# 簡単アップデートについて + +「簡単アップデート」を利用すると 10KB程度の PHP ファイルをアップロードして、ブラウザで表示させるだけで a-blog cms のパッケージのアップデートが可能です。 + +2.x から 3.0.x にアップデートする際に利用ください。 + + +## 利用できるサーバー + +* どのような環境でも利用可能です。 + + +## 設定方法 + +アップデートバージョンを指定する場合は「$ablogcmsVersion」を指定ください。 +( 最初の # を消すと有効になります) +指定しない場合、最新バージョンにアップデートされます。 + +``` +#$ablogcmsVersion = "3.0.0"; +``` + +利用しているテーマを設定ください。 ( 最初の # を消すと有効になります) +systemはアップデート対象になりますので指定しないでください。 +指定したテーマ名を含むテーマも対象になります。(例: site2020を指定した場合、sp@site2020 や blog@site2020 も対象になります) + +``` +#$useThemes = "blog2020"; # "site2020|blog2020"; +``` + +## 利用方法 + +上記の設定を行った後に、サーバーにアップロードして、ブラウザ上からアクセスしてください。 + +これまでのファイルは backup_yyyymmddhhmmss ディレクトリに移動してバックアップしておいてくれます。 + +もし、途中でエラーになった際には、update.lock というファイルが作られます。再実行する際には update.lockファイルを削除してください。 + +license.php が 開発用になりますので、本番環境の場合には MYPAGE より 3.0 対応版のライセンスをダウンロードください。 \ No newline at end of file diff --git a/211x/update/update.php b/30x/update/update.php similarity index 78% rename from 211x/update/update.php rename to 30x/update/update.php index 3676783..ba1d1f9 100755 --- a/211x/update/update.php +++ b/30x/update/update.php @@ -1,31 +1,29 @@ 2.11.x update +// a-blog cms 2.x -> 3.x update // // -------------------------- -# 今後は、このアップデートを利用することなく管理ページから -# 可能になります。 - -$ablogcmsVersion = ""; #サイトからバージョンを自動チェック +# 今後は、このアップデートを利用することなく管理ページから可能になります。 -# ERROR になる場合や 2.11系のバージョンを -# 指定したい場合には、バージョンを設定してください。 +# アップデートバージョンを指定する場合は「$ablogcmsVersion」を指定ください。 +# 指定しない場合、最新バージョンにアップデートされます。 -#$ablogcmsVersion = "2.11.0"; +#$ablogcmsVersion = "3.0.0"; # バージョンを指定する際には行頭の # を削除してください。 // -------------------------- # 利用しているテーマを指定します。 # 複数あれば | で区切って指定してください。 -# 継承しているテーマは全て含まれます。 +# 指定したテーマ名が入る、テーマも対象になります。(例: site2020を指定した場合、sp@site2020 や blog@site2020 も対象になります) # systemはアップデート対象になりますので指定しないでください。 - -#$useThemes = "blog2016"; # "site2015|blog2015"; - +#$useThemes = "blog2020"; # 複数の場合には | で区切って "site2020|blog2020"; // -------------------------- // 二重実行防止処理 @@ -60,21 +58,21 @@ $ymdhis = date("YmdHis"); # ダウンロード元 URL -$download55 = sprintf("http://developer.a-blogcms.jp/_package/%s/acms%s_update2x_php5.3.zip",$ablogcmsVersion,$ablogcmsVersion); -$download56 = sprintf("http://developer.a-blogcms.jp/_package/%s/acms%s_update2x_php5.6.zip",$ablogcmsVersion,$ablogcmsVersion); -$download71 = sprintf("http://developer.a-blogcms.jp/_package/%s/acms%s_update2x_php7.1.zip",$ablogcmsVersion,$ablogcmsVersion); +$download = sprintf("http://developer.a-blogcms.jp/_package/%s/acms%s_update2x.zip",$ablogcmsVersion,$ablogcmsVersion); # ダウンロード後のZipファイル名 -$zipFile = sprintf("./acms_%s.zip",$ymdhis); +$zipFile = sprintf("./acms%s_update2x.zip",$ablogcmsVersion); # 解凍後の全体フォルダ名 -$zipAfterDirName55 = sprintf("acms%s_update2x_php5.3",$ablogcmsVersion); -$zipAfterDirName56 = sprintf("acms%s_update2x_php5.6",$ablogcmsVersion); -$zipAfterDirName71 = sprintf("acms%s_update2x_php7.1",$ablogcmsVersion); +$zipAfterDirName = sprintf("acms%s_update2x",$ablogcmsVersion); # 解凍後の a-blog cms のフォルダ名 $cmsDirName = "ablogcms"; +$installPath = realpath('.'); +$ablogcmsDir = $installPath."/".$zipAfterDirName."/".$cmsDirName; +$phpName = basename($_SERVER['PHP_SELF']); + // -------------------------- // バージョンチェック // -------------------------- @@ -82,24 +80,10 @@ $versionArray = explode(".", phpversion()); $version = $versionArray[0].".".$versionArray[1]; - -if ($versionArray[0]==7 && $versionArray[1] > 0) { - $download = $download71; - $zipAfterDirName = $zipAfterDirName71; -} elseif ($versionArray[0] == 7 && $versionArray[1] == 0) { - $download = $download56; - $zipAfterDirName = $zipAfterDirName56; -} elseif ($versionArray[1] >= 6) { - $download = $download56; - $zipAfterDirName = $zipAfterDirName56; -} else { - $download = $download55; - $zipAfterDirName = $zipAfterDirName55; -} - -$installPath = realpath('.'); -$ablogcmsDir = $installPath."/".$zipAfterDirName."/".$cmsDirName; -$phpName = basename($_SERVER['PHP_SELF']); +if ($version < 7.2) { + echo "Installation error. Please use PHP 7.2 or higher."; + exit; +} // -------------------------- // a-blog cms ファイルをダウンロード @@ -149,8 +133,11 @@ if (is_file("./acms.js")) rename("./acms.js", $backupDir."/acms.js"); if (is_file("./index.js")) rename("./index.js", $backupDir."/index.js"); if (is_file("./500.html")) rename("./500.html", $backupDir."/500.html"); + rename("./index.php", $backupDir."/index.php"); +rename ("./license.php", $backupDir."/license.php"); + # ディレクトリを移動 dir_shori("move", "./js", $backupDir."/js"); @@ -159,9 +146,9 @@ dir_shori("move", "./private", $backupDir."/private"); dir_shori("move", "./themes", $backupDir."/themes"); -if (is_dir("./cache")) dir_shori("move", "./cache", $backupDir."/cache"); if (is_dir("./extension")) dir_shori("move", "./extension", $backupDir."/extension"); - +#if (is_dir("./cache")) dir_shori("move", "./cache", $backupDir."/cache"); +dir_shori ("delete", "cache"); // -------------------------- // update版 ファイル&ディレクトリを移動 @@ -169,8 +156,8 @@ dir_shori("move", $ablogcmsDir, $installPath); -# 運用中のものを利用するので新しいファイルは削除 -unlink($installPath ."/htaccess.txt"); +# 3.0対応 ライセンスファイル に上書き(ライセンス切れになります) +rename ($installPath."/".$zipAfterDirName."/omake/license.php", "./license.php"); // -------------------------- // カスタマイズ部分を戻す @@ -183,7 +170,7 @@ if ($theme != "." && $theme != "..") { if (preg_match("/".$useThemes."/", $theme)) { if (is_dir("./themes/".$theme)) { - rename ("./themes/".$theme, "./themes/".$theme."_".$ablogcmsVersion); + rename ("./themes/".$theme, "./themes/".$theme."_".$ablogcmsVersion); } dir_shori ("copy", $backupDir."/themes/".$theme, "./themes/".$theme); } @@ -214,9 +201,15 @@ // -------------------------- // .htaccess の設定 // -------------------------- + +rename("./htaccess.txt", './htaccess_'.$ablogcmsVersion.'.txt'); + rename("./private/htaccess.txt", './private/.htaccess'); rename("./themes/htaccess.txt", './themes/.htaccess'); rename("./cache/htaccess.txt", './cache/.htaccess'); +rename("./editorconfig.txt", './.editorconfig'); +rename("./env.txt", './.env'); +rename("./gitignore.txt", './.gitignore'); // -------------------------- // php.ini があった時の処理 @@ -296,18 +289,17 @@ function dir_shori ($shori, $nowDir , $newDir="") { function download_version_check () { - // Version 2.11.x のチェック用 + // Version 3.0.x のチェック用 // 正常にチェックできない場合には 空 でかえす。 $options['ssl']['verify_peer']=false; $options['ssl']['verify_peer_name']=false; $html=file_get_contents('https://developer.a-blogcms.jp/download/', false, stream_context_create($options)); - preg_match('/