Page 1 of 1

PHP Version Display Code

PostPosted: Wed Feb 24, 2016 4:37 pm
by kbjackson
I have very little knowledge of PHP code but I am using a modified version of the build.php file that is used in the sample SC file.

if (isset($_GET['build']) && $_GET['build'] != "") {
$build = $_GET['build'];

It appears that the 'build' variable being pulled from the SC app is formatted to something like 4.29 which is in a table in the app.

Everything is working as it should except that I want to display a longer version number like 4.29.01. I changed the build number to this format within the table but have to use quotes - "4.29.01" to make the calculation work.

The .php script does pick up the number but still displays 4.29 and not 4.29.01.

Any idea how to make this work?

Thanks. Ken

Re: PHP Version Display Code

PostPosted: Wed Feb 24, 2016 5:05 pm
by kbjackson
Never mind. I think I will just go with a number friendly version label like 5.12. That will work without quotes or anything special and give me enough room to track changes often enough. Lots of room until I hit 6.00. In my change log I will simply use 5.1.2 and so on.

This makes things simple to understand and gives plenty of room to grow to the next major build.

Looks great in the app as well.

Thanks. Ken

Re: PHP Version Display Code

PostPosted: Thu Feb 25, 2016 10:08 am
by DanW
Sounds great, Ken.

Yes, the php file is comparing numbers when checking whether the version is current or not. So, the additional characters from the second decimal on get dropped. I agree that using the number friendly version label is your best option here. Glad this has worked for you!

All the best,