Automatically generate upgrade package git
The author wants to make a tool that can quickly find all changed files from the directory under git control and form an upgrade package to facilitate the upgrade work on the server.
(We need to copy the upgrade package to the server and directly overwrite the contents of the upgrade package to complete the upgrade)
In the past, this upgrade package was always created manually, which was very troublesome, especially if the files were scattered. .
General idea:
1. You can use git diff --name-only to get a list (only the list of files that have not been committed is displayed here)
crontabs/php/create_data_into_sku_flowtype_storage.php
crontabs/php/crontab_script_base_import_to_db.php
This list It contains all newly created or modified directories and files, just follow this list to "grab the medicine"
2. According to the information prompted in this file, decompose it line by line and get the corresponding path
crontabs/php/create_data_into_sku_flowtype_storage .php
Then, determine whether the parent path (crontabs/php/) specified by this information exists.
If it does not exist, create it one by one.
Then determine whether this is a directory. If so, add the corresponding directory to the target path (do not copy).
If it is not a directory (it is a file), then copy it.
Be careful not to copy the directory.
In addition, you can use git log --oneline to view the history
Reference:
Chen Jiebin, "git extracts the difference files between two versions and packages them", 2013-09-11, http://www.01happy.com /git-extract-different-files/
The above has introduced the automatic generation of the upgrade package git, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Running the H5 project requires the following steps: installing necessary tools such as web server, Node.js, development tools, etc. Build a development environment, create project folders, initialize projects, and write code. Start the development server and run the command using the command line. Preview the project in your browser and enter the development server URL. Publish projects, optimize code, deploy projects, and set up web server configuration.

In PHP8, match expressions are a new control structure that returns different results based on the value of the expression. 1) It is similar to a switch statement, but returns a value instead of an execution statement block. 2) The match expression is strictly compared (===), which improves security. 3) It avoids possible break omissions in switch statements and enhances the simplicity and readability of the code.

The H5 page needs to be maintained continuously, because of factors such as code vulnerabilities, browser compatibility, performance optimization, security updates and user experience improvements. Effective maintenance methods include establishing a complete testing system, using version control tools, regularly monitoring page performance, collecting user feedback and formulating maintenance plans.

In PHP, you can effectively prevent CSRF attacks by using unpredictable tokens. Specific methods include: 1. Generate and embed CSRF tokens in the form; 2. Verify the validity of the token when processing the request.

In PHP, the final keyword is used to prevent classes from being inherited and methods being overwritten. 1) When marking the class as final, the class cannot be inherited. 2) When marking the method as final, the method cannot be rewritten by the subclass. Using final keywords ensures the stability and security of your code.

The... (splat) operator in PHP is used to unpack function parameters and arrays, improving code simplicity and efficiency. 1) Function parameter unpacking: Pass the array element as a parameter to the function. 2) Array unpacking: Unpack an array into another array or as a function parameter.

Strict types in PHP are enabled by adding declare(strict_types=1); at the top of the file. 1) It forces type checking of function parameters and return values to prevent implicit type conversion. 2) Using strict types can improve the reliability and predictability of the code, reduce bugs, and improve maintainability and readability.

It is feasible to self-study H5 page production, but it is not a quick success. It requires mastering HTML, CSS, and JavaScript, involving design, front-end development, and back-end interaction logic. Practice is the key, and learn by completing tutorials, reviewing materials, and participating in open source projects. Performance optimization is also important, requiring optimization of images, reducing HTTP requests and using appropriate frameworks. The road to self-study is long and requires continuous learning and communication.
