### Install PHPWord Dependencies Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpword/CONTRIBUTING.md Run this command after cloning the repository to install all necessary dependencies for development. ```bash composer install ``` -------------------------------- ### Install ramsey/collection with Composer Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/ramsey/collection/README.md Install this package as a dependency using Composer. ```bash composer require ramsey/collection ``` -------------------------------- ### Install SQL Parser with Composer Source: https://github.com/easysoft/zentaopms/blob/main/lib/sqlparser/vendor/phpmyadmin/sql-parser/README.md Use Composer to install the phpmyadmin/sql-parser library. ```sh composer require phpmyadmin/sql-parser ``` -------------------------------- ### Install RoadRunner KV Package Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/spiral/roadrunner-kv/README.md Install the spiral/roadrunner-kv package using Composer. ```bash composer require spiral/roadrunner-kv ``` -------------------------------- ### Install Goridge using Composer Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/spiral/goridge/README.md Install the Goridge library using Composer. Ensure you have a 64-bit PHP version and the ext-sockets extension enabled. ```bash composer require spiral/goridge ``` -------------------------------- ### Install Mobile Detect via Composer Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/mobiledetect/mobiledetectlib/README.md Install the library as a Composer package for continuous updates and easier dependency management. This is the recommended method for production environments. ```bash composer require mobiledetect/mobiledetectlib ``` -------------------------------- ### Install with Composer Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/paragonie/constant_time_encoding/README.md Use Composer to add the library to your project dependencies. ```sh composer require paragonie/constant_time_encoding ``` -------------------------------- ### Page Setup: Fit to width and height Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/topics/recipes.md Configure scaling options for page setup to fit content to a specific width or height. Setting width or height automatically triggers fit-to-page. ```php $spreadsheet->getActiveSheet()->getPageSetup()->setFitToWidth(1); $spreadsheet->getActiveSheet()->getPageSetup()->setFitToHeight(0); ``` -------------------------------- ### Install Composer Semver Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/composer/semver/README.md Use Composer to install the latest version of the semver library. ```bash composer require composer/semver ``` -------------------------------- ### Install ramsey/uuid with Composer Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/ramsey/uuid/README.md Use Composer to install the ramsey/uuid package and add it as a requirement to your project. ```bash composer require ramsey/uuid ``` -------------------------------- ### Install phpseclib 1.0 via Composer Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpseclib/phpseclib/README.md Install the PHP4-compatible LTS release of phpseclib using Composer with PSR-0 autoloading. ```sh composer require phpseclib/phpseclib:~1.0 ``` -------------------------------- ### Install RoadRunner Jobs Plugin Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/spiral/roadrunner-jobs/README.md Use composer to install the spiral/roadrunner-jobs package. ```bash $ composer require spiral/roadrunner-jobs ``` -------------------------------- ### Making a GET Request with Headers and Options in PHP Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/rmccue/requests/README.md Demonstrates how to make a GET request to an API endpoint, including custom headers and authentication options. Shows how to access the response status code, content type, and body. ```php $headers = array('Accept' => 'application/json'); $options = array('auth' => array('user', 'pass')); $request = WpOrg\Requests\Requests::get('https://api.github.com/gists', $headers, $options); var_dump($request->status_code); // int(200) var_dump($request->headers['content-type']); // string(31) "application/json; charset=utf-8" var_dump($request->body); // string(26891) "[...]" ``` -------------------------------- ### Install laminas-escaper using Composer Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/laminas/laminas-escaper/README.md Run this command to install the library using Composer. This is the standard method for adding dependencies to a PHP project. ```bash composer require laminas/laminas-escaper ``` -------------------------------- ### Install RoadRunner HTTP and PSR7 Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/spiral/roadrunner-http/README.md Install the RoadRunner application server and HTTP component along with a PSR-7 implementation using Composer. ```bash composer require spiral/roadrunner-http nyholm/psr7 ``` -------------------------------- ### Install gregwar/captcha with Composer Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/gregwar/captcha/README.md Add the gregwar/captcha library to your project dependencies using Composer. ```json { "require": { "gregwar/captcha": "1.*" } } ``` -------------------------------- ### Install phpseclib 2.0 via Composer Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpseclib/phpseclib/README.md Install the modernized LTS release of phpseclib, compatible with PHP 5.3.3 and later, utilizing PSR-4 autoloading under the \phpseclib namespace. ```sh composer require phpseclib/phpseclib:~2.0 ``` -------------------------------- ### Execute Full Build Process with Make Source: https://github.com/easysoft/zentaopms/blob/main/CLAUDE.md Use this command to initiate the complete build process for the project. Ensure you are in the project's root directory. ```bash make all ``` -------------------------------- ### Retrieve Cell Value by Column and Row Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/topics/accessing-cells.md Get the value of a cell using its column and row number. Column references start with 1 for column 'A'. ```php // Get the value from cell B5 $cellValue = $spreadsheet->getActiveSheet()->getCellByColumnAndRow(2, 5)->getValue(); ``` -------------------------------- ### Prepend to PSR-7 Stream Body (Simulated) Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/psr/http-message/docs/PSR7-Usage.md Prepending to a PSR-7 stream requires seeking to the beginning and then writing. This example demonstrates how writing after seeking 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" ``` -------------------------------- ### Write and Read from KV Cache Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/spiral/roadrunner-kv/README.md Demonstrates how to instantiate the KV factory, select a configured driver ('test'), and perform basic set and get operations on the cache. ```php select('test'); // After that you can write and read arbitrary values: $cache->set('key', 'value'); echo $cache->get('key'); // string(5) "value" ``` -------------------------------- ### Composer Installation: Configure post-install/update scripts Source: https://github.com/easysoft/zentaopms/blob/main/misc/compatibility/PHPCompatibility/README.md Automatically configure PHP CodeSniffer's installed paths when running composer install or update. This is an alternative to using a dedicated Composer plugin. ```json { "scripts": { "post-install-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility", "post-update-cmd" : "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility" } } ``` -------------------------------- ### List and Create Products Source: https://context7.com/easysoft/zentaopms/llms.txt Manage products, which are top-level containers for stories, bugs, and releases. Use query parameters to filter lists. ```bash TOKEN="abc123sessionid" # List all products (page 1, 20 per page) curl -s "https://zentao.example.com/api/v1/products?token=$TOKEN&limit=20&page=1" | jq . # Response: {"page":1,"total":5,"limit":20,"products":[{"id":1,"name":"My App","status":"normal","PO":"admin",...}]} ``` ```bash # List products under a specific program curl -s "https://zentao.example.com/api/v1/products?token=$TOKEN&program=2&status=all&limit=50" | jq . ``` ```bash # Create a product curl -s -X POST "https://zentao.example.com/api/v1/products?token=$TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Mobile App", "PO": "alice", "QD": "bob", "RD": "charlie", "type": "normal", "desc": "Our flagship mobile product", "acl": "open" }' | jq . # Response HTTP 201: full product object ``` ```bash # Get products linked to a project curl -s "https://zentao.example.com/api/v1/products?token=$TOKEN&project=3" | jq . ``` -------------------------------- ### Install Nyholm PSR-7 Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/nyholm/psr7/README.md Use Composer to install the Nyholm PSR-7 package. ```bash composer require nyholm/psr7 ``` -------------------------------- ### Serve PhpSpreadsheet Samples Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/index.md Run the provided samples using PHP's built-in web server. This is useful for exploring the library's capabilities interactively. ```sh php -S localhost:8000 -t vendor/phpoffice/phpspreadsheet/samples ``` -------------------------------- ### Verify PHPCompatibility Installation Source: https://github.com/easysoft/zentaopms/blob/main/misc/compatibility/PHPCompatibility/README.md Run this command to check if PHPCompatibility is correctly registered as an available coding standard with PHP_CodeSniffer. ```bash ./vendor/bin/phpcs -i ``` -------------------------------- ### Install PHPMailer with Composer (CLI) Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpmailer/phpmailer/README.md Run this command in your terminal to install PHPMailer using Composer. ```sh composer require phpmailer/phpmailer ``` -------------------------------- ### Establish RPC Connections with Goridge Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/spiral/goridge/README.md Demonstrates how to create RPC clients using different transport protocols: TCP, Unix sockets, and standard input/output pipes. The factory format is `://:`. ```php call("App.Hi", "Antony"); ``` -------------------------------- ### Run a Specific Sample from Command Line Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/index.md Execute a specific sample script directly from the command line to test its functionality. ```sh php vendor/phpoffice/phpspreadsheet/samples/Basic/01_Simple.php ``` -------------------------------- ### Excel Functions Starting with G Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/references/function-list-by-name.md This section details Excel functions starting with 'G' and their PhpSpreadsheet equivalents. ```APIDOC ## GAMMADIST ### Description Returns the gamma distribution. ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GAMMADIST ## GAMMAINV ### Description Returns the inverse of the gamma distribution. ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GAMMAINV ## GAMMALN ### Description Returns the natural logarithm of the gamma function, LN(Γ(x)). ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GAMMALN ## GCD ### Description Returns the greatest common divisor of two or more integer arguments. ### Category CATEGORY_MATH_AND_TRIG ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::GCD ## GEOMEAN ### Description Returns the geometric mean of the positive numbers in a data set. ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GEOMEAN ## GESTEP ### Description Tests whether a number is greater than a threshold. ### Category CATEGORY_ENGINEERING ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Engineering::GESTEP ## GETPIVOTDATA ### Description Returns data stored in a PivotTable report. ### Category CATEGORY_LOOKUP_AND_REFERENCE ### PhpSpreadsheet Function **Not yet Implemented** ## GROWTH ### Description Returns values that lie along an exponential trend. ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Statistical::GROWTH ``` -------------------------------- ### Package Project for Distribution with Make Source: https://github.com/easysoft/zentaopms/blob/main/CLAUDE.md Use this command to package the project for distribution. This creates distributable archives. ```bash make package ``` -------------------------------- ### Excel Functions Starting with F Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/references/function-list-by-name.md This section details Excel functions starting with 'F' and their PhpSpreadsheet equivalents. ```APIDOC ## FACT ### Description Returns the factorial of a number. ### Category CATEGORY_MATH_AND_TRIG ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::FACT ## FACTDOUBLE ### Description Returns the double factorial of a number. ### Category CATEGORY_MATH_AND_TRIG ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::FACTDOUBLE ## FALSE ### Description Returns the logical value FALSE. ### Category CATEGORY_LOGICAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Logical::FALSE ## FDIST ### Description Returns the F-distribution (BETA.DIST function). ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function **Not yet Implemented** ## FIND ### Description Finds one text value within another (case-sensitive). ### Category CATEGORY_TEXT_AND_DATA ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHSENSITIVE ## FINDB ### Description Finds one text value within another (case-sensitive). ### Category CATEGORY_TEXT_AND_DATA ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\TextData::SEARCHSENSITIVE ## FINV ### Description Returns a number that causes a cumulative probability to equal a given probability. ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function **Not yet Implemented** ## FISHER ### Description Returns a transformation for a correlation or a value. ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Statistical::FISHER ## FISHERINV ### Description Returns a value that is the Fisher transformation of a correlation or a value. ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Statistical::FISHERINV ## FIXED ### Description Formats a number and converts it to a text string. ### Category CATEGORY_TEXT_AND_DATA ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\TextData::FIXEDFORMAT ## FLOOR ### Description Rounds a number up to the nearest odd integer or down to the nearest even integer. ### Category CATEGORY_MATH_AND_TRIG ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::FLOOR ## FORECAST ### Description Returns a value that is on a linear trend line. ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Statistical::FORECAST ## FORMULATEXT ### Description Returns a formula from the specified cell reference as text. ### Category CATEGORY_LOOKUP_AND_REFERENCE ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::FORMULATEXT ## FREQUENCY ### Description Returns a vertical array of numbers that indicates how often values occur within a range of values. ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function **Not yet Implemented** ## FTEST ### Description Returns the result of an F-test. ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function **Not yet Implemented** ## FV ### Description Returns the future value of an investment based on a periodic, constant payment and a constant interest rate. ### Category CATEGORY_FINANCIAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Financial::FV ## FVSCHEDULE ### Description Returns the future value for an investment when the interest rate is applied to the number of periods for which the investment is made. ### Category CATEGORY_FINANCIAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Financial::FVSCHEDULE ``` -------------------------------- ### Excel Functions Starting with E Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/references/function-list-by-name.md This section details Excel functions starting with 'E' and their PhpSpreadsheet equivalents. ```APIDOC ## EDATE ### Description Calculates the date that is a specified number of months before or after a date. ### Category CATEGORY_DATE_AND_TIME ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\DateTime::EDATE ## EFFECT ### Description Returns the effective annual interest rate. ### Category CATEGORY_FINANCIAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Financial::EFFECT ## EOMONTH ### Description Returns the serial number of the last day of the month that is a specified number of months before or after a date's start date. ### Category CATEGORY_DATE_AND_TIME ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\DateTime::EOMONTH ## ERF ### Description Returns the error function, or the integrated function of the error function of a specified value. ### Category CATEGORY_ENGINEERING ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERF ## ERF.PRECISE ### Description Returns the error function, or the integrated function of the error function of a specified value. ### Category CATEGORY_ENGINEERING ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFPRECISE ## ERFC ### Description Returns the complementary error function, or the integrated function of the complementary error function of a specified value. ### Category CATEGORY_ENGINEERING ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC ## ERFC.PRECISE ### Description Returns the complementary error function, or the integrated function of the complementary error function of a specified value. ### Category CATEGORY_ENGINEERING ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Engineering::ERFC ## ERROR.TYPE ### Description Returns a numeric value corresponding to an error type in a cell. ### Category CATEGORY_INFORMATION ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Functions::ERROR_TYPE ## EVEN ### Description Returns the number rounded up to the nearest even integer. ### Category CATEGORY_MATH_AND_TRIG ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::EVEN ## EXACT ### Description Compares two text strings and returns TRUE if they are exactly the same, and FALSE otherwise. ### Category CATEGORY_TEXT_AND_DATA ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\TextData::EXACT ## EXP ### Description Returns e raised to the power of a given number. ### Category CATEGORY_MATH_AND_TRIG ### PhpSpreadsheet Function exp ## EXPONDIST ### Description Returns the exponential distribution. ### Category CATEGORY_STATISTICAL ### PhpSpreadsheet Function \PhpOffice\PhpSpreadsheet\Calculation\Statistical::EXPONDIST ``` -------------------------------- ### Basic Usage and Options Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/overtrue/pinyin/README.md Instantiate the Pinyin class and use the `convert` method with various options to control the output format. ```php use Overtrue\Pinyin\Pinyin; // Default (small memory type) $pinyin = new Pinyin(); // Memory type // $pinyin = new Pinyin('Overtrue\Pinyin\MemoryFileDictLoader'); // I/O type // $pinyin = new Pinyin('Overtrue\Pinyin\GeneratorFileDictLoader'); // Convert with default options (no tone) $pinyin->convert('带着希望去旅行,比到达终点更美好'); // Output: ["dai", "zhe", "xi", "wang", "qu", "lyu", "xing", "bi", "dao", "da", "zhong", "dian", "geng", "mei", "hao"] // Convert with UNICODE tones $pinyin->convert('带着希望去旅行,比到达终点更美好', PINYIN_TONE); // Output: ["dài","zhe","xī","wàng","qù","lǚ","xíng","bǐ","dào","dá","zhōng","diǎn","gèng","měi","hǎo"] // Convert with ASCII tones $pinyin->convert('带着希望去旅行,比到达终点更美好', PINYIN_ASCII_TONE); // Output: ["dai4","zhe","xi1","wang4","qu4","lyu3","xing2","bi3","dao4","da2","zhong1","dian3","geng4","mei3","hao3"] ``` -------------------------------- ### Install PhpSpreadsheet using Composer Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/index.md Use Composer to add PhpSpreadsheet to your project dependencies. Ensure you have Composer installed and configured. ```sh composer require phpoffice/phpspreadsheet ``` -------------------------------- ### Create Distribution Packages with Make Source: https://github.com/easysoft/zentaopms/blob/main/CLAUDE.md These commands create specific distribution packages. 'make pms' creates the standard package, while 'make ci' creates a CI build with all packages. ```bash make pms ``` ```bash make ci ``` -------------------------------- ### Install Overtrue Pinyin with Composer Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/overtrue/pinyin/README.md Use Composer to install the overtrue/pinyin package. Ensure you specify the desired version constraint. ```bash composer require "overtrue/pinyin:~4.0" ``` -------------------------------- ### Install laminas-zendframework-bridge Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/laminas/laminas-zendframework-bridge/README.md Install this library using composer if you are using the composer plugin that replaces ZF/Apigility/Expressive packages with Laminas packages. ```bash composer require laminas/laminas-zendframework-bridge ``` -------------------------------- ### Install Localization Package Source: https://github.com/easysoft/zentaopms/blob/main/lib/sqlparser/vendor/phpmyadmin/sql-parser/README.md Install the phpmyadmin/motranslator package for localizing error messages. Ensure version 5.0 or newer is used. ```sh composer require phpmyadmin/motranslator:^5.0 ``` -------------------------------- ### Configure SVN Client and Repositories in ZenTao Source: https://github.com/easysoft/zentaopms/wiki/Integrate-SVN-and-Git Set the SVN client executable path and repository details, including path, username, and password. Leave username and password blank if no login is required. ```php $config->svn->client = '/usr/bin/svn'; $config->svn->repos[0]->path = 'http://192.168.0.100/svn/myproject'; $config->svn->repos[0]->username = 'admin'; $config->svn->repos[0]->password = '123456'; $config->svn->repos[1]->path = 'svn://192.168.0.101/otherproject'; $config->svn->repos[1]->username = ''; $config->svn->repos[1]->password = ''; ``` -------------------------------- ### Create a Story Source: https://context7.com/easysoft/zentaopms/llms.txt Create a new story for a product. Specify details like title, specification, priority, and category. If a reviewer is specified, the story status defaults to 'reviewing'. ```bash # Create a story curl -s -X POST "https://zentao.example.com/api/v1/stories?token=$TOKEN&product=1" \ -H "Content-Type: application/json" \ -d '{ "title": "User can reset password via email", "spec": "As a registered user, I want to reset my password via email so I can regain access.", "pri": 2, "category": "feature", "type": "story", "estimate": 8, "reviewer": "alice", "branch": 0 }' | jq . ``` -------------------------------- ### Download RoadRunner Application Server Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/spiral/roadrunner-worker/README.md Fetch the latest compatible version of the RoadRunner application server using the CLI. ```bash vendor/bin/rr get ``` -------------------------------- ### List and Create Projects Source: https://context7.com/easysoft/zentaopms/llms.txt Manage projects, which group executions (sprints/iterations) and support Scrum, Waterfall, and Kanban models. Filter lists using query parameters. ```bash # List all projects curl -s "https://zentao.example.com/api/v1/projects?token=$TOKEN&status=all&limit=20&page=1" | jq . # Response: {"page":1,"total":3,"limit":20,"projects":[{"id":1,"name":"Q4 Release","model":"scrum","status":"doing",...}]} ``` ```bash # Create a Scrum project curl -s -X POST "https://zentao.example.com/api/v1/projects?token=$TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Q4 2024 Release", "begin": "2024-10-01", "end": "2024-12-31", "model": "scrum", "products": [1, 2], "PM": "alice", "multiple": "on", "acl": "private" }' | jq . # Response HTTP 201: full project object ``` ```bash # List projects under a program curl -s "https://zentao.example.com/api/v1/projects?token=$TOKEN&program=1&status=doing" | jq . ``` -------------------------------- ### Get Abbreviation String Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/overtrue/pinyin/README.md Get the first character of each Pinyin syllable, with an optional custom separator. Can also preserve numbers or English characters. ```php $pinyin->abbr('带着希望去旅行'); // Output: dzwqlx $pinyin->abbr('带着希望去旅行', '-'); // Output: d-z-x-w-q-l-x // Preserve numbers $pinyin->abbr('你好2018!', PINYIN_KEEP_NUMBER); // Output: nh2018 // Preserve English $pinyin->abbr('Happy New Year! 2018!', PINYIN_KEEP_ENGLISH); // Output: HNY2018 ``` -------------------------------- ### Create Test Case with Steps Source: https://context7.com/easysoft/zentaopms/llms.txt Creates a new test case with a title, type, priority, precondition, and a list of detailed steps. The request body must be JSON, and the API token is required. ```bash curl -s -X POST "https://zentao.example.com/api/v1/testcases?token=$TOKEN&product=1" \ -H "Content-Type: application/json" \ -d '{ "title": "Verify password reset email delivery", "type": "manual", "pri": 2, "stage": "regression", "precondition": "User has a registered account", "steps": [ {"desc": "Navigate to login page", "expect": "Login page is displayed", "type": "step"}, {"desc": "Click Forgot Password", "expect": "Password reset form appears", "type": "step"}, {"desc": "Enter registered email and submit", "expect": "Reset email is sent within 60 seconds", "type": "step"} ] }' | jq . ``` -------------------------------- ### Install APCu Cache Dependencies Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/topics/memory_saving.md Install the necessary packages for using APCu as a cache backend with PhpSpreadsheet. This involves the simple cache bridge and the APCu adapter. ```sh composer require cache/simple-cache-bridge cache/apcu-adapter ``` -------------------------------- ### List Users (Basic) Source: https://context7.com/easysoft/zentaopms/llms.txt Fetches a basic list of users, including their account and real name. Requires a valid API token. For full details, use the `full=1` parameter and appropriate privileges. ```bash curl -s "https://zentao.example.com/api/v1/users?token=$TOKEN&limit=50&page=1" | jq . ``` -------------------------------- ### Basic PHPWord Document Creation and Saving Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpword/README.md Demonstrates the fundamental steps to create a new document, add text with different styling options, and save it in Word2007 (.docx), ODT (.odt), and HTML (.html) formats. ```php addSection(); // Adding Text element to the Section having font styled by default... $section->addText( '"Learn from yesterday, live for today, hope for tomorrow. ' . '(Albert Einstein)' ); /* * Note: it's possible to customize font style of the Text element you add in three ways: * - inline; * - using named font style (new font style object will be implicitly created); * - using explicitly created font style object. */ // Adding Text element with font customized inline... $section->addText( '"Great achievement is usually born of great sacrifice, ' . '(Napoleon Hill)', array('name' => 'Tahoma', 'size' => 10) ); // Adding Text element with font customized using named font style... $fontStyleName = 'oneUserDefinedStyle'; $phpWord->addFontStyle( $fontStyleName, array('name' => 'Tahoma', 'size' => 10, 'color' => '1B2232', 'bold' => true) ); $section->addText( '"The greatest accomplishment is not in never falling, ' . '(Vince Lombardi)', $fontStyleName ); // Adding Text element with font customized using explicitly created font style object... $fontStyle = new \PhpOffice\PhpWord\Style\Font(); $fontStyle->setBold(true); $fontStyle->setName('Tahoma'); $fontStyle->setSize(13); $myTextElement = $section->addText('"Believe you can and you\'re halfway there." (Theodor Roosevelt)'); $myTextElement->setFontStyle($fontStyle); // Saving the document as OOXML file... $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007'); $objWriter->save('helloWorld.docx'); // Saving the document as ODF file... $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'ODText'); $objWriter->save('helloWorld.odt'); // Saving the document as HTML file... $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML'); $objWriter->save('helloWorld.html'); /* Note: we skip RTF, because it's not XML-based and requires a different example. */ /* Note: we skip PDF, because "HTML-to-PDF" approach is used to create PDF documents. */ ``` -------------------------------- ### MONTH Function Example Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/topics/calculation-engine.md Shows how to use the MONTH function to extract the month from a date. Examples cover both worksheet formulas and direct static function calls. ```php $worksheet->setCellValue('A1', 'Date String'); $worksheet->setCellValue('A2', '31-Dec-2008'); $worksheet->setCellValue('A3', '14-Feb-2008'); $worksheet->setCellValue('B2', '=MONTH(A2)'); $worksheet->setCellValue('B3', '=MONTH(A3)'); $retVal = $worksheet->getCell('B2')->getCalculatedValue(); // $retVal = 12 $retVal = $worksheet->getCell('B3')->getCalculatedValue(); // $retVal = 2 ``` ```php $retVal = call_user_func_array( ['\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'MONTHOFYEAR'], ['14-July-2008'] ); // $retVal = 7 ``` -------------------------------- ### Install Redis Cache Dependencies Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/topics/memory_saving.md Install the required Composer packages to use Redis as a cache backend for PhpSpreadsheet. This includes the simple cache bridge and the Redis adapter. ```sh composer require cache/simple-cache-bridge cache/redis-adapter ``` -------------------------------- ### Installing Requests with Composer Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/rmccue/requests/README.md Instructions for adding the Requests library to your PHP project using Composer. This is the recommended method for managing dependencies. ```sh composer require rmccue/requests ``` -------------------------------- ### Write a String Starting with Equals Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/topics/recipes.md If you need to write a string that literally starts with an equals sign, use setCellValueExplicit with the data type set to TYPE_STRING to prevent it from being interpreted as a formula. ```php $spreadsheet->getActiveSheet() ->setCellValueExplicit( 'B8', '=IF(C4>500,"profit","loss")', \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING ); ``` -------------------------------- ### MINUTE Function Example Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/topics/calculation-engine.md Illustrates the usage of the MINUTE function to extract the minutes from a time value. Examples include using cell formulas and direct static function calls. ```php $worksheet->setCellValue('A1', 'Time String') ->setCellValue('A2', '31-Dec-2008 17:30') ->setCellValue('A3', '14-Feb-2008 4:20 AM') ->setCellValue('A4', '14-Feb-2008 4:45 PM'); $worksheet->setCellValue('B2', '=MINUTE(A2)') ->setCellValue('B3', '=MINUTE(A3)') ->setCellValue('B4', '=MINUTE(A4)'); $retVal = $worksheet->getCell('B2')->getCalculatedValue(); // $retVal = 30 $retVal = $worksheet->getCell('B3')->getCalculatedValue(); // $retVal = 20 $retVal = $worksheet->getCell('B4')->getCalculatedValue(); // $retVal = 45 ``` ```php $retVal = call_user_func_array( ['\PhpOffice\PhpSpreadsheet\Calculation\Functions', 'MINUTE'], ['09:30'] ); // $retVal = 30 ``` -------------------------------- ### Get AutoFilter Object and Column Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/topics/autofilters.md Retrieve the AutoFilter object for the active worksheet and then get a specific column object to apply filter expressions. This is the initial step for creating custom filters. ```php $autoFilter = $spreadsheet->getActiveSheet()->getAutoFilter(); $columnFilter = $autoFilter->getColumn('C'); ``` -------------------------------- ### Create PDF Writer Instance Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpoffice/phpspreadsheet/docs/topics/reading-and-writing-to-file.md Instantiate a PDF writer using the IOFactory, specifying the desired PDF rendering library (e.g., 'Mpdf'). ```php $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Mpdf'); ``` -------------------------------- ### Get PSR-7 Stream Contents Source: https://github.com/easysoft/zentaopms/blob/main/framework/zand/vendor/psr/http-message/docs/PSR7-Usage.md Retrieve the entire content of a PSR-7 stream as a string using `getContents()`. Ensure the stream is rewound using `rewind()` or `seek(0)` before reading to get all content. ```php $body = $response->getBody(); $body->rewind(); // or $body->seek(0); $bodyText = $body->getContents(); ``` -------------------------------- ### Install phpseclib 3.0 via Composer Source: https://github.com/easysoft/zentaopms/blob/main/lib/vendor/phpseclib/phpseclib/README.md Use this command to install the latest long-term support (LTS) release of phpseclib, which requires PHP 5.6.1 or higher and uses PSR-4 autoloading with the \phpseclib3 namespace. ```sh composer require phpseclib/phpseclib:~3.0 ```