Skip to content

Commit

Permalink
Allow execution without qcodo build directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeho committed Dec 8, 2009
1 parent 104979d commit b872728
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 44 deletions.
15 changes: 10 additions & 5 deletions includes/QApplication.class.php
Expand Up @@ -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() {
Expand All @@ -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));
}
}
}
?>
87 changes: 48 additions & 39 deletions www/downloads/index.tpl.php
Expand Up @@ -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>
Expand Down
4 changes: 4 additions & 0 deletions www/index.tpl.php
Expand Up @@ -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>
Expand Down

0 comments on commit b872728

Please sign in to comment.