There is no problem not worth solving, and no technology not worth learning!

In PHP 7.4, the script files in the directory are executed one by one based on the directory name of the semantic version (when the directory name does not meet the specification)

现在有需求不再使用语义化版本做为目录名称。当目录名称不可控时,可能会出现目录列表如下:custom_mobile_layout_2、p333、v1_33、v2.0.20、v2.0.21、v2.0.28、v2.1.1、v2.1.2、v2.1.3、v2.1.30、v2.1.65、v2.1.70、v2.1.90、v12.4.iuu、v324、wu_us6、zus.4m_m4bile_l4ut_2

1. Reference:In PHP 7.4, the script files in the directory are executed one by one based on the directory name of the semantic version

2. Now there is a need to no longer use semantic versions as directory names. When the directory name is out of control, the directory list may appear as follows: CUSTOM_MOBILE_LAYOUT_2 , p333, v1_33, v2.0.20, v2.0.21, v2.0.28, v2.1.1, v 2.1.2, v2.1.3, v2.1.30, v2.1.65, v2.1.70, v2.1.90 , v12.4.IUU, V324, Wu_us6, zus.4m_m4bile_l4ut_2. as shown in Figure 1

现在有需求不再使用语义化版本做为目录名称。当目录名称不可控时,可能会出现目录列表如下:custom_mobile_layout_2、p333、v1_33、v2.0.20、v2.0.21、v2.0.28、v2.1.1、v2.1.2、v2.1.3、v2.1.30、v2.1.65、v2.1.70、v2.1.90、v12.4.iuu、v324、wu_us6、zus.4m_m4bile_l4ut_2
Figure 1

3. Filter out the results of the directory after the final sorting is less than or equal to v2.1.66, and it is expected that the directories that do not meet the specification will be excluded, and only the vx.x.

 


[2023-07-05 10:37:19] local.INFO: availableVersions [
    {
        "Modules\\ThemeStoreDb\\ThemeSetting\\ThemeVersion": {
            "version": "custom_mobile_layout_2"
        }
    },
    {
        "Modules\\ThemeStoreDb\\ThemeSetting\\ThemeVersion": {
            "version": "wu_us6"
        }
    },
    {
        "Modules\\ThemeStoreDb\\ThemeSetting\\ThemeVersion": {
            "version": "v1_33"
        }
    },
    {
        "Modules\\ThemeStoreDb\\ThemeSetting\\ThemeVersion": {
            "version": "v2.0.20"
        }
    },
    {
        "Modules\\ThemeStoreDb\\ThemeSetting\\ThemeVersion": {
            "version": "v2.0.21"
        }
    },
    {
        "Modules\\ThemeStoreDb\\ThemeSetting\\ThemeVersion": {
            "version": "v2.0.28"
        }
    },
    {
        "Modules\\ThemeStoreDb\\ThemeSetting\\ThemeVersion": {
            "version": "v2.1.1"
        }
    },
    {
        "Modules\\ThemeStoreDb\\ThemeSetting\\ThemeVersion": {
            "version": "v2.1.2"
        }
    },
    {
        "Modules\\ThemeStoreDb\\ThemeSetting\\ThemeVersion": {
            "version": "v2.1.3"
        }
    },
    {
        "Modules\\ThemeStoreDb\\ThemeSetting\\ThemeVersion": {
            "version": "v2.1.30"
        }
    },
    {
        "Modules\\ThemeStoreDb\\ThemeSetting\\ThemeVersion": {
            "version": "v2.1.65"
        }
    }
] 


4. Even if the directory name is finally determined, even if the semantic version is not used, there is still a certain rule to determine its order of size. Refer to Laravel’s database migration design. The directory name is adjusted to the following format: {yy_mm_dd_h}_{property name}. The list of directories is as follows: v2.0.20, v2.0.21, v2.0.28, v2.1.1, v2.1.2, v2.1.3, v2.1.30, v2.1.65, v2.1.70, v2.1.90, 2023_07_05_16_feature1, 2023_07_05_17_feature2, 2023_07_06_17_feature3. When judging the order, it is processed based on whether the prefix v exists (not required at the end, because the version number starting with {yy_mm_dd_h}_ is always greater than the version number starting with v).

Need long-term technical maintenance or remote troubleshooting?

I am a PHP / Go backend engineer with 15+ years of experience, focused on existing system maintenance, bug fixing, performance optimization, server troubleshooting, WordPress maintenance, and small feature iterations.

If your project is facing any of the following issues, we can start with a small troubleshooting task first:

  • ✅ PHP / Laravel / Yii2 legacy systems without active maintenance
  • ✅ Go / Gin backend APIs that need troubleshooting or optimization
  • ✅ Slow, broken, or unstable WordPress websites
  • ✅ Nginx / MySQL / Redis / Linux server issues
  • ✅ CDN / Cloudflare / DNS / HTTPS configuration problems
  • ✅ Long-term remote technical support or part-time maintenance

More details: About Me & Collaboration

WeChat: 13980074657
Email: shuijingwanwq@gmail.com
Telegram: @shuijingwan
GitHub: https://github.com/shuijingwan

评论

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.