Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
Merged PGO integration branch
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 0b963bf
Merge: b0b5b9c 1684c7e
Author: Anatol Belski <ab@php.net>
Date:   Fri Nov 17 15:11:22 2017 +0100

    Merge branch 'master' into pgo_integration

    * master:
      Back to dev
      Prepare 2.0.13
      Upgrade vswhere
      Upgrade bundled PHP
      Unset some tmp vars
      Note on unattended build
      Check for Windows SDK 10.0 for VC14, too
      Pass nologo to vcvarsall.bat
      Unify EOL
      Ensure starter scripts keep the current directory
      Update version in readme
      Add comment
      Fix curl error handling

commit b0b5b9c
Author: Anatol Belski <ab@php.net>
Date:   Mon Oct 30 14:58:33 2017 +0100

    Warn if a job file is not present, maybe SDK needs reinit

commit d84a2e8
Author: Anatol Belski <ab@php.net>
Date:   Mon Oct 30 07:39:33 2017 +0100

    Add --scenario to the help

commit 9556fad
Author: Anatol Belski <ab@php.net>
Date:   Sat Oct 28 18:22:31 2017 +0200

    Add scenario based on https://github.com/01org/php_pgo_training_scripts

commit c4e32bb
Merge: 11dcbc8 1ba1bf1
Author: Anatol Belski <ab@php.net>
Date:   Thu Oct 26 19:32:24 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      Back to dev
      Prepare 2.0.12
      Reflect re2c version
      Note about fetching
      Add note about UNIX flavors
      Reflect bison version
      Rephrase
      Back to dev
      Prepare beta3
      Rebase MSYS2 DLLs
      Turn back to dev
      Prepare 2.0.12beta2
      Add missing DLLs
      Back to dev
      Prepare 2.0.12beta1
      Upgrade vswhere
      Upgrade msys2 tools
      Back to dev
      2.0.11

commit 11dcbc8
Author: Anatol Belski <ab@php.net>
Date:   Fri Sep 15 11:23:34 2017 +0200

    Add locking to the PGO training and init actions

commit aca33a7
Merge: bcb8fcf c7c874e
Author: Anatol Belski <ab@php.net>
Date:   Fri Sep 15 10:48:06 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      Improve messaging for locked dependency path

commit bcb8fcf
Merge: d86027f 97112e4
Author: Anatol Belski <ab@php.net>
Date:   Fri Sep 15 10:36:50 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      Refactor lock also wrt shared/exclusive
      Folds

commit d86027f
Merge: 253d590 a5afa11
Author: Anatol Belski <ab@php.net>
Date:   Fri Sep 15 09:22:41 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      Integrate locking into the dep update process
      Fix and improve lock class
      Add locker class
      Lock while caching
      Folds

commit 253d590
Merge: ea6d9d9 d802183
Author: Anatol Belski <ab@php.net>
Date:   Tue Sep 5 18:28:01 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      Adjust description
      Support branch recognition when working under dev package

commit ea6d9d9
Author: Anatol Belski <ab@php.net>
Date:   Fri Sep 1 16:47:06 2017 +0200

    Increase runs number

commit 157af24
Author: Anatol Belski <ab@php.net>
Date:   Fri Sep 1 14:19:07 2017 +0200

    Prepare some debug piece

commit 74ce6dd
Author: Anatol Belski <ab@php.net>
Date:   Fri Sep 1 14:10:03 2017 +0200

    More for error logging

commit d17b002
Merge: 30dc3ff a97d0bd
Author: Anatol Belski <ab@php.net>
Date:   Fri Sep 1 15:57:21 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      Fix Arch determintion
      Add pretty option
      Rework dllmap script
      Note pwgen presence

commit 30dc3ff
Author: Anatol Belski <ab@php.net>
Date:   Mon Aug 28 14:18:41 2017 +0200

    Fix binary path

commit e1f2d9c
Author: Anatol Belski <ab@php.net>
Date:   Mon Aug 28 14:10:01 2017 +0200

    Extend the firewall template

commit 7cab276
Author: Anatol Belski <ab@php.net>
Date:   Mon Aug 28 13:40:57 2017 +0200

    Fix syntax error

commit 74760b1
Author: Anatol Belski <ab@php.net>
Date:   Mon Aug 28 13:39:31 2017 +0200

    Fix syntax error

commit 9ee0f9f
Author: Anatol Belski <ab@php.net>
Date:   Mon Aug 28 13:37:50 2017 +0200

    Typehints

commit 6a86ff3
Merge: a71e63d de669c7
Author: Anatol Belski <ab@php.net>
Date:   Mon Aug 28 13:08:55 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      Back to dev
      2.0.10

commit a71e63d
Merge: 5021a30 ceececf
Author: Anatol Belski <ab@php.net>
Date:   Mon Aug 28 13:06:12 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      Improve the pack command, show more info and translate the exit code

commit 5021a30
Author: Anatol Belski <ab@php.net>
Date:   Mon Aug 28 12:42:15 2017 +0200

    Add possibility to mark cases inactive

    and turn off the mediawiki case for now.

commit 04f2671
Author: Anatol Belski <ab@php.net>
Date:   Fri Aug 25 11:23:17 2017 +0200

    Rework HTTP code evaluation and URL setup

commit c6c4059
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 24 15:08:00 2017 +0200

    Further INI templating per scenario

commit 9be8f65
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 24 13:34:41 2017 +0200

    Decrease numbers yet more, otherwise it's an issue on 32-bit

    Still need to workout something for 64/32-bit separation

commit 6dfe66d
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 24 13:31:08 2017 +0200

    Fix wrong ini, no Opcache cli

commit c0556fa
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 24 13:25:26 2017 +0200

    Revert numbers and increase timeout

commit dbc86f7
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 24 12:50:20 2017 +0200

    Show the training scenario being used

commit c67a5ee
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 24 12:45:23 2017 +0200

    Don't enable opcache on CLI and adjust some numbers

commit 0ec768c
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 24 10:42:55 2017 +0200

    Set fastcgi_read_timeout

commit 6145b84
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 24 10:30:43 2017 +0200

    Set select timeout

commit 600ea85
Author: Anatol Belski <ab@php.net>
Date:   Wed Aug 23 22:56:28 2017 +0200

    Keep FCGI childer some longer alive

commit f6a95c5
Author: Anatol Belski <ab@php.net>
Date:   Wed Aug 23 22:51:47 2017 +0200

    Exclude most of the extension not directly trained

commit 87f4d73
Author: Anatol Belski <ab@php.net>
Date:   Wed Aug 23 18:36:54 2017 +0200

    Adjust error_log filename

commit e22caae
Author: Anatol Belski <ab@php.net>
Date:   Wed Aug 23 16:48:47 2017 +0200

    Write error log into the build dir

commit 7bd80a6
Merge: acadf54 64c2ac9
Author: Anatol Belski <ab@php.net>
Date:   Wed Aug 23 00:20:01 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      Fix deps path recognition
      add deps package command
      reset errorlevel before tool run, set the current on exit

commit acadf54
Author: Anatol Belski <ab@php.net>
Date:   Tue Aug 22 22:40:12 2017 +0200

    Rework the server up routines a bit

commit 6948d0f
Author: Anatol Belski <ab@php.net>
Date:   Tue Aug 22 17:48:48 2017 +0200

    Increase/add startup timeouts

commit d494d3c
Author: Anatol Belski <ab@php.net>
Date:   Tue Aug 22 14:09:59 2017 +0200

    Add redirect URL to the stats

commit 1172928
Author: Anatol Belski <ab@php.net>
Date:   Tue Aug 22 13:54:33 2017 +0200

    Fix warning

commit ec37bbc
Author: Anatol Belski <ab@php.net>
Date:   Tue Aug 22 13:48:15 2017 +0200

    Improve Mediawiki URL generation

commit 66280db
Author: Anatol Belski <ab@php.net>
Date:   Tue Aug 22 13:41:51 2017 +0200

    Add more info about non 200 codes

commit 2fcab61
Author: Anatol Belski <ab@php.net>
Date:   Tue Aug 22 11:33:36 2017 +0200

    Set error_log = syslog

commit 0ac29c3
Author: Anatol Belski <ab@php.net>
Date:   Tue Aug 22 11:09:44 2017 +0200

    Back to 8 max children

commit 67cced2
Author: Anatol Belski <ab@php.net>
Date:   Sat Aug 19 11:07:46 2017 +0200

    set explicit timeouts

commit 491abac
Author: Anatol Belski <ab@php.net>
Date:   Fri Aug 18 23:43:22 2017 +0200

    Use generated config, if available

commit 2ae0630
Author: Anatol Belski <ab@php.net>
Date:   Fri Aug 18 23:07:01 2017 +0200

    Revert "extend is initialized check"

    This reverts commit f365e53.

commit f365e53
Author: Anatol Belski <ab@php.net>
Date:   Fri Aug 18 12:36:16 2017 +0200

    extend is initialized check

commit 7905dcc
Author: Anatol Belski <ab@php.net>
Date:   Fri Aug 18 10:50:25 2017 +0200

    lower default number of fcgi processes

commit 5df59c3
Author: Anatol Belski <ab@php.net>
Date:   Fri Aug 18 02:59:08 2017 +0200

    some new keys can also be added to the env

commit 5ee2edc
Author: Anatol Belski <ab@php.net>
Date:   Fri Aug 18 00:15:27 2017 +0200

    fix image name

commit b3cadbd
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 23:35:51 2017 +0200

    deactivate joomla training case for now

commit 23baf79
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 22:21:58 2017 +0200

    fix mysql availability for the external tools

commit 77f6519
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 20:25:12 2017 +0200

    fix path separator

commit 63bc4d5
Merge: e4a51d6 eae3aab
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 18:19:40 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      revert the deps path reset part and sync

commit e4a51d6
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 16:35:32 2017 +0200

    should be fixed by the previous commit

commit 77e0b65
Merge: 104f57c e7e92b3
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 16:34:33 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      yet more path recognition variant

commit 104f57c
Merge: aa62653 d158c3c
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 16:19:31 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      add possibility to reevaluate the deps path

commit aa62653
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 16:19:08 2017 +0200

    reevaluate deps path

commit 5b54583
Merge: 295d9ca 69fb69f
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 15:34:07 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      no realpath needed

commit 295d9ca
Merge: c2e9b1d aee165f
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 14:06:43 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      refactor dependency dir recognition

commit c2e9b1d
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 11:19:12 2017 +0200

    rephrase

commit d7f8be2
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 11:14:50 2017 +0200

    some PGO doc

commit 16434a8
Author: Anatol Belski <ab@php.net>
Date:   Thu Aug 17 10:37:45 2017 +0200

    add template script for opening required ports

commit 4aa9cba
Merge: d7f5e8c 0223331
Author: Anatol Belski <ab@php.net>
Date:   Sat Aug 12 14:36:23 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      upgrade vswhere
      extend .gitignore

commit d7f5e8c
Author: Anatol Belski <ab@php.net>
Date:   Wed Aug 9 22:58:34 2017 +0200

    add ready mode for pgo

commit 8b64fb7
Author: Anatol Belski <ab@php.net>
Date:   Mon Aug 7 18:30:19 2017 +0200

    add 7.3 inis

commit 323188a
Merge: e18835e 7d72596
Author: Anatol Belski <ab@php.net>
Date:   Wed Jul 26 17:04:27 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      back to dev
      prepare 2.0.9
      sync with eol change

commit e18835e
Author: Anatol Belski <ab@php.net>
Date:   Sun Jul 23 21:00:44 2017 +0200

    EOL changes

commit 678173e
Merge: dd2527b eaa6ff5
Author: Anatol Belski <ab@php.net>
Date:   Sun Jul 23 20:58:32 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      add more file types for eol mitigation
      extend redme

commit dd2527b
Merge: 0922158 0319dc0
Author: Anatol Belski <ab@php.net>
Date:   Sun Jul 23 20:43:00 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      add gitattributes
      add comment

commit 0922158
Author: Anatol Belski <ab@php.net>
Date:   Fri Jul 21 20:52:24 2017 +0200

    improve url extraction

commit f650e1e
Author: Anatol Belski <ab@php.net>
Date:   Fri Jul 21 20:35:45 2017 +0200

    add basic mediawiki support

commit 538fe38
Author: Anatol Belski <ab@php.net>
Date:   Fri Jul 21 20:34:49 2017 +0200

    comment out PostgreSQL for now

commit 84e7a02
Author: Anatol Belski <ab@php.net>
Date:   Fri Jul 21 20:31:43 2017 +0200

    comment out debug piece

commit e096090
Author: Anatol Belski <ab@php.net>
Date:   Fri Jul 21 18:19:25 2017 +0200

    some reworks, mainly to improve postgres handling

commit 263786e
Author: Anatol Belski <ab@php.net>
Date:   Fri Jul 21 11:12:28 2017 +0200

    enable pgsql ext for training

commit 4471fc5
Author: Anatol Belski <ab@php.net>
Date:   Fri Jul 21 09:42:18 2017 +0200

    remove debug output

commit fd14678
Merge: ccb26ee 55fddef
Author: Anatol Belski <ab@php.net>
Date:   Thu Jul 20 23:55:26 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      back to dev
      prepare 2.0.8

commit ccb26ee
Author: Anatol Belski <ab@php.net>
Date:   Thu Jul 20 18:15:11 2017 +0200

    add Joomla support

commit 9e71002
Author: Anatol Belski <ab@php.net>
Date:   Thu Jul 20 15:56:23 2017 +0200

    add basic composer fetch

commit 21956c5
Merge: 63f3263 8e3d439
Author: Anatol Belski <ab@php.net>
Date:   Tue Jul 18 20:35:31 2017 +0200

    Merge branch 'master' into pgo_integration

    * master:
      Support also preview releases
      upgrade bundled php
      back to dev
      prepare 2.0.7
      improve branch name guessing
      fixed option handling, thanks Kalle
      upgrade to vswhere 2.0.2
      extend deps update comment
      task.exe commen

commit 63f3263
Merge: a0d8788 9e5e7e6
Author: Anatol Belski <ab@php.net>
Date:   Fri Jun 16 02:43:11 2017 +0200

    Merge branch 'master' into pgo_integration

commit a0d8788
Author: Anatol Belski <ab@php.net>
Date:   Wed Jun 7 17:48:25 2017 +0200

    change default pg port, add some util methods

commit 661fe89
Author: Anatol Belski <ab@php.net>
Date:   Wed Jun 7 14:24:14 2017 +0200

    basic Postgres stuff

commit 7b3b0b9
Author: Anatol Belski <ab@php.net>
Date:   Wed Jun 7 14:23:34 2017 +0200

    remove dead code

commit 00670fd
Author: Anatol Belski <ab@php.net>
Date:   Wed Jun 7 13:23:34 2017 +0200

    respect mariadb port, user creation is still to go if needed

commit b73f3ed
Author: Anatol Belski <ab@php.net>
Date:   Wed Jun 7 13:22:28 2017 +0200

    fix wrong merge

commit 6ca5d94
Merge: 7d8bd88 99efb73
Author: Anatol Belski <ab@php.net>
Date:   Mon Jun 5 21:01:47 2017 +0200

    Merge branch 'master' into pgo_integration

commit 7d8bd88
Author: Anatol Belski <ab@php.net>
Date:   Mon Jun 5 13:39:33 2017 +0200

    forcibly propagate errorlevel

commit d2f3bb5
Author: Anatol Belski <ab@php.net>
Date:   Mon Jun 5 13:38:16 2017 +0200

    forcibly propagate errorlevel

commit 0d5c0dc
Author: Anatol Belski <ab@php.net>
Date:   Sat Jun 3 10:21:41 2017 +0200

    hide warning

commit 276c3cd
Author: Anatol Belski <ab@php.net>
Date:   Fri Jun 2 21:46:56 2017 +0200

    remove existing dir before renaming

commit 2bc6e23
Author: Anatol Belski <ab@php.net>
Date:   Fri Jun 2 21:35:32 2017 +0200

    fix reinit and clean init mode

commit 8527d98
Author: Anatol Belski <ab@php.net>
Date:   Fri Jun 2 21:11:48 2017 +0200

    lower wp-cli version, seems there are issues with 1.2.0

commit fbad30b
Author: Anatol Belski <ab@php.net>
Date:   Fri Jun 2 21:07:30 2017 +0200

    more compact code using a worker for init preparation

commit 83c24e9
Author: Anatol Belski <ab@php.net>
Date:   Fri Jun 2 17:19:59 2017 +0200

    allow rename dest dir when unzip

commit 81f0d6f
Author: Anatol Belski <ab@php.net>
Date:   Thu Jun 1 21:44:02 2017 +0200

    don't keep merged pgc files

commit 8b9fd7e
Author: Anatol Belski <ab@php.net>
Date:   Thu Jun 1 21:21:23 2017 +0200

    fix wptest dir name

commit e29b5bb
Author: Anatol Belski <ab@php.net>
Date:   Thu Jun 1 21:20:36 2017 +0200

    ups

commit d18fba6
Author: Anatol Belski <ab@php.net>
Date:   Thu Jun 1 20:56:27 2017 +0200

    full implement wordpress init/train

commit 2a5000c
Author: Anatol Belski <ab@php.net>
Date:   Wed May 31 19:43:45 2017 +0200

    more fine clean

commit 7b736c1
Author: Anatol Belski <ab@php.net>
Date:   Wed May 31 19:12:06 2017 +0200

    cleanup the pgc files before training starts

commit 63ea1c8
Author: Anatol Belski <ab@php.net>
Date:   Wed May 31 18:03:48 2017 +0200

    Implement training with PGO data dumping

commit 57b5296
Author: Anatol Belski <ab@php.net>
Date:   Wed May 31 16:12:02 2017 +0200

    fix nginx init

commit 76aee82
Author: Anatol Belski <ab@php.net>
Date:   Wed May 31 15:55:55 2017 +0200

    next round refactor already done stuff

commit c8ce3af
Author: Anatol Belski <ab@php.net>
Date:   Wed May 31 00:05:15 2017 +0200

    start to implement training, improve templating

commit 6183790
Author: Anatol Belski <ab@php.net>
Date:   Mon May 29 19:35:44 2017 +0200

    almost finished setting up the symfony demo case

commit 1a3c9eb
Author: Anatol Belski <ab@php.net>
Date:   Mon May 29 16:22:04 2017 +0200

    remove debug out

    remove echos

commit 70d937c
Author: Anatol Belski <ab@php.net>
Date:   Mon May 29 16:21:13 2017 +0200

    start with training case implementation

commit 414fd54
Author: Anatol Belski <ab@php.net>
Date:   Mon May 29 14:34:27 2017 +0200

    improvements to db interface

commit e0b1a86
Author: Anatol Belski <ab@php.net>
Date:   Mon May 29 14:33:38 2017 +0200

    ignore *.swp

commit c9aa8ca
Author: Anatol Belski <ab@php.net>
Date:   Mon May 29 14:18:08 2017 +0200

    implement force, fix NGINX config

commit 6c61d14
Author: Anatol Belski <ab@php.net>
Date:   Mon May 29 14:17:46 2017 +0200

    remove not required file

commit c1bec73
Author: Anatol Belski <ab@php.net>
Date:   Mon May 29 13:46:31 2017 +0200

    basic PHP setup and usable CLI

commit d2227d3
Author: Anatol Belski <ab@php.net>
Date:   Fri May 26 13:27:23 2017 +0200

    add license

commit f96743b
Author: Anatol Belski <ab@php.net>
Date:   Tue May 23 18:31:20 2017 +0200

    basic init/up/down for MariaDB and some bug fixes

commit 14bf57c
Author: Anatol Belski <ab@php.net>
Date:   Tue May 23 17:39:22 2017 +0200

    improve config handling, more on nginx management

commit 8c40713
Author: Anatol Belski <ab@php.net>
Date:   Tue May 23 17:29:09 2017 +0200

    switch to json for internal conf

commit e744887
Author: Anatol Belski <ab@php.net>
Date:   Tue May 23 17:28:04 2017 +0200

    extend gitignore

commit 88dd8f0
Author: Anatol Belski <ab@php.net>
Date:   Tue May 23 16:10:57 2017 +0200

    basic nginx init routines and expand on config

commit 0c4f660
Author: Anatol Belski <ab@php.net>
Date:   Mon May 22 20:46:04 2017 +0200

    add unzip to fileops and some more refactoring

commit f1aeb9a
Author: Anatol Belski <ab@php.net>
Date:   Mon May 22 19:17:01 2017 +0200

    group ns

commit f92a4b4
Author: Anatol Belski <ab@php.net>
Date:   Mon May 22 19:15:56 2017 +0200

    use curl for fetches

commit 09e01d6
Author: Anatol Belski <ab@php.net>
Date:   Mon May 22 17:58:55 2017 +0200

    fix branch name recognition when no cli opt passed

commit 50c54bd
Author: Anatol Belski <ab@php.net>
Date:   Mon May 22 17:22:50 2017 +0200

    simplify

commit 5e29321
Author: Anatol Belski <ab@php.net>
Date:   Mon May 22 17:14:13 2017 +0200

    yet basic PGO stuff
  • Loading branch information
weltling committed Jan 12, 2018
1 parent 7a054e9 commit 1122cbd
Show file tree
Hide file tree
Showing 64 changed files with 26,177 additions and 31 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ oracle
#pgo-build
#rmtools*
phpsdk-local.bat
pgo/work
!pgo/tpl/php
!lib/php/libsdk/SDK/Build/PGO/Server/PHP
*.swp
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,22 @@ If the PHP SDK is kept as a git checkout, merely what is needed instead is to gi

The SDK tools are based on the KISS principle and should be kept so. Basic tools are implemented as simple batch script. The minimalistic `PHP` is available for internal SDK purposes. It can be used, if more complexity is required. A suitable PHP binary is bound with the PHP SDK. If you have an idea for some useful tool or workflow, please open a ticket or PR, so it can be discussed, implemented and added to the SDK. By contributing an implementation, you should also accept the SDK license.

# PGO

## Preparing PGO training environment
- the pgo folder in the SDK root dir contains templates and scenarios for PGO training
- adjust and execute doc/phpsdk_pgo_prep_elevated.bat.example to open ports required for PHP SDK training servers
- run `phpsdk_pgo --init`

## Creating a PGO build
- compile PHP configured using `--enable-pgi`
- run `phpsdk_pgo --train`
- run `nmake clean-pgo`
- rebuild PHP `--with-pgo`

## Adding custom scenario
TODO

# Pitfalls

- SDK or PHP sources put into paths including spaces might cause issue.
Expand Down
2 changes: 1 addition & 1 deletion bin/phpsdk_deps.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

include dirname(__FILE__) . "/../lib/php/libsdk/autoload.php";
include dirname(__FILE__) . "/../lib/php/autoload.php";

use SDK\{Config, Exception};

Expand Down
14 changes: 14 additions & 0 deletions bin/phpsdk_pgo.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@echo off

if "%PHP_SDK_PHP_CMD%"=="" (
call %~dp0phpsdk_setvars.bat
if "!PHP_SDK_PHP_CMD!"=="" (
echo PHP SDK is not setup
exit /b 3
)
)

cmd /c %PHP_SDK_PHP_CMD% %PHP_SDK_BIN_PATH%\phpsdk_pgo.php %*

exit /b %errorlevel%

127 changes: 127 additions & 0 deletions bin/phpsdk_pgo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?php

include dirname(__FILE__) . "/../lib/php/autoload.php";

use SDK\Config;
use SDK\Exception;
use SDK\Build\PGO\Controller;

$sopt = "itudhs:fr";
$lopt = array("init", "train", "up", "down", "help", "scenario:", "force", "ready");

$cmd = NULL;
/* TODO For now we simply check the current php build, this could be extended to take arbitrary binaries. */
$deps_root = NULL;
$php_root = NULL;
$scenario = NULL;
$force = false;

try {
$opt = getopt($sopt, $lopt);
foreach ($opt as $name => $val) {
switch ($name) {
case "i":
case "init":
$cmd = "init";
break;
case "ready":
$cmd = "check_init";
break;
case "t":
case "train":
$cmd = "train";
break;
case "u":
case "up":
$cmd = "up";
break;
case "d":
case "down":
$cmd = "down";
break;
case "s":
case "scenario":
$scenario = $val;
break;
case "f":
case "force":
$force = true;
break;
case "h": case "help":
usage(0);
break;

}
}

if (NULL === $cmd) {
usage();
}

$deps_root = Config::getDepsLocalPath();

if ("check_init" != $cmd) {
/* XXX Need these checks for more safety, as long as the dist zipballs are not supported. */
if (!file_exists("Makefile")) {
throw new Exception("Makefile not found. Arbitrary php snapshots are not supported yet, switch to the php source dir.");
}
if (preg_match(",BUILD_DIR=(.+),", file_get_contents("Makefile"), $m)) {
$php_root = trim($m[1]);
}
if (!$php_root || !file_exists($php_root)) {
throw new Exception("Invalid php root dir encountered '$php_root'.");
}
}

$controller = new Controller($cmd, $scenario);
$controller->handle($force);

if ("check_init" == $cmd) {
/* 0 for success, fail otherwise. */
$ret = ($controller->isInitialized() === false);
exit((int)$ret);
}

/*$env = getenv();
$env["PATH"] = $deps_root . DIRECTORY_SEPARATOR . "bin;" . $env["PATH"];
$php = $php_root . DIRECTORY_SEPARATOR . "php.exe";
$php = $php_root . DIRECTORY_SEPARATOR . "php.exe";*/

} catch (Throwable $e) {
throw $e;
exit(3);
}


function usage(int $code = -1)
{
echo "PHP SDK PGO training tool.", PHP_EOL;
echo "Usage: ", PHP_EOL, PHP_EOL;
echo "Commands:", PHP_EOL;
echo " -i --init Initialize training environment.", PHP_EOL;
echo " -t --train Run training. This involves startup, training and shutdown.", PHP_EOL;
echo " -u --up Startup training environment.", PHP_EOL;
echo " -d --down Shutdown training environment.", PHP_EOL;
echo " -f --force Force requested operation. Not every option can be forced.", PHP_EOL;
echo " -s --scenario Run training with a specified scenario.", PHP_EOL;

/*echo " -p --php-root PHP binary to train.", PHP_EOL;*/

$code = -1 == $code ? 0 : $code;
exit($code);
}

function msg(string $s, int $code = 0) {
echo $s, PHP_EOL;
exit($code);
}

/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
47 changes: 47 additions & 0 deletions doc/phpsdk_pgo_prep_elevated.bat.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@


@echo off
rem These are default ports for the servers used for the training. If these
rem ports are changed in the config templates, the commandos have to be
rem adjusted as well. New servers have to be added here as well. Run this
rem file on the elevated shell before starting the PGO environment setup
rem using the relevant port numbers, especially for unattended PGO builds.
rem We add opens inbound ports from the default PGP config templates and
rem and the one increment by 1, just co cover a simple case the port number
rem was incremented by the auto configuration.
rem
rem Alternatively, the firewall can be disabled on the build host.
rem The commands to disable\enable firewall are
rem netsh advfirewall set allprofiles state on
rem netsh advfirewall set allprofiles state off
@echo on

rem NGINX
netsh advfirewall firewall add rule name="NGINX for PGO" dir=in action=allow program="C:\php-snap-build\php-sdk\pgo\work\server\nginx\nginx.exe" profile=private
for \l %%p in (8081, 1, 8091) do (
netsh advfirewall firewall add rule name="Open Port %%p for PHP PGO" dir=in action=allow protocol=TCP localport=%%p profile=private
netsh advfirewall firewall add rule name="Open Port %%p for PHP PGO" dir=in action=allow protocol=UDP localport=%%p profile=private
)
netsh advfirewall firewall add rule name="Open Port 80 for PHP PGO" dir=in action=allow protocol=TCP localport=80 profile=private
netsh advfirewall firewall add rule name="Open Port 80 for PHP PGO" dir=in action=allow protocol=UDP localport=80 profile=private

rem MariaDB
netsh advfirewall firewall add rule name="MariaDB for PGO" dir=in action=allow program="c:\php-snap-build\php-sdk\pgo\work\server\mariadb\bin\mysqld.exe" profile=private
netsh advfirewall firewall add rule name="Open Port 3307 for PHP PGO" dir=in action=allow protocol=TCP localport=3307 profile=private
netsh advfirewall firewall add rule name="Open Port 3307 for PHP PGO" dir=in action=allow protocol=UDP localport=3307 profile=private
netsh advfirewall firewall add rule name="Open Port 3308 for PHP PGO" dir=in action=allow protocol=TCP localport=3308 profile=private
netsh advfirewall firewall add rule name="Open Port 3308 for PHP PGO" dir=in action=allow protocol=UDP localport=3308 profile=private

rem Postgres
netsh advfirewall firewall add rule name="Open Port 5434 for PHP PGO" dir=in action=allow protocol=TCP localport=5434 profile=private
netsh advfirewall firewall add rule name="Open Port 5434 for PHP PGO" dir=in action=allow protocol=UDP localport=5434 profile=private
netsh advfirewall firewall add rule name="Open Port 5435 for PHP PGO" dir=in action=allow protocol=TCP localport=5435 profile=private
netsh advfirewall firewall add rule name="Open Port 5435 for PHP PGO" dir=in action=allow protocol=UDP localport=5435 profile=private

rem PHP
netsh advfirewall firewall add rule name="Open Port 9001 for PHP PGO" dir=in action=allow protocol=TCP localport=9001 profile=private
netsh advfirewall firewall add rule name="Open Port 9001 for PHP PGO" dir=in action=allow protocol=UDP localport=9001 profile=private
netsh advfirewall firewall add rule name="Open Port 9002 for PHP PGO" dir=in action=allow protocol=TCP localport=9002 profile=private
netsh advfirewall firewall add rule name="Open Port 9002 for PHP PGO" dir=in action=allow protocol=UDP localport=9002 profile=private


26 changes: 26 additions & 0 deletions lib/php/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

spl_autoload_register(function($name) {
$fl = dirname(__FILE__) . DIRECTORY_SEPARATOR . "libsdk" . DIRECTORY_SEPARATOR . $name . ".php";

if (file_exists($fl)) {
require_once $fl;
}
});

spl_autoload_register(function($name) {
$fl = getenv("PHP_SDK_ROOT_PATH") . DIRECTORY_SEPARATOR . "pgo" . DIRECTORY_SEPARATOR . "cases" . DIRECTORY_SEPARATOR . $name . ".php";

if (file_exists($fl)) {
require_once $fl;
}
});

/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
14 changes: 4 additions & 10 deletions lib/php/libsdk/SDK/Build/Dependency/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

namespace SDK\Build\Dependency;

use SDK\Config;
use SDK\Exception;
use SDK\{Config, Exception, FileOps};

class Package
{
use FileOps;

protected $name;
protected $series;
protected $fetcher;
Expand Down Expand Up @@ -44,15 +45,8 @@ public function unpack(string $path) : void
if (!$this->filepath || !file_exists($this->filepath)) {
throw new Exception("Invalid filepath '{$this->filepath}'");
}
$zip = new \ZipArchive;

$ret = $zip->open($this->filepath);
if (true === $ret) {
$zip->extractTo($path);
$zip->close();
} else {
throw new Exception("Failed to unpack, error code '$ret'");
}
$this->unzip($this->filepath, $path);
}/*}}}*/

public function cleanup() : void
Expand Down
Loading

0 comments on commit 1122cbd

Please sign in to comment.