Your Name 2 年之前
父節點
當前提交
6ff4f2e65f
共有 5 個文件被更改,包括 43 次插入1 次删除
  1. 18 0
      README.md
  2. 5 0
      images/php/8.1/Dockerfile
  3. 7 0
      images/php/8.1/conf/spx.ini
  4. 6 1
      images/php/8.2/Dockerfile
  5. 7 0
      images/php/8.2/conf/spx.ini

+ 18 - 0
README.md

@@ -520,6 +520,24 @@ Otherwise, this project now automatically sets up Xdebug support with VS Code. I
     * Ensure the Chrome Xdebug helper is enabled by clicking on it and selecting Debug. The icon should turn bright green.
     * Navigate to your Magento store URL, and Xdebug should now trigger the debugger within PhpStorm at the toggled breakpoint.
 
+### PHP-SPX
+
+The images also have additional profiler-tracer with built-in <a href="https://github.com/NoiseByNorthwest/php-spx/tree/master#web-ui" target="_blank">web UI.</a>
+
+To access the control panel just open the following URL.
+
+```
+https://magento.test/?SPX_KEY=dev&SPX_UI_URI=/
+```
+Profiling is also possible via command line and curl:
+
+```
+SPX_ENABLED=1 SPX_REPORT=full bin/magento {command_name}
+```
+```
+curl --cookie "SPX_ENABLED=1; SPX_KEY=dev" https://magento.test/
+```
+
 ### SSH
 
 Since version `40.0.0`, this project supports connecting to Docker with SSH/SFTP. This means that if you solely use either PhpStorm or VSCode, you no longer need to selectively mount host volumes in order to gain bi-directional sync capabilities from host to container. This will enable full speed in the native filesystem, as all files will be stored directly in the `appdata` container volume, rather than being synced from the host. This is especially useful if you'd like to sync larger directories such as `generated`, `pub` & `vendor`.

+ 5 - 0
images/php/8.1/Dockerfile

@@ -35,6 +35,7 @@ RUN apt-get update && apt-get install -y \
     nodejs \
     procps \
     vim \
+    zlib1g-dev \
     zip \
   && rm -rf /var/lib/apt/lists/*
 
@@ -83,10 +84,14 @@ RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
     && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
     && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
 
+RUN cd /usr/lib && git clone https://github.com/NoiseByNorthwest/php-spx.git
+RUN cd /usr/lib/php-spx && phpize && ./configure && make && make install
+
 RUN curl -sS https://getcomposer.org/installer | \
   php -- --install-dir=/usr/local/bin --filename=composer
 
 COPY conf/blackfire.ini $PHP_INI_DIR/conf.d/blackfire.ini
+COPY conf/spx.ini $PHP_INI_DIR/conf.d/spx.ini
 COPY conf/msmtprc /etc/msmtprc
 COPY conf/php.ini $PHP_INI_DIR
 COPY conf/php-fpm.conf /usr/local/etc/

+ 7 - 0
images/php/8.1/conf/spx.ini

@@ -0,0 +1,7 @@
+zlib.output_compression = 0
+
+extension = /usr/lib/php-spx/modules/spx.so
+spx.http_enabled = 1
+spx.http_key = "dev"
+spx.http_ip_whitelist = "*"
+spx.data_dir = /var/www/spx_dumps

+ 6 - 1
images/php/8.2/Dockerfile

@@ -35,6 +35,7 @@ RUN apt-get update && apt-get install -y \
     nodejs \
     procps \
     vim \
+    zlib1g-dev \
     zip \
   && rm -rf /var/lib/apt/lists/*
 
@@ -81,12 +82,16 @@ RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
     && mkdir -p /tmp/blackfire \
     && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \
     && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \
-    && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz
+    && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz \
+
+RUN cd /usr/lib && git clone https://github.com/NoiseByNorthwest/php-spx.git
+RUN cd /usr/lib/php-spx && phpize && ./configure && make && make install
 
 RUN curl -sS https://getcomposer.org/installer | \
   php -- --install-dir=/usr/local/bin --filename=composer
 
 COPY conf/blackfire.ini $PHP_INI_DIR/conf.d/blackfire.ini
+COPY conf/spx.ini $PHP_INI_DIR/conf.d/spx.ini
 COPY conf/msmtprc /etc/msmtprc
 COPY conf/php.ini $PHP_INI_DIR
 COPY conf/php-fpm.conf /usr/local/etc/

+ 7 - 0
images/php/8.2/conf/spx.ini

@@ -0,0 +1,7 @@
+zlib.output_compression = 0
+
+extension = /usr/lib/php-spx/modules/spx.so
+spx.http_enabled = 1
+spx.http_key = "dev"
+spx.http_ip_whitelist = "*"
+spx.data_dir = /var/www/spx_dumps