modified README for build scripts

This commit is contained in:
Jenny Tam 2017-08-16 16:09:11 -07:00
parent 791f95c6c0
commit 6ccbe99060
2 changed files with 11 additions and 13 deletions

View file

@ -69,7 +69,7 @@ It's recommended that the PHP SDK is unzipped into the shortest possible path, p
* `py builddrivers.py -v=7.1.7 -a=x86 -t=ts -d=all -g=no`
* `py builddrivers.py --PHPVER=7.0.22 --ARCH=x64 --THREAD=nts --DRIVER=sqlsrv --GITHUB=yes`
5. If the script detects the presence of a PHP source directory, you will be prompted whether to rebuild, clean or superclean. Choose
5. Based on the given configuration, if the script detects the presence of the PHP source directory, you can choose whether to rebuild, clean or superclean:
* `rebuild` if you have always used the same configuration (32 bit, thread safe, etc.)
* `clean` to remove previous builds (binaries)
* `superclean` to remove the entire `php-<version>-src` directory, which is often unnecessary
@ -84,13 +84,11 @@ When something goes wrong during the build, the log file will be launched (you c
In addition to the log files in `C:\php-sdk`, you can examine the contents of `C:\php-sdk\phpsdk-build-task.bat`, which is overwritten every time you run the build scripts.
#### Building the extensions unattended
#### Variation
You can invoke `py builddrivers.py` with the desired options plus the destination path `--DESTPATH=<some valid path>`.
If you want the PHP drivers to be copied to somewhere else, you can invoke `py builddrivers.py` by providing the option `--DESTPATH=<some valid path>`.
In such case, the `php-sdk` folder will be created in the same directory of these build scripts. Note that the PHP drivers will also be copied to the designated path.
The script `builddrivers.py` provides an example for this case. Again, it's your choice whether to remove the `php-sdk` folder afterwards.
In this case, you will find a copy of the drivers (unless the build fails) and the `php-sdk` folder created in the same directory of these Python scripts. It's your choice whether to remove the `php-sdk` folder and/or the drivers' binaries afterwards.

View file

@ -197,7 +197,7 @@ class BuildDriver(object):
# Only ask when building locally
if self.local:
choice = input("Rebuild the same configuration(yes) or quit (no) [yes/no]: ")
choice = input("Rebuild using the same configuration(yes) or quit (no) [yes/no]: ")
if choice.lower() == 'yes' or choice.lower() == 'y' or choice.lower() == '':
print('Rebuilding drivers...')
@ -230,12 +230,12 @@ if __name__ == '__main__':
parser.add_argument('-v', '--PHPVER', help="PHP version, e.g. 7.1.*, 7.2.* etc.")
parser.add_argument('-a', '--ARCH', choices=['x64', 'x86'])
parser.add_argument('-t', '--THREAD', choices=['nts', 'ts'])
parser.add_argument('-d', '--DRIVER', choices=['all', 'sqlsrv', 'pdo_sqlsrv'])
parser.add_argument('-m', '--DEBUG', default='no', choices=['yes', 'no'], help="enable debug mode")
parser.add_argument('-r', '--REPO', default='Microsoft', help="GitHub repository")
parser.add_argument('-b', '--BRANCH', default='dev', help="GitHub repository branch")
parser.add_argument('-g', '--GITHUB', default='yes', help="get source from GitHub or not")
parser.add_argument('-p', '--DESTPATH', default=None, help="the remote destination for the drivers (do not use this for local builds)")
parser.add_argument('-d', '--DRIVER', default='all', choices=['all', 'sqlsrv', 'pdo_sqlsrv'], help="driver to build (default: all)")
parser.add_argument('-m', '--DEBUG', default='no', choices=['yes', 'no'], help="enable debug mode (default: no)")
parser.add_argument('-r', '--REPO', default='Microsoft', help="GitHub repository (default: Microsoft)")
parser.add_argument('-b', '--BRANCH', default='dev', help="GitHub repository branch (default: dev)")
parser.add_argument('-g', '--GITHUB', default='yes', choices=['yes', 'no'], help="get source from GitHub (default: yes)")
parser.add_argument('-p', '--DESTPATH', default=None, help="the remote destination for the drivers (default: None)")
args = parser.parse_args()