static-php-cli icon indicating copy to clipboard operation
static-php-cli copied to clipboard

StaticPHP v3

Open crazywhalecc opened this issue 1 month ago • 6 comments

Important notes

STATUS: dev -> alpha -> beta -> rc -> stable

Contribution notes:

  • Before we released the first alpha version, any changes should be merged into v3-dev, not v3.
  • After we released the first alpha version, any changes should be merged into v3 and we will deprecate v3-dev branch.
  • The structure of StaticPHP v3 may be changed before beta version.
  • Publishing new RFC is welcome.

RFCs

  • #959
  • #960
  • #961
  • #962
  • #963
  • #964
  • #985

Progress of refactoring

bin/ refactoring

  • [X] bin/spc for v3
  • [ ] bin/spc-alpine-docker
  • [ ] bin/spc-gnu-docker
  • [ ] bin/docker-entrypoint.sh
  • [ ] bin/setup-runtime

v3 new modules

  • [X] Registry module loading for all configs and packages (#980)
  • [ ] Vendor mode support
    • [X] Separate a dedicated bootstrap file for initialization (#980) (src/bootstrap.php)
    • [ ] Add init-registry command for vendor user

Commands refactoring

  • [X] ConsoleApplication dynamic generating commands for target type packages (#980)

  • [X] Custom commands in external registry (#980)

  • [X] DownloadCommand

    • [X] shallow-clone by default (#980)
    • [X] clean action (#980)
    • [X] --from-zip, --all, --with-openssl11 have been removed (#980)
    • [X] New options: --without-suggests, --for-packages, --ignore-cache, --parallel, --no-shallow-clone (#980)
    • [X] Porting common options: --with-php, --clean, --custom-url, --custom-git, --no-alt, --with-php (#980)
    • [X] Porting v2 compatible options: --for-extensions, --for-libs, --without-suggestions, --ignore-cache-sources, --prefer-pre-built (#980)
  • [X] BaseCommand

    • [X] New verbosity (#980)
    • [X] Git version display (#980)
  • [ ] BuildLibsCommand

    • [X] Base function of building libs (#980)
    • [ ] clean action
    • [X] Remove --all option for build:libs (#980)
  • [ ] BuildPHPCommand -> BuildTargetCommand with php package

    • [ ] Options
      • [X] --with-libs: Keep for compatibility, add --with-packages option (#980)
      • [x] --build-shared
      • [X] --build-all: Special parsing in v3 (#980)
      • [X] --no-strip, --disable-opcache-jit, --build-{sapi}, --with-config-file-path, --with-config-file-scan-dir, --with-hardcoded-ini, --with-micro-fake-cli, --with-added-patch (-P), --without-micro-ext-test, --with-upx-pack, --with-micro-logo, --enable-micro-win32, --with-frankenphp-app has been moved to php package definition (#980)
      • [ ] Implementation status
        • [x] no-strip
        • [ ] disable-opcache-jit
        • [ ] with-config-file-path
        • [x] with-config-file-scan-dir
        • [x] with-hardcoded-ini
        • [ ] with-micro-fake-cli
        • [ ] with-addeed-patch
        • [ ] without-micro-ext-test
        • [ ] with-upx-pack
        • [ ] with-micro-logo
        • [ ] enable-micro-win32
        • [ ] with-frankenphp-app
        • [ ] build-shared
        • [ ] with-packages (with-libs)
        • [ ] build-all
        • [X] build-{sapi} except build-frankenphp (#980)
        • [ ] build-frankenphp
        • [ ] with-suggests (with-suggested-libs, with-suggested-exts)
        • [X] no-download (#980)
        • [X] Download options in build command (#980)
        • [ ] with-clean
    • [X] Build information printing: refactored to attribute #[StaticPHP\Attribute\Package\Info] (#980)
    • [ ] Bind build extra info to ExceptionHandler
    • [X] Validate packages before building and after extracting (#980)
    • [X] Patch static-php-cli version to PHP has been moved to php package build stage before (#980)
    • [ ] Display build PHP result in terminal
    • [ ] Export licenses and build extensions and lib info after building
  • [ ] CraftCommand

  • [ ] DeleteDownloadCommand

  • [X] DoctorCommand (#980) (Just command, not Doctor items)

  • [ ] DumpExtensionsCommand

  • [ ] DumpLicenseCommand

  • [X] ExtractCommand (Just command, not Extractor)

    • [X] Extractor calling
    • [X] Options
      • [X] New for-extensions (#980)
      • [X] New for-libs (#980)
      • [X] New for-packages (#980)
      • [X] New without-suggests for for-* options (#980)
  • [ ] InstallPkgCommand ->InstallPackageCommand

    • [X] PackageInstaller calling
    • [ ] Options
      • [ ] skip-extract
  • [ ] MicroCombineCommand

  • [X] SPCConfigCommand

    • [X] SPCConfigUtil calling
    • [X] Options
  • [X] SwitchPhpVersionCommand

  • [ ] Dev commands

    • [ ] AllExtCommand
    • [ ] EnvCommand
    • [ ] ExtVerCommand
    • [ ] GenerateExtDepDocsCommand
    • [ ] GenerateExtDocCommand
    • [ ] GenerateLibDepDocsCommand
    • [ ] LibVerCommand
    • [ ] PackLibCommand
    • [ ] PhpVerCommand
    • [ ] SortConfigCommand

Doctor module

  • [X] Core framework refactored (#980)
    • [X] Doctor main class
    • [X] DoctorLoader for loading check items
    • [X] CheckResult for storing check results
    • [X] Attribute-based check system: #[CheckItem], #[OptionalCheck], #[FixItem]
  • [ ] Doctor check items
    • [X] OSCheck (migrated from v2's OSCheckList)
    • [X] Re2cVersionCheck
    • [X] PkgConfigCheck
    • [X] MacOSToolCheck (migrated from v2's MacOSToolCheckList)
    • [X] LinuxMuslCheck
    • [x] LinuxToolCheck (v2 has LinuxToolCheckList)
    • [ ] BSDToolCheck (v2 has BSDToolCheckList)
    • [ ] WindowsToolCheck (v2 has WindowsToolCheckList)
    • [x] ZigCheck (v2 has ZigCheck)

Legacy modules (v2 only - SPC namespace)

These modules exist in v2 but are refactored/merged into new v3 modules:

  • [X] store/ - Deprecated and refactored
    • [X] Downloader → StaticPHP\Artifact\ArtifactDownloader
    • [X] LockFile → StaticPHP\Artifact\ArtifactCache
    • [X] CurlHook → Merged into StaticPHP\Artifact\ArtifactDownloader
    • [X] FileSystem → StaticPHP\Util\FileSystem
    • [X] DirDiff → StaticPHP\Util\DirDiff
    • [X] SourcePatcher → StaticPHP\Util\SourcePatcher (partial)
    • [X] PackageManager, SourceManager → Removed (functionality in new Package/Artifact systems)
    • [X] pkg/ → Migrated to src/Package/
    • [X] source/ → Migrated to Artifact system

crazywhalecc avatar Nov 30 '25 07:11 crazywhalecc