Permalink
Browse files

Allow execution without qcodo build directory

  • Loading branch information...
mikeho committed Dec 8, 2009
1 parent 104979d commit b8727282282061556aad25cbb19725e28bb6dae6
Showing with 62 additions and 44 deletions.
  1. +10 −5 includes/QApplication.class.php
  2. +48 −39 www/downloads/index.tpl.php
  3. +4 −0 www/index.tpl.php
@@ -404,10 +404,13 @@ public static function DisplayWithWikiLinks($strContent) {
}
public static function GetQcodoVersion($blnStableVersion = true) {
- if ($blnStableVersion)
+ if ($blnStableVersion) {
+ if (!file_exists(__QCODO_BUILDS__ . '/STABLE')) return null;
return trim(file_get_contents(__QCODO_BUILDS__ . '/STABLE'));
- else
+ } else {
+ if (!file_exists(__QCODO_BUILDS__ . '/DEVELOPMENT')) return null;
return trim(file_get_contents(__QCODO_BUILDS__ . '/DEVELOPMENT'));
+ }
}
public static function GetQcodoChangelog() {
@@ -419,16 +422,18 @@ public static function GetQcodoChangelog() {
*/
public static function GetQcodoVersionDate($blnStableVersion = true) {
$strVersion = QApplication::GetQcodoVersion($blnStableVersion);
- return QDateTime::FromTimestamp(filemtime(__QCODO_BUILDS__ . '/qcodo-' . $strVersion . '.tar.gz'));
+ if ($strVersion) return QDateTime::FromTimestamp(filemtime(__QCODO_BUILDS__ . '/qcodo-' . $strVersion . '.tar.gz'));
}
/**
* @return string
*/
public static function GetQcodoVersionSize($blnStableVersion = true, $blnTarGz = true) {
$strVersion = QApplication::GetQcodoVersion($blnStableVersion);
- $strExtension = ($blnTarGz) ? '.tar.gz' : '.zip';
- return QApplication::DisplayByteSize(filesize(__QCODO_BUILDS__ . '/qcodo-' . $strVersion . $strExtension));
+ if ($strVersion) {
+ $strExtension = ($blnTarGz) ? '.tar.gz' : '.zip';
+ return QApplication::DisplayByteSize(filesize(__QCODO_BUILDS__ . '/qcodo-' . $strVersion . $strExtension));
+ }
}
}
?>
@@ -27,55 +27,64 @@
</div>
<h1 style="margin-top: 24px;">Current Stable Version</h1>
- <h3>
- version: <strong><?php _p($strStableVersion); ?></strong>
- &nbsp;|&nbsp;
- released: <strong><?php _p($dttStableDate->__toString(QDateTime::FormatDisplayDateTimeFull)); ?></strong>
- </h3>
-
- <div style="margin-left: 25px; margin-top: 12px; font-size: 18px;">
- <strong><a href="/downloads/get.php/release_stable_targz/qcodo-<?php _p($strStableVersion); ?>.tar.gz" class="link">qcodo-<?php _p($strStableVersion); ?>.tar.gz</a></strong>
+<?php if (QApplication::GetQcodoVersion(true)) { ?>
<h3>
- type: <strong>Mac OS X, Linux, and Unix Tarball</strong>
+ version: <strong><?php _p($strStableVersion); ?></strong>
&nbsp;|&nbsp;
- size: <strong><?php _p($strStableSizeTarGz) ?></strong>
+ released: <strong><?php _p($dttStableDate->__toString(QDateTime::FormatDisplayDateTimeFull)); ?></strong>
</h3>
- </div>
+
+ <div style="margin-left: 25px; margin-top: 12px; font-size: 18px;">
+ <strong><a href="/downloads/get.php/release_stable_targz/qcodo-<?php _p($strStableVersion); ?>.tar.gz" class="link">qcodo-<?php _p($strStableVersion); ?>.tar.gz</a></strong>
+ <h3>
+ type: <strong>Mac OS X, Linux, and Unix Tarball</strong>
+ &nbsp;|&nbsp;
+ size: <strong><?php _p($strStableSizeTarGz) ?></strong>
+ </h3>
+ </div>
+
+ <div style="margin-left: 25px; margin-top: 12px; font-size: 18px;">
+ <strong><a href="/downloads/get.php/release_stable_zip/qcodo-<?php _p($strStableVersion); ?>.zip" class="link">qcodo-<?php _p($strStableVersion); ?>.zip</a></strong>
+ <h3>
+ type: <strong>Windows ZIP</strong>
+ &nbsp;|&nbsp;
+ size: <strong><?php _p($strStableSizeZip) ?></strong>
+ </h3>
+ </div>
+<?php } else { ?>
+ <p>Currently performing a Qcodo build...</p>
+<?php } ?>
- <div style="margin-left: 25px; margin-top: 12px; font-size: 18px;">
- <strong><a href="/downloads/get.php/release_stable_zip/qcodo-<?php _p($strStableVersion); ?>.zip" class="link">qcodo-<?php _p($strStableVersion); ?>.zip</a></strong>
- <h3>
- type: <strong>Windows ZIP</strong>
- &nbsp;|&nbsp;
- size: <strong><?php _p($strStableSizeZip) ?></strong>
- </h3>
- </div>
<h1 style="margin-top: 24px;">Current Development Version</h1>
- <h3>
- version: <strong><?php _p($strDevVersion); ?></strong>
- &nbsp;|&nbsp;
- released: <strong><?php _p($dttDevDate->__toString(QDateTime::FormatDisplayDateTimeFull)); ?></strong>
- </h3>
-
- <div style="margin-left: 25px; margin-top: 12px; font-size: 18px;">
- <strong><a href="/downloads/get.php/release_dev_targz/qcodo-<?php _p($strDevVersion); ?>.tar.gz" class="link">qcodo-<?php _p($strDevVersion); ?>.tar.gz</a></strong>
+<?php if (QApplication::GetQcodoVersion(false)) { ?>
<h3>
- type: <strong>Mac OS X, Linux, and Unix Tarball</strong>
+ version: <strong><?php _p($strDevVersion); ?></strong>
&nbsp;|&nbsp;
- size: <strong><?php _p($strDevSizeTarGz) ?></strong>
+ released: <strong><?php _p($dttDevDate->__toString(QDateTime::FormatDisplayDateTimeFull)); ?></strong>
</h3>
- </div>
-
- <div style="margin-left: 25px; margin-top: 12px; font-size: 18px;">
- <strong><a href="/downloads/get.php/release_dev_zip/qcodo-<?php _p($strDevVersion); ?>.zip" class="link">qcodo-<?php _p($strDevVersion); ?>.zip</a></strong>
- <h3>
- type: <strong>Windows ZIP</strong>
- &nbsp;|&nbsp;
- size: <strong><?php _p($strDevSizeZip) ?></strong>
- </h3>
- </div>
+
+ <div style="margin-left: 25px; margin-top: 12px; font-size: 18px;">
+ <strong><a href="/downloads/get.php/release_dev_targz/qcodo-<?php _p($strDevVersion); ?>.tar.gz" class="link">qcodo-<?php _p($strDevVersion); ?>.tar.gz</a></strong>
+ <h3>
+ type: <strong>Mac OS X, Linux, and Unix Tarball</strong>
+ &nbsp;|&nbsp;
+ size: <strong><?php _p($strDevSizeTarGz) ?></strong>
+ </h3>
+ </div>
+
+ <div style="margin-left: 25px; margin-top: 12px; font-size: 18px;">
+ <strong><a href="/downloads/get.php/release_dev_zip/qcodo-<?php _p($strDevVersion); ?>.zip" class="link">qcodo-<?php _p($strDevVersion); ?>.zip</a></strong>
+ <h3>
+ type: <strong>Windows ZIP</strong>
+ &nbsp;|&nbsp;
+ size: <strong><?php _p($strDevSizeZip) ?></strong>
+ </h3>
+ </div>
+<?php } else { ?>
+ <p>Currently performing a Qcodo build...</p>
+<?php } ?>
<h1 style="margin-top: 24px;">Older Qcodo Releases</h1>
View
@@ -18,8 +18,12 @@
<br/>
<h1>Qcodo Release Information</h1>
<div class="sbContent">
+<?php if (QApplication::GetQcodoVersion(false)) { ?>
<p><strong>Current Dev Release</strong><br/><a href="/downloads/">Qcodo v<?php _p(QApplication::GetQcodoVersion(false)); ?></a><br/><?php _p(QApplication::GetQcodoVersionDate(false)->__toString('DDDD, MMMM D, YYYY')); ?></p>
<p><strong>Current Stable Release</strong><br/><a href="/downloads/">Qcodo v<?php _p(QApplication::GetQcodoVersion(true)); ?></a><br/><?php _p(QApplication::GetQcodoVersionDate(true)->__toString('DDDD, MMMM D, YYYY')); ?></p>
+<?php } else { ?>
+ <p>Currently performing a Qcodo build...</p>
+<?php } ?>
</div>
<br/>
<h1>Qcodo Development Information</h1>

0 comments on commit b872728

Please sign in to comment.