Advertisement
kgiglio

nn+ print

Apr 12th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. <?php
  2. require_once('../lib/installpage.php');
  3. require_once('../lib/install.php');
  4.  
  5. $page = new Installpage();
  6. $page->title = "Preflight Checklist";
  7.  
  8. $cfg = new Install();
  9.  
  10. if (!$cfg->isInitialized()) {
  11. header("Location: index.php");
  12. die();
  13. }
  14.  
  15. $cfg = $cfg->getSession();
  16.  
  17. // Start checks
  18. $cfg->sha1Check = function_exists('sha1');
  19. if ($cfg->sha1Check === false) { $cfg->error = true; }
  20.  
  21. $cfg->mysqlCheck = function_exists('mysql_connect');
  22. if ($cfg->mysqlCheck === false) { $cfg->error = true; }
  23.  
  24. $cfg->gdCheck = function_exists('imagecreatetruecolor');
  25.  
  26. $cfg->curlCheck = function_exists('curl_init');
  27.  
  28. $cfg->cacheCheck = is_writable($cfg->SMARTY_DIR.'/templates_c');
  29. if ($cfg->cacheCheck === false) { $cfg->error = true; }
  30.  
  31. $cfg->movieCoversCheck = is_writable($cfg->WWW_DIR.'/covers/movies');
  32. if ($cfg->movieCoversCheck === false) { $cfg->error = true; }
  33.  
  34. $cfg->animeCoversCheck = is_writable($cfg->WWW_DIR.'/covers/anime');
  35. if ($cfg->animeCoversCheck === false) { $cfg->error = true; }
  36.  
  37. $cfg->musicCoversCheck = is_writable($cfg->WWW_DIR.'/covers/music');
  38. if ($cfg->musicCoversCheck === false) { $cfg->error = true; }
  39.  
  40. $cfg->configCheck = is_writable($cfg->WWW_DIR.'/config.php');
  41. if($cfg->configCheck === false) {
  42. $cfg->configCheck = is_file($cfg->WWW_DIR.'/config.php');
  43. if($cfg->configCheck === true) {
  44. $cfg->configCheck = false;
  45. $cfg->error = true;
  46. } else {
  47. $cfg->configCheck = is_writable($cfg->WWW_DIR);
  48. if($cfg->configCheck === false) {
  49. $cfg->error = true;
  50. }
  51. }
  52. }
  53.  
  54. $cfg->lockCheck = is_writable($cfg->INSTALL_DIR.'/install.lock');
  55. if ($cfg->lockCheck === false) {
  56. $cfg->lockCheck = is_file($cfg->INSTALL_DIR.'/install.lock');
  57. if($cfg->lockCheck === true) {
  58. $cfg->lockCheck = false;
  59. $cfg->error = true;
  60. } else {
  61. $cfg->lockCheck = is_writable($cfg->INSTALL_DIR);
  62. if($cfg->lockCheck === false) {
  63. $cfg->error = true;
  64. }
  65. }
  66. }
  67.  
  68. $cfg->pearCheck = @include('System.php');
  69. $cfg->pearCheck = class_exists('System');
  70. if (!$cfg->pearCheck) { $cfg->error = true; }
  71.  
  72. $cfg->schemaCheck = is_readable($cfg->DB_DIR.'/schema.sql');
  73. if ($cfg->schemaCheck === false) { $cfg->error = true; }
  74.  
  75. // Dont set error = true for these as we only want to display a warning
  76. $cfg->phpCheck = (version_compare(PHP_VERSION, '5.2.0', '>=')) ? true : false;
  77. $cfg->timelimitCheck = (ini_get('max_execution_time') >= 60) ? true : false;
  78. $cfg->memlimitCheck = (ini_get('memory_limit') == -1 || ini_get('memory_limit') >= 256) ? true : false;
  79. $cfg->opensslCheck = !extension_loaded("opensssl");
  80. $cfg->timezoneCheck = (ini_get('date.timezone') != "");
  81.  
  82. $cfg->rewriteCheck = (function_exists("apache_get_modules") && in_array("mod_rewrite", apache_get_modules())) ? true : false;
  83.  
  84. //Load previous config.php
  85. if (file_exists($cfg->WWW_DIR.'/config.php') && is_readable($cfg->WWW_DIR.'/config.php')) {
  86. $tmpCfg = file_get_contents($cfg->WWW_DIR.'/config.php');
  87. $cfg->setConfig($tmpCfg);
  88. }
  89.  
  90. if (!$cfg->error)
  91. $cfg->setSession();
  92.  
  93. $page->smarty->assign('cfg', $cfg);
  94.  
  95. $page->smarty->assign('page', $page);
  96.  
  97. $page->content = $page->smarty->fetch('step1.tpl');
  98. $page->render();
  99. print_r($_SESSION);
  100. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement