### Install composer/pcre Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/composer/pcre/README.md Install the latest version of the library using Composer. ```bash $ composer require composer/pcre ``` -------------------------------- ### Install PHP Complex Library Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/complex/README.md Install the library using Composer. ```shell composer require markbaker/complex:^1.0 ``` -------------------------------- ### Install PHP Complex Functions Library Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/complex/README.md Install the separate library for procedural function calls. ```shell composer require markbaker/complex-functions:^3.0 ``` -------------------------------- ### Install Symfony Polyfill for Mbstring Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/maennchen/zipstream-php/guides/index.rst Install this package if your installation is missing the mbstring extension and composer install fails. ```sh composer require symfony/polyfill-mbstring ``` -------------------------------- ### Install PHPMatrix Functions using Composer Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/matrix/README.md Install the PHPMatrixFunctions library, recommended for procedural calls from version 3.0 onwards. ```shell composer require markbaker/matrix-functions:^1.0 ``` -------------------------------- ### Install PHPMatrix using Composer Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/matrix/README.md Install the PHPMatrix library version 3.0 or higher using Composer. ```shell composer require markbaker/matrix:^3.0 ``` -------------------------------- ### Install PSR7 and GuzzleHTTP Dependencies Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/maennchen/zipstream-php/guides/index.rst Install these dependencies if you need to use addFileFromPsr7Stream or a stream as an output stream. ```sh composer require psr/http-message guzzlehttp/psr7 ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md Run this command within your PhpSpreadsheet clone to install necessary development dependencies. ```bash composer install ``` -------------------------------- ### Basic ZipStream PHP Usage Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/maennchen/zipstream-php/guides/index.rst This example demonstrates how to create a zip archive, add files from different sources, and finish the stream. Ensure dependencies are autoloaded. ```php // Autoload the dependencies require 'vendor/autoload.php'; // create a new zipstream object $zip = new ZipStream\ZipStream( outputName: 'example.zip', // enable output of HTTP headers sendHttpHeaders: true, ); // create a file named 'hello.txt' $zip->addFile( fileName: 'hello.txt', data: 'This is the contents of hello.txt', ); // add a file named 'some_image.jpg' from a local file 'path/to/image.jpg' $zip->addFileFromPath( fileName: 'some_image.jpg', path: 'path/to/image.jpg', ); // add a file named 'goodbye.txt' from an open stream resource $filePointer = tmpfile(); fwrite($filePointer, 'The quick brown fox jumped over the lazy dog.'); rewind($filePointer); $zip->addFileFromStream( fileName: 'goodbye.txt', stream: $filePointer, ); fclose($filePointer); // add a file named 'streamfile.txt' from the body of a `guzzle` response // Setup with `psr/http-message` & `guzzlehttp/psr7` dependencies required. $zip->addFileFromPsr7Stream( fileName: 'streamfile.txt', stream: $response->getBody(), ); // finish the zip stream $zip->finish(); ``` -------------------------------- ### Install ZipStream PHP with Composer Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/maennchen/zipstream-php/guides/index.rst Use Composer to add the zipstream-php package to your project dependencies. ```sh composer require maennchen/zipstream-php ``` -------------------------------- ### Prepend to HTTP Message Body (Stream Behavior) Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/psr/http-message/docs/PSR7-Usage.md Illustrates the behavior of prepending to a stream body. Due to stream mechanics, prepending requires seeking to the beginning and writing, which overwrites existing content from the start. ```php // assuming our response is initially empty $body = $repsonse->getBody(); // writing the string "abcd" $body->write('abcd'); // seeking to start of stream $body->seek(0); // writing 'ef' $body->write('ef'); // at this point the stream contains "efcd" ``` -------------------------------- ### PREG_UNMATCHED_AS_NULL Behavior Example Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/composer/pcre/README.md Demonstrates the difference in match results when using PREG_UNMATCHED_AS_NULL compared to no flag. This is useful for understanding how unmatched groups are represented. ```php preg_match('/(a)(b)*(c)(d)*/', 'ac', $matches, $flags); ``` -------------------------------- ### Get and Replace HTTP Message Body Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/psr/http-message/docs/PSR7-Usage.md Demonstrates how to get the body stream from an HTTP response, perform operations on it, and then replace it. This is useful for repeated body operations. ```php $body = $response->getBody(); // operations on body, eg. read, write, seek // ... // replacing the old body $response->withBody($body); // this last statement is optional as we working with objects // in this case the "new" body is same with the "old" one // the $body variable has the same value as the one in $request, only the reference is passed ``` -------------------------------- ### Configuring ZipStream with All Available Options Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/maennchen/zipstream-php/guides/Options.rst Demonstrates how to initialize ZipStream with a comprehensive set of options, including output stream definition, deflate level, comments, HTTP header settings, content disposition, output name, content type, header callback, zero header enabling, Zip64 extension, and buffer flushing. ```php use ZipStream\ZipStream; require_once 'vendor/autoload.php'; $zip = new ZipStream( // Define output stream // (argument is either a resource or implementing // `Psr\Http\Message\StreamInterface`) // // Setup with `psr/http-message` & `guzzlehttp/psr7` dependencies // required when using `Psr\Http\Message\StreamInterface`. // // Can also use CallbackStreamWrapper for custom output handling: // outputStream: CallbackStreamWrapper::open(function($data) { /* handle data */ }), outputStream: $filePointer, // Set the deflate level (default is 6; use -1 to disable it) defaultDeflateLevel: 6, // Add a comment to the zip file comment: 'This is a comment.', // Send http headers (default is true) sendHttpHeaders: false, // HTTP Content-Disposition. // Defaults to 'attachment', where FILENAME is the specified filename. // Note that this does nothing if you are not sending HTTP headers. contentDisposition: 'attachment', // Output Name for HTTP Content-Disposition // Defaults to no name outputName: "example.zip", // HTTP Content-Type. // Defaults to 'application/x-zip'. // Note that this does nothing if you are not sending HTTP headers. contentType: 'application/x-zip', // Set the function called for setting headers. // Default is the `header()` of PHP httpHeaderCallback: header(...), // Enable streaming files with single read where general purpose bit 3 // indicates local file header contain zero values in crc and size // fields, these appear only after file contents in data descriptor // block. // Set to true if your input stream is remote // (used with addFileFromStream()). // Default is false. defaultEnableZeroHeader: false, // Enable zip64 extension, allowing very large archives // (> 4Gb or file count > 64k) // Default is true enableZip64: true, // Flush output buffer after every write // Default is false flushOutput: true, ); ``` -------------------------------- ### Mathematical Operations (Instance Methods) Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/complex/README.md Shows how to perform mathematical operations like addition using instance methods on a Complex object. ```APIDOC ## Mathematical Operations (Instance Methods) ### Description Perform mathematical operations directly on a Complex object by calling its methods. These methods are immutable, meaning they return a new Complex object with the result and leave the original object unchanged. This allows for method chaining. ### Method `add(value)` `subtract(value)` `multiply(value)` `divide(value)` `divideBy(value)` `divideInto(value)` `theta()` `rho()` `conjugate()` `negative()` `inverse()` `cos()` `acos()` `cosh()` `acosh()` `sin()` `asin()` `sinh()` `asinh()` `sec()` `asec()` `sech()` `asech()` `csc()` `acsc()` `csch()` `acsch()` `tan()` `atan()` `tanh()` `atanh()` `cot()` `acot()` `coth()` `acoth()` `sqrt()` `exp()` `ln()` `log10()` `log2()` `pow(real)` ### Parameters #### value - **value** (Complex|array|string) - The value to perform the operation with. Can be a Complex object, an array that can be parsed into a Complex object, or a string representation of a complex number. #### real - **real** (float) - The real number to raise the complex number to the power of. ### Request Example ```php $complexString1 = '1.23-4.56i'; $complexString2 = '2.34+5.67i'; $complexObject = new Complex\Complex($complexString1); echo $complexObject->add($complexString2); // Chaining example echo $complexObject->add($complexString2)->subtract('1+1i'); ``` ### Response Returns a new Complex object with the result of the operation. ``` -------------------------------- ### Get Header Array Value Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/psr/http-message/docs/PSR7-Usage.md Retrieves a header's value as an array of strings. This applies to both request and response headers. ```php $request->getHeader('Content-Type'); // will return: ["text/html", "charset=UTF-8"] ``` ```php $response->getHeader('My-Custom-Header'); // will return: ["My Custom Message", "The second message"] ``` -------------------------------- ### Basic ZipStream Usage Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/maennchen/zipstream-php/README.md Create a zip stream, add files by content or from a path, and finish the stream. Ensure dependencies are autoloaded. ```php // Autoload the dependencies require 'vendor/autoload.php'; // create a new zipstream object $zip = new ZipStream\ZipStream( outputName: 'example.zip', // enable output of HTTP headers sendHttpHeaders: true, ); // create a file named 'hello.txt' $zip->addFile( fileName: 'hello.txt', data: 'This is the contents of hello.txt', ); // add a file named 'some_image.jpg' from a local file 'path/to/image.jpg' $zip->addFileFromPath( fileName: 'some_image.jpg', path: 'path/to/image.jpg', ); // finish the zip stream $zip->finish(); ``` -------------------------------- ### Get Header Line Value Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/psr/http-message/docs/PSR7-Usage.md Retrieves a header's value as a comma-separated string. This applies to both request and response headers. ```php $request->getHeaderLine('Content-Type'); // will return: "text/html; charset=UTF-8" ``` ```php $response->getHeaderLine('My-Custom-Header'); // will return: "My Custom Message; The second message" ``` -------------------------------- ### Mathematical Operations (Static Methods) Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/complex/README.md Demonstrates how to perform mathematical operations using static methods from the Operations class. ```APIDOC ## Mathematical Operations (Static Methods) ### Description Perform mathematical operations using static methods provided by the `Complex\Operations` class. This approach is useful for performing operations without needing an existing Complex object instance. ### Method `Complex\Operations::add(value1, value2, ...)` `Complex\Operations::subtract(value1, value2, ...)` `Complex\Operations::multiply(value1, value2, ...)` `Complex\Operations::divide(value1, value2, ...)` `Complex\Operations::divideBy(value1, value2, ...)` `Complex\Operations::divideInto(value1, value2, ...)` `Complex\Operations::theta(value)` `Complex\Operations::rho(value)` `Complex\Operations::conjugate(value)` `Complex\Operations::negative(value)` `Complex\Operations::inverse(value)` `Complex\Operations::cos(value)` `Complex\Operations::acos(value)` `Complex\Operations::cosh(value)` `Complex\Operations::acosh(value)` `Complex\Operations::sin(value)` `Complex\Operations::asin(value)` `Complex\Operations::sinh(value)` `Complex\Operations::asinh(value)` `Complex\Operations::sec(value)` `Complex\Operations::asec(value)` `Complex\Operations::sech(value)` `Complex\Operations::asech(value)` `Complex\Operations::csc(value)` `Complex\Operations::acsc(value)` `Complex\Operations::csch(value)` `Complex\Operations::acsch(value)` `Complex\Operations::tan(value)` `Complex\Operations::atan(value)` `Complex\Operations::tanh(value)` `Complex\Operations::atanh(value)` `Complex\Operations::cot(value)` `Complex\Operations::acot(value)` `Complex\Operations::coth(value)` `Complex\Operations::acoth(value)` `Complex\Operations::sqrt(value)` `Complex\Operations::exp(value)` `Complex\Operations::ln(value)` `Complex\Operations::log10(value)` `Complex\Operations::log2(value)` `Complex\Operations::pow(value, real)` ### Parameters #### value - **value** (Complex|array|string) - The value to perform the operation with. Can be a Complex object, an array that can be parsed into a Complex object, or a string representation of a complex number. #### value1, value2, ... - **value1, value2, ...** (Complex|array|string) - Multiple values to perform the operation against. Accepts any number of arguments. #### real - **real** (float) - The real number to raise the complex number to the power of. ### Request Example ```php $complexString1 = '1.23-4.56i'; $complexString2 = '2.34+5.67i'; echo Complex\Operations::add($complexString1, $complexString2); // Performing operation on multiple values echo Complex\Operations::add($complexString1, $complexString2, '3+4i'); ``` ### Response Returns a Complex object with the result of the operation. ``` -------------------------------- ### Adding Content-Length Header with SIMULATION_STRICT Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/maennchen/zipstream-php/guides/ContentLength.rst This snippet demonstrates how to initialize ZipStream in SIMULATION_STRICT mode to calculate the archive size and set the Content-Length header before streaming. It shows adding files directly and using callbacks with exact sizes for deferred resource opening. ```php use ZipStream\OperationMode; use ZipStream\ZipStream; $zip = new ZipStream( operationMode: OperationMode::SIMULATE_STRICT, // or SIMULATE_LAX defaultEnableZeroHeader: false, sendHttpHeaders: true, outputStream: $stream, ); // Normally add files $zip->addFile('sample.txt', 'Sample String Data'); // Use addFileFromCallback and exactSize if you want to defer opening of // the file resource $zip->addFileFromCallback( 'sample.txt', exactSize: 18, callback: function () { return fopen('...'); } ); // Read resulting file size $size = $zip->finish(); // Tell it to the browser header('Content-Length: '. $size); // Execute the Simulation and stream the actual zip to the client $zip->executeSimulation(); ``` -------------------------------- ### Get Body Contents with Rewind Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/psr/http-message/docs/PSR7-Usage.md Retrieves the entire content of an HTTP message body as a string. It's crucial to rewind the stream before reading to ensure all content is captured. ```php $body = $response->getBody(); $body->rewind(); // or $body->seek(0); $bodyText = $body->getContents(); ``` -------------------------------- ### Basic preg_* function replacements Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/composer/pcre/README.md Demonstrates the equivalent usage of standard preg_* functions with the Composer\Pcre\Preg class. ```php use Composer\Pcre\Preg; if (Preg::match('{fo+}', $string, $matches)) { ... } if (Preg::matchWithOffsets('{fo+}', $string, $matches)) { ... } if (Preg::matchAll('{fo+}', $string, $matches)) { ... } $newString = Preg::replace('{fo+}', 'bar', $string); $newString = Preg::replaceCallback('{fo+}', function ($match) { return strtoupper($match[0]); }, $string); $newString = Preg::replaceCallbackArray(['{fo+}' => fn ($match) => strtoupper($match[0])], $string); $filtered = Preg::grep('{[a-z]}', $elements); $array = Preg::split('{[a-z]+}', $string); ``` -------------------------------- ### Perform matrix multiplication using method chaining Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/matrix/README.md Multiply two matrices using the multiply method and chain it with toArray to get the result as an array. Matrix objects are immutable, returning a new object. ```php $matrix1 = new Matrix\Matrix([ [2, 7, 6], [9, 5, 1], [4, 3, 8], ]); $matrix2 = new Matrix\Matrix([ [1, 2, 3], [4, 5, 6], [7, 8, 9], ]); var_dump($matrix1->multiply($matrix2)->toArray()); ``` -------------------------------- ### Saving ZipStream Output to Flysystem Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/maennchen/zipstream-php/guides/FlySystem.rst This snippet demonstrates how to create a zip archive in memory and then upload it using a Flysystem local adapter. Ensure the stream is opened in 'w+' mode for read/write access and is closed after the upload. ```php // Open Stream only once for read and write since it's a memory stream and // the content is lost when closing the stream / opening another one $tempStream = fopen('php://memory', 'w+'); // Create Zip Archive $zipStream = new ZipStream( outputStream: $tempStream, outputName: 'test.zip', ); $zipStream->addFile('test.txt', 'text'); $zipStream->finish(); // Store File // (see Flysystem documentation, and all its framework integration) // Can be any adapter (AWS, Google, Ftp, etc.) $adapter = new Local(__DIR__.'/path/to/folder'); $filesystem = new Filesystem($adapter); $filesystem->writeStream('test.zip', $tempStream) // Close Stream fclose($tempStream); ``` -------------------------------- ### Identify Coding Style Issues Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md Execute this command to check your code against the project's coding style standards. ```bash composer style ``` -------------------------------- ### Create a new Matrix object Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/matrix/README.md Instantiate a new Matrix object by passing a 2D array representing the grid to the constructor. ```php $grid = [ [16, 3, 2, 13], [ 5, 10, 11, 8], [ 9, 6, 7, 12], [ 4, 15, 14, 1], ]; $matrix = new Matrix\Matrix($grid); ``` -------------------------------- ### Create Annotated Git Tag Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md Steps for creating an annotated Git tag for a new release, including setting the tag subject and body. ```bash git tag -a 1.2.3 ``` -------------------------------- ### Stream ZIP with Callback for Progress Tracking Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/maennchen/zipstream-php/guides/StreamOutput.rst Utilize a callback function with ZipStream to track the total bytes transferred, enabling progress reporting to a tracking system. ```php // Example 2: Progress tracking $totalBytes = 0; $zip = new ZipStream( outputStream: CallbackStreamWrapper::open(function (string $data) use (&$totalBytes) { $totalBytes += strlen($data); reportProgress($totalBytes); // Report progress to your tracking system // Your actual output handling echo $data; }), sendHttpHeaders: false, ); $zip->addFile('large_file.txt', str_repeat('A', 10000)); $zip->finish(); ``` -------------------------------- ### Test Version Compatibility Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md Use this Composer command to test code compatibility across supported PHP versions. ```bash composer versions ``` -------------------------------- ### Create Image Sitemap Source: https://github.com/sterc/seosuite/blob/master/readme.md Generate a sitemap specifically for images by setting the 'type' parameter to 'images'. ```MODX [[!SeoSuiteSitemap? &type=`images`]] ``` -------------------------------- ### Matrix Decomposition using QR Class Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/matrix/README.md Perform QR decomposition on a matrix by instantiating the QR class with a Matrix object. Access the Q and R components using their respective getter methods. ```php $grid = [ [1, 2], [3, 4], ]; $matrix = new Matrix\Matrix($grid); $decomposition = new Matrix\Decomposition\QR($matrix); $Q = $decomposition->getQ(); $R = $decomposition->getR(); ``` -------------------------------- ### Complex Number Creation Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/complex/README.md Demonstrates how to create new Complex objects using the constructor with real, imaginary, and suffix parts, or as an array of values, or as a string. ```APIDOC ## Complex Number Creation ### Description Creates a new complex number object. The constructor can accept the real, imaginary, and suffix parts as individual arguments, as an array of these values, or as a string representation of the complex number. ### Method `__construct(real, imaginary, suffix)` or `__construct([real, imaginary, suffix])` or `__construct(string)` ### Parameters #### Arguments - **real** (float) - The real part of the complex number. - **imaginary** (float) - The imaginary part of the complex number. - **suffix** (string) - The suffix for the imaginary part (e.g., 'i'). #### Array Arguments - **arguments** (array) - An array containing the real, imaginary, and suffix parts in that order. #### String Argument - **complexString** (string) - A string representing the complex number (e.g., '1.23-4.56i'). ### Request Example ```php // Using individual arguments $complexObject1 = new Complex\Complex(1.23, -4.56, 'i'); // Using an array of arguments $arguments = [1.23, -4.56, 'i']; $complexObject2 = new Complex\Complex($arguments); // Using a string $complexString = '1.23-4.56i'; $complexObject3 = new Complex\Complex($complexString); ``` ### Response Returns a new Complex object representing the provided complex number. ``` -------------------------------- ### Create an identity matrix using Builder Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/matrix/README.md Use the Builder class to create an identity matrix of a specified size. ```php $matrix = Matrix\Builder::createIdentityMatrix(3); ``` -------------------------------- ### All SeoSuiteMeta Placeholders Source: https://github.com/sterc/seosuite/blob/master/readme.md This snippet displays all available metadata placeholders when the 'toPlaceholders' option is enabled. These are typically set by a plugin but can be managed manually. ```html [[!+ss_meta.meta_title]] [[!+ss_meta.meta_description]] [[!+ss_meta.robots]] [[!+ss_meta.canonical]] [[!+ss_meta.alternates]] [[!+ss_meta.og_title]] [[!+ss_meta.og_description]] [[!+ss_meta.og_image]] [[!+ss_meta.og_image_alt]] [[!+ss_meta.og_type]] [[!+ss_meta.twitter_site]] [[!+ss_meta.twitter_title]] [[!+ss_meta.twitter_description]] [[!+ss_meta.twitter_image]] [[!+ss_meta.twitter_image_alt]] [[!+ss_meta.twitter_card]] ``` -------------------------------- ### Create a filled matrix using Builder Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/matrix/README.md Use the Builder class to create a matrix of specified dimensions filled with a set value. ```php $matrix = Matrix\Builder::createFilledMatrix(1, 5, 3); ``` -------------------------------- ### Push Git Tags Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md Push all local tags to the remote repository to trigger automated release creation. ```bash git push --tags ``` -------------------------------- ### Create Sitemap Index Source: https://github.com/sterc/seosuite/blob/master/readme.md Generate a sitemap index by specifying the 'index' type. This is useful for organizing multiple child sitemaps. ```MODX [[!SeoSuiteSitemap? &type=`index`]] ``` -------------------------------- ### Matrix Decomposition using Decomposition Factory Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/matrix/README.md Perform matrix decomposition using the Decomposition factory. Specify the desired decomposition type (e.g., QR) and pass the Matrix object. Access Q and R components. ```php $grid = [ [1, 2], [3, 4], ]; $matrix = new Matrix\Matrix($grid); $decomposition = Matrix\Decomposition\Decomposition::decomposition(Matrix\Decomposition\Decomposition::QR, $matrix); $Q = $decomposition->getQ(); $R = $decomposition->getR(); ``` -------------------------------- ### Create Complex Object from Real, Imaginary, and Suffix Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/complex/README.md Instantiate a Complex object using individual real, imaginary, and suffix values. ```php $real = 1.23; $imaginary = -4.56; $suffix = 'i'; $complexObject = new Complex\Complex($real, $imaginary, $suffix); ``` -------------------------------- ### Calling sinh() using Complex\Functions static method Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/complex/README.md Shows how to call the sinh() function using the static Functions class. ```php $complexString = '1.23-4.56i'; echo Complex\Functions::sinh($complexString); ``` -------------------------------- ### Calling pow() using Complex\Functions static method Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/complex/README.md Illustrates calling the pow() function with a Complex object and an exponent using the static Functions class. ```php $complexString = '1.23-4.56i'; $complexObject = new Complex\Complex($complexString); echo Complex\Functions::pow($complexObject, 2); ``` -------------------------------- ### Varnish VCL Configuration for ZipStream-PHP Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/maennchen/zipstream-php/guides/Varnish.rst Add this VCL code to your Varnish configuration to enable the 'pipe' function for specific file types, preventing random stream closures when serving large zip files. ```vcl sub vcl_recv { # Varnish can’t intercept the discussion anymore # helps for streaming big zips if (req.url ~ "\.(tar|gz|zip|7z|exe)$") { return (pipe); } } # Varnish can’t intercept the discussion anymore # helps for streaming big zips sub vcl_pipe { set bereq.http.connection = "close"; return (pipe); } ``` -------------------------------- ### Stream ZIP to Callback Function (Multiple Destinations) Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/maennchen/zipstream-php/guides/StreamOutput.rst Stream ZIP data to a callback function that can handle multiple output destinations simultaneously, such as echoing to the browser, writing to a file, and logging. ```php use ZipStream\ZipStream; use ZipStream\Stream\CallbackStreamWrapper; // Example 1: Stream to multiple destinations with proper file handling $backupFile = fopen('backup.zip', 'wb'); $logFile = fopen('transfer.log', 'ab'); $zip = new ZipStream( outputStream: CallbackStreamWrapper::open(function (string $data) use ($backupFile, $logFile) { // Send to browser echo $data; // Save to file efficiently fwrite($backupFile, $data); // Log transfer progress fwrite($logFile, "Transferred " . strlen($data) . " bytes\n"); }), sendHttpHeaders: false, ); $zip->addFile('hello.txt', 'Hello World!'); $zip->finish(); // Clean up resources fclose($backupFile); fclose($logFile); ``` -------------------------------- ### Fix Coding Style Issues Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md Run this command to automatically fix most coding style issues identified by the linter. ```bash composer fix ``` -------------------------------- ### Calling pow() using Complex object method Source: https://github.com/sterc/seosuite/blob/master/core/components/seosuite/vendor/markbaker/complex/README.md Demonstrates calling the pow() function with an exponent directly on a Complex object instance. ```php $complexString = '1.23-4.56i'; $complexObject = new Complex\Complex($complexString); echo $complexObject->pow(2); ```