summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-07-08 09:09:22 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-07-08 09:09:22 +0000
commitc014a32ec312d9f701962149b62d6119a5da6b99 (patch)
tree189857deb8de2d99221aebf0b453d0a4c6c719ae
parent86a9ed00b3f418fef4db30dc4f49feb5b5e7ab72 (diff)
downloadampache-c014a32ec312d9f701962149b62d6119a5da6b99.tar.gz
ampache-c014a32ec312d9f701962149b62d6119a5da6b99.tar.bz2
ampache-c014a32ec312d9f701962149b62d6119a5da6b99.zip
add additional information during the install process
-rwxr-xr-xdocs/CHANGELOG2
-rw-r--r--lib/debug.lib.php41
-rw-r--r--templates/show_install.inc.php10
-rw-r--r--templates/show_install_account.inc.php2
-rw-r--r--templates/show_install_check.inc.php25
-rw-r--r--templates/show_install_config.inc.php6
-rw-r--r--templates/show_install_lang.inc.php6
7 files changed, 79 insertions, 13 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 3de0dffe..0a2fd9fc 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,8 @@
--------------------------------------------------------------------------
v.3.6-Alpha1
+ - Added additional information to installation process
+ - Fix PHP 5.3 errors (Thx momo-i)
- Fix random methods not working for localplay
- Fixed extra space on prefixed albums (Thx ibizaman)
- Add missing operator on tag and rating searches so they will
diff --git a/lib/debug.lib.php b/lib/debug.lib.php
index 2aac6d9d..365b3e11 100644
--- a/lib/debug.lib.php
+++ b/lib/debug.lib.php
@@ -196,6 +196,41 @@ function check_config_values($conf) {
} // check_config_values
/**
+ * check_php_memory
+ * This checks to make sure that the php memory limit is withing the
+ * recommended range, this doesn't take into account the size of your
+ * catalog.
+ */
+function check_php_memory() {
+
+ $current = ini_get('memory_limit');
+ $current = substr($current_memory,0,strlen($current_memory)-1);
+
+ if (intval($current) < 48) {
+ return false;
+ }
+
+ return true;
+
+} // check_php_memory
+
+/**
+ * check_php_timelimit
+ * This checks to make sure that the php timelimit is set to some
+ * semi-sane limit, IE greater then 30 seconds
+ */
+function check_php_timelimit() {
+
+ $current = ini_get('max_execution_time');
+ if (intval($current) < 60) {
+ return false;
+ }
+
+ return true;
+
+} // check_php_timelimit
+
+/**
* check_putenv
* This checks to see if we can manually set the
* memory limit, and other putenvs we need for
@@ -226,6 +261,12 @@ function check_putenv() {
}
// See if we can override the set_time_limit();
+ $current = ini_get('max_execution_time');
+ set_time_limit($current+60);
+
+ if ($current == ini_get('max_execution_time')) {
+ return false;
+ }
return true;
diff --git a/templates/show_install.inc.php b/templates/show_install.inc.php
index 9465ca3f..5a41ab93 100644
--- a/templates/show_install.inc.php
+++ b/templates/show_install.inc.php
@@ -19,7 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
if (INSTALL != '1') { exit; }
-$prefix = dirname(__FILE__);
+$prefix = realpath(dirname(__FILE__). "/../");
$dir = is_rtl($htmllang) ? 'rtl' : 'ltr';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -47,7 +47,7 @@ $dir = is_rtl($htmllang) ? 'rtl' : 'ltr';
<li><?php echo sprintf(_("Your webserver has read access to the %s file and the %s file"),$prefix . '/sql/ampache.sql',$prefix . '/config/ampache.cfg.dist'); ?></li>
</ul>
<p>
-<?php echo _("Once you have ensured that you have the above requirements please fill out the information below. You will only be asked for the required config values. If you would like to make changes to your ampache install at a later date simply edit /config/ampache.cfg.php"); ?>
+<?php echo sprintf(_('Once you have ensured that you have the above requirements please fill out the information below. You will only be asked for the required config values. If you would like to make changes to your ampache install at a later date simply edit %s'),$prefix . '/config/ampache.cfg.php'); ?>
</p>
</div>
@@ -104,10 +104,8 @@ $dir = is_rtl($htmllang) ? 'rtl' : 'ltr';
<td>&nbsp;</td>
<td><input type="submit" value="<?php echo _("Insert Database"); ?>" /></td>
</tr>
-
- </table>
- </form>
-
+</table>
+</form>
</div>
<div id="bottom">
<p><strong>Ampache Installation.</strong><br />
diff --git a/templates/show_install_account.inc.php b/templates/show_install_account.inc.php
index 8f51a714..4384b36c 100644
--- a/templates/show_install_account.inc.php
+++ b/templates/show_install_account.inc.php
@@ -20,7 +20,7 @@
*/
if (INSTALL != '1') { exit; }
-$prefix = dirname(__FILE__);
+$prefix = realpath(dirname(__FILE__). "/../");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo $htmllang; ?>">
diff --git a/templates/show_install_check.inc.php b/templates/show_install_check.inc.php
index 5567ca59..630b7043 100644
--- a/templates/show_install_check.inc.php
+++ b/templates/show_install_check.inc.php
@@ -134,5 +134,30 @@
}
?>
</td>
+</tr><tr>
+<td><?php echo _('PHP Memory Limit'); ?>:</td>
+<td>
+<?php
+ if (!check_php_memory()) {
+ echo debug_result(_('Memory Limit less then recommended size') . ' ' . ini_get('memory_limit'),false);
+ }
+ else {
+ echo debug_result(ini_get('memory_limit'),true);
+ }
+
+?>
+</td>
+</tr><tr>
+<td><?php echo _('PHP Execution timelimit'); ?>:</td>
+<td>
+<?php
+ if (!check_php_timelimit()) {
+ echo debug_result(_('Execution timelimit less the recommended') . ' ' . ini_get('max_execution_time'),false);
+ }
+ else {
+ echo debug_result(ini_get('max_execution_time') . ' ' . _('seconds'),true);
+ }
+?>
+</td>
</tr>
</table>
diff --git a/templates/show_install_config.inc.php b/templates/show_install_config.inc.php
index 383591e2..274deac2 100644
--- a/templates/show_install_config.inc.php
+++ b/templates/show_install_config.inc.php
@@ -20,7 +20,7 @@
*/
if (INSTALL != '1') { exit; }
-$prefix = dirname(__FILE__);
+$prefix = realpath(dirname(__FILE__). "/../");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $htmllang; ?>" lang="<?php echo $htmllang; ?>">
@@ -44,14 +44,14 @@ $prefix = dirname(__FILE__);
<li><?php echo sprintf(_("Your webserver has read access to the %s file and the %s file"),$prefix . '/sql/ampache.sql',$prefix . '/config/ampache.cfg.dist'); ?></li>
</ul>
- <?php echo _("Once you have ensured that you have the above requirements please fill out the information below. You will only be asked for the required config values. If you would like to make changes to your ampache install at a later date simply edit /config/ampache.cfg.php"); ?>
+ <?php echo sprintf(_('Once you have ensured that you have the above requirements please fill out the information below. You will only be asked for the required config values. If you would like to make changes to your ampache install at a later date simply edit %s'),$prefix . '/config/ampache.cfg.php'); ?>
</div>
<div class="content">
<?php echo _("Step 1 - Creating and Inserting the Ampache Database"); ?><br />
<strong><?php echo _("Step 2 - Creating the Ampache.cfg.php file"); ?></strong><br />
<dl>
- <dd><?php echo _("This steps takes the basic config values and generates the config file. It will prompt you to download the config file. Please put the downloaded config file in /config"); ?></dd>
+ <dd><?php echo _('This steps takes the basic config values and generates the config file. It will prompt you to download the config file. Please put the downloaded config file in %s'),$prefix . '/config'); ?></dd>
</dl>
<?php echo _("Step 3 - Setup Initial Account"); ?><br />
<?php Error::display('general'); ?>
diff --git a/templates/show_install_lang.inc.php b/templates/show_install_lang.inc.php
index c893ad15..a0f57d52 100644
--- a/templates/show_install_lang.inc.php
+++ b/templates/show_install_lang.inc.php
@@ -18,7 +18,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-$prefix = dirname(__FILE__);
+$prefix = realpath(dirname(__FILE__). "/../");
?>
<?php if (INSTALL != '1') { exit; } ?>
<?php $results = 0; ?>
@@ -43,10 +43,10 @@ $prefix = dirname(__FILE__);
</p>
<ul>
<li><?php echo _('A MySQL Server with a username and password that can create/modify databases'); ?></li>
- <li><?php echo sprintf(_("Your webserver has read access to the %s file and the %s file"),$prefix . '/sql/ampache.sql',$prefix . '/config/ampache.cfg.dist'); ?></li>
+ <li><?php echo sprintf(_("Your webserver has read access to the %s file and the %s file"),$prefix . '/sql/ampache.sql',$prefix . '/config/ampache.cfg.php.dist'); ?></li>
</ul>
<p>
-<?php echo _("Once you have ensured that you have the above requirements please fill out the information below. You will only be asked for the required config values. If you would like to make changes to your ampache install at a later date simply edit /config/ampache.cfg.php"); ?>
+<?php echo sprintf(_("Once you have ensured that you have the above requirements please fill out the information below. You will only be asked for the required config values. If you would like to make changes to your ampache install at a later date simply edit %s"),$prefix . '/config/ampache.cfg.php.dist'); ?>
</p>
<?php require_once 'templates/show_install_check.inc.php'; ?>
</div>