I want to have one file where I can check which version is installed. This is a PHP program so you can view files. I was wondering if there was a standard place to host it, since in the Zend Framework or HTMLpurifier I can’t find the version number at all.
I would also like to add it to the Zend Framework and HTMLPurifier if there is no standard location, so I always know which version is installed. The need to update a txt file would be another alternative.
EDIT: We are thinking about using PHPundercontrol in the very near future, but why should it update the Zend Frameworks number? How do I know that I have downloaded a new version?
I found him..
in the Zend Framework they have the file Zend / Version.php -> Zend_Version, this file also has a version number inside it:
const VERSION = '1.7.5';
In HTMLPurifier, it is in HTMLPurifier / HTMLPurifier.php
/** Version of HTML Purifier */ public $version = '3.3.0'; /** Constant with version of HTML Purifier */ const VERSION = '3.3.0';
I think for me I will add a version to the configuration file.
I would go with a text file option, not in code.
If you do this, as your project progresses, you will be able to update other tools that you may or may not use in your project (for example: phpunderconstrol or a deployment system) to be able to install / update this number without risking these files relating to the real code and potentially cause errors.
, , , - - !
, PHPDoc:
/** * ... * @version 1.2.3 */
const VERSION , PHP 5.3 , . , . , , .
const VERSION
:
index.php
include_once "libA.php" if(needsB) include_once "libB.php" ... print(VERSION)
libB.php
const VERSION='1.2.3' ... if(needsC) include_once "libC.php"
, VERSION , libA, libB libC.
VERSION
, , , . , MySQL HASH, .
PHP , , .
// this is a guess of the var names by me btw MAJOR_VERSION = 5 MINOR_VERSION = 2 FIX_VERSION = 6
By storing version information as ints, you can determine the difference between version numbers.
Source: https://habr.com/ru/post/1705146/More articles:Setting Substr to longer string length - phpSQL-запрос - как эффективно получать нечитаемые сообщения - sqlКак изменить этот дизайн, чтобы избежать понижения? - c#Question about CCR and WCF integration - wcfManage unregistered user messages by screening - registrationUsing CCR with ASynchronous WCF Service - asynchronousIs there a preference for one match in Regex when matching matches? - c #Is there any way to set variables in ssh? - mysqlHelp my users find the installer on the CD - installerOrder with the Collate OfferAll Articles