2 /*******************************************
3 * mysql_xxx => nucleus_mysql_xxx converter *
5 * ver 0.6.1b Written by Katsumi *
6 *******************************************/
8 // The license of this script is GPL
11 if (strpos(strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']),'ja')===0) {
14 $charset='iso-8859-1';
16 header("Content-Type: text/html; charset=$charset");
18 if (!file_exists('./nucleus/sqlite/convert.php')) exit;
19 include('./nucleus/sqlite/convert.php');
23 $myself='installsqlite.php';
24 if ((@$_GET['go'])!='yes') {
26 if ($charset=='EUC-JP') {
27 ?>¤³¤Î¥Ú¡¼¥¸¤Ç¤Ï¡¢SQLite ¤Ç»ÈÍѤ¹¤ë¤¿¤á¤Î Nucleus ¤Î³Æ¥Õ¥¡¥¤¥ë¤ÎÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡£<br /><br />
28 ¤¹¤Ù¤Æ¤Î "mysql_xxx" ´Ø¿ô¸Æ¤Ó½Ð¤·¤Îɽµ¤¬ "nucleus_mysql_xxx"¤ËÊѹ¹¤µ¤ì¤Þ¤¹.<br /><br />
29 <?php if (!function_exists('mysql_query')) {?>
30 ¤³¤ÎÊѹ¹¤Ï¡¢MySQL ´Ø¿ô¤¬ PHP ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢É¬¿Ü¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£<br />
31 ¤³¤Î¾ì¹ç "install.php" ¤È "config.php" ¤À¤±¤ËÊѹ¹¤¬É¬ÍפǤ¹¡£<br />
32 ¤â¤·MySQL ´Ø¿ô¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤ª¤é¤º¡¢¾ÍèŪ¤Ë¤â¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Ê¤¤¤³¤È¤¬³Î¼Â¤Ê¾ì¹ç¡¢<br />
33 <a href="?go=yes&modify=no">¤³¤³¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤</a>(install.php ¤È config.php ¤¬Êѹ¹¤µ¤ì¤Þ¤¹)¡£<br /><br />
34 ¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢²¼¤Î¥ê¥ó¥¯¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£<br /><br />
36 <a href="?go=yes&modify=yes">Êѹ¹¤ò³«»Ï</a>(¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤¹¤Ù¤Æ¤Î PHP ¥Õ¥¡¥¤¥ë¤¬Êѹ¹¤µ¤ì¤Þ¤¹)¡£<br /><br />
37 »Ï¤á¤ëÁ°¤Ë¡¢Êѹ¹¤µ¤ì¤ë¤Ù¤ PHP ¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤¬¡¢Æɤ߽ñ¤²Äǽ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
40 ?>This page is to modify Nucleus core files for using SQLite as database engine.<br /><br />
41 All the "mysql_xxx" functions will be converted to "nucleus_mysql_xxx".<br /><br />
42 <?php if (!function_exists('mysql_query')) {?>
43 This modification is not required if MySQL functions of PHP are not installed in the server.<br />
44 In this case, only the "install.php" and "config.php" must be modified.<br />
45 If you are sure that the MySQL function is never (now and in future) installed, <br />
46 <a href="?go=yes&modify=no">please click here</a>(install.php and config.php will be changed).<br /><br />
47 Otherwise, please click following link.<br /><br />
49 <a href="?go=yes&modify=yes">Start modification</a>(all the PHP files in this directory will be changed).<br /><br />
50 Please make sure that all PHP files to be modified are readable and writable.
56 if ((@$_GET['modify'])=='yes') {
57 // Obtain all PHP files in current and child directories.
59 seekPhpFiles('./',$phpfiles,$myself);
61 // Modify all PHP files; mysql_xxxx is replaced by nucleus_mysql_XXXX.
63 foreach ($phpfiles as $file) $allok=$allok && changeFunctions($file);
64 if (!$allok) ExitWithError();
67 // Modify config.php, install.php and backup.php
68 modifyConfigInstall();
70 if ($charset=='EUC-JP') {
71 ?>¤¹¤Ù¤Æ¤ÎÊѹ¹¤¬½ªÎ»¤·¤Þ¤·¤¿¡£<hr />
72 <a href="install.php">¤³¤³¤ò¥¯¥ê¥Ã¥¯¤·¤Æ Nucleus w/SQLite ¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò³«»Ï¤·¤Æ¤¯¤À¤µ¤¤¡£</a><br />
75 ?>All modificatios are sccesfully done.<hr />
76 <a href="install.php">Click here to install Nucleus w/SQLite</a><br />
79 if (@rename('installsqlite.php','installsqlite.php~')) {
80 if ($charset=='EUC-JP') {
81 echo '("installsqlite.php" ¤Ï "installsqlite.php~" ¤Ë¥Õ¥¡¥¤¥ë̾¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤Þ¤¹¡£)';
83 echo '("installsqlite.php" has been renamed to "installsqlite.php~".)';