johnsneakers
V2EX  ›  问与答

你们的客户端和服务端版本号是如何管理的

  •  
  •   johnsneakers · Sep 3, 2016 · 1772 views
    This topic created in 3537 days ago, the information mentioned may be changed or developed.

    上烂代码:

        `if(client_version > 1.0.0 || client_version < 1.0.7) {
            $conf = 'a.inc.json';
        } elseif (client_version >= 1.0.7) {
            $conf = 'a.inc.new.json';
        } else {
            $conf = 'a.inc.new.new.json';
        }`
    

    很无语的"配置管理",每次改了业务代码,需要找客户端要版本号,加一个 elseif 。想问问有没有好的方案。

    2 replies    2016-09-04 12:40:06 +08:00
    akira
        1
    akira  
       Sep 3, 2016
    conf = client_version + '/a.inc.json';
    conf = a.inc.json?v=client_version;
    smilekung
        2
    smilekung  
       Sep 4, 2016
    做个专门的配置管理服务咯
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5644 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 07:21 · PVG 15:21 · LAX 00:21 · JFK 03:21
    ♥ Do have faith in what you're doing.