### Install Github OAuth2 Provider Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/league/oauth2-github/README.md Install the package using Composer. ```bash composer require league/oauth2-github ``` -------------------------------- ### Install Buzz HTTP Client Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/nyholm/psr7/README.md Install the kriswallsmith/buzz package for sending HTTP requests. ```bash composer require kriswallsmith/buzz ``` -------------------------------- ### Install Laminas HttpHandlerRunner Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/nyholm/psr7/README.md Install the laminas/laminas-httphandlerrunner package for emitting HTTP responses. ```bash composer require laminas/laminas-httphandlerrunner ``` -------------------------------- ### Install getallheaders for PHP >= 5.6 Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/ralouphie/getallheaders/README.md Use this command to install the library for PHP versions 5.6 and above. ```bash composer require ralouphie/getallheaders ``` -------------------------------- ### Install getallheaders for PHP < 5.6 Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/ralouphie/getallheaders/README.md Use this command to install the library for PHP versions older than 5.6. ```bash composer require ralouphie/getallheaders "^2" ``` -------------------------------- ### Copy Example .env File Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/docker/README.md Copies the example environment file to be used for Docker configuration. This should be done in the project root directory. ```bash cp -n .env.example .env ``` -------------------------------- ### Install TableDnD with bower Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/node_modules/tablednd/README.md Install TableDnD using bower by referencing its GitHub repository. ```bash bower install https://github.com/isocra/TableDnD.git ``` -------------------------------- ### Install league/oauth2-google with Composer Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/league/oauth2-google/README.md Use Composer to install the library. This is the standard method for managing PHP dependencies. ```sh composer require league/oauth2-google ``` -------------------------------- ### Install Composer PCRE Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/composer/pcre/README.md Install the latest version of the composer/pcre library using Composer. ```bash $ composer require composer/pcre ``` -------------------------------- ### Install FastRoute using Composer Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/nikic/fast-route/README.md Install the FastRoute library using Composer. Requires PHP 5.4 or newer. ```sh composer require nikic/fast-route ``` -------------------------------- ### Install Mark Baker Complex Library Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/markbaker/complex/README.md Use Composer to install the complex number library. ```shell composer require markbaker/complex:^1.0 ``` -------------------------------- ### Install fig/http-message-util via Composer Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/fig/http-message-util/README.md Install the package as a Composer requirement. ```bash $ composer require fig/http-message-util ``` -------------------------------- ### Install TableDnD with npm Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/node_modules/tablednd/README.md Use npm to install the TableDnD package for your project. ```bash npm install --save tablednd ``` -------------------------------- ### Install PHPMatrix using Composer Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/markbaker/matrix/README.md Use Composer to install the PHPMatrix library. Ensure you specify version 3.0 or higher. ```shell composer require markbaker/matrix:^3.0 ``` -------------------------------- ### Install GitLab OAuth 2.0 Provider Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/omines/oauth2-gitlab/README.md Install the package using Composer. GitLab 8.17 or later is required. ```bash composer require omines/oauth2-gitlab ``` -------------------------------- ### Start Testlink with Docker Compose Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/docker/README.md Starts Testlink services in detached mode using Docker Compose. Ensure the `.env` file is correctly configured. ```bash docker compose up -d ``` -------------------------------- ### Install Composer Dependencies Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/phpoffice/phpspreadsheet/README.md After configuring composer.json, run this command to install or update your project's dependencies based on the specified platform requirements. ```sh composer install ``` -------------------------------- ### Install Guzzle using Composer Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/guzzlehttp/guzzle/README.md The recommended method for installing Guzzle is through Composer. This command adds Guzzle to your project's dependencies. ```bash composer require guzzlehttp/guzzle ``` -------------------------------- ### Template Plugin Example Function Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/third_party/tinymce/examples/example_template.htm A JavaScript function demonstrating custom logic within a TinyMCE template plugin. It uses a prompt to get user input for a color. ```javascript function exampleTemplateFunction(elm) { elm.innerHTML = prompt("Please enter your favourite colour.", "Color"); } ``` -------------------------------- ### Basic ADOdb Connection and Query Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/adodb/adodb-php/README.md Demonstrates how to establish a database connection using ADOdb, enable debugging, and execute a simple query to fetch data. Ensure the correct driver and connection details are provided. ```php debug = true; $db->connect($server, $user, $password, $database); $rs = $db->execute('select * from some_small_table'); print "
";
print_r($rs->getRows());
print "
"; ``` -------------------------------- ### Install Nyholm PSR-7 Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/nyholm/psr7/README.md Use Composer to install the nyholm/psr7 package. ```bash composer require nyholm/psr7 ``` -------------------------------- ### Basic FastRoute Usage Example Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/nikic/fast-route/README.md Demonstrates how to set up a simple dispatcher, add routes with different HTTP methods and URI patterns, and dispatch an incoming request. Handles cases for not found, method not allowed, and found routes. ```php addRoute('GET', '/users', 'get_all_users_handler'); // {id} must be a number (\d+) $r->addRoute('GET', '/user/{id:\d+}', 'get_user_handler'); // The /{title} suffix is optional $r->addRoute('GET', '/articles/{id:\d+}[/{title}]', 'get_article_handler'); }); // Fetch method and URI from somewhere $httpMethod = $_SERVER['REQUEST_METHOD']; $uri = $_SERVER['REQUEST_URI']; // Strip query string (?foo=bar) and decode URI if (false !== $pos = strpos($uri, '?')) { $uri = substr($uri, 0, $pos); } $uri = rawurldecode($uri); $routeInfo = $dispatcher->dispatch($httpMethod, $uri); switch ($routeInfo[0]) { case FastRoute\Dispatcher::NOT_FOUND: // ... 404 Not Found break; case FastRoute\Dispatcher::METHOD_NOT_ALLOWED: $allowedMethods = $routeInfo[1]; // ... 405 Method Not Allowed break; case FastRoute\Dispatcher::FOUND: $handler = $routeInfo[1]; $vars = $routeInfo[2]; // ... call $handler with $vars break; } ``` -------------------------------- ### Basic ZipStream-PHP Usage Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/maennchen/zipstream-php/README.md This example demonstrates how to create a zip archive, add files with content, and add files from local paths. Ensure dependencies are autoloaded. ```php // Autoload the dependencies require 'vendor/autoload.php'; // enable output of HTTP headers $options = new ZipStream\Option\Archive(); $options->setSendHttpHeaders(true); // create a new zipstream object $zip = new ZipStream\ZipStream('example.zip', $options); // create a file named 'hello.txt' $zip->addFile('hello.txt', 'This is the contents of hello.txt'); // add a file named 'some_image.jpg' from a local file 'path/to/image.jpg' $zip->addFileFromPath('some_image.jpg', 'path/to/image.jpg'); // finish the zip stream $zip->finish(); ``` -------------------------------- ### Initialize and Use FogBugz API Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/third_party/fogbugz-php-api/README.markdown Demonstrates how to instantiate the FogBugz API class, log in, and start work on a specific bug. ```php $fogbugz = new FogBugz( 'username@example.com', 'password', 'http://example.fogbugz.com' ); $fogbugz->logon(); $fogbugz->startWork(array( 'ixBug' => 23442 )); ``` -------------------------------- ### Install Smarty Development Wrapper Package Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/smarty/smarty/README.md Install the 'smarty-dev' package which acts as a wrapper to install all three core Smarty packages (smarty, smarty-phpunit, smarty-lexer) for version 3.1.19. ```json "require": { "smarty/smarty-dev": "3.1.19" } ``` -------------------------------- ### Install PHP Enum via Composer Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/myclabs/php-enum/README.md Use Composer to install the myclabs/php-enum library. ```bash composer require myclabs/php-enum ``` -------------------------------- ### Creating Enum Instances Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/myclabs/php-enum/README.md Demonstrates various ways to create instances of an enum. Use static methods for direct access, dynamic keys, or the `from()` method for dynamic values. Direct instantiation with `new Action($value)` is also possible. ```php $action = Action::VIEW(); // or with a dynamic key: $action = Action::$key(); // or with a dynamic value: $action = Action::from($value); // or $action = new Action($value); ``` -------------------------------- ### Install Nyholm PSR-7 Server Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/nyholm/psr7/README.md Install the nyholm/psr7-server package to create server requests from superglobals. ```bash composer require nyholm/psr7-server ``` -------------------------------- ### Configure Memcache and Cache Settings in DSN Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/adodb/adodb-php/docs/changelog.md Example of how to specify memcache servers, port, compression, and cache expiration time within the DSN string. ```php # we have a memcache servers mem1,mem2 on port 8888, compression=off and cachesecs=120 $dsn = 'mysql://user:pwd@localhost/mydb?memcache=mem1,mem2:8888:0&cachesecs=120'; ``` -------------------------------- ### Basic HTTP Request and Response Handling in PHP Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/guzzlehttp/guzzle/README.md Demonstrates sending a GET request and accessing response details like status code, headers, and body. Also shows how to send an asynchronous request and wait for its completion. ```php $client = new \GuzzleHttp\Client(); $response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); echo $response->getStatusCode(); // 200 echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8' echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}' // Send an asynchronous request. $request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); $promise = $client->sendAsync($request)->then(function ($response) { echo 'I completed! ' . $response->getBody(); }); $promise->wait(); ``` -------------------------------- ### Instantiating Chosen with Options Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/third_party/chosen/options.html Demonstrates how to initialize Chosen on a select element with custom options for search and display. ```javascript $(".my_select_box").chosen({ disable_search_threshold: 10, no_results_text: "Oops, nothing found!", width: "95%" }); ``` -------------------------------- ### Install PHPMailer via Composer CLI Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/phpmailer/phpmailer/README.md Run this command in your project directory to install PHPMailer using Composer. ```sh composer require phpmailer/phpmailer ``` -------------------------------- ### Install PhpSpreadsheet via Composer Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/phpoffice/phpspreadsheet/README.md Use Composer to add PhpSpreadsheet to your project dependencies. This is the standard method for installation. ```sh composer require phpoffice/phpspreadsheet ``` -------------------------------- ### Restore Sample Database Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/docker/README.md Restores the sample database for Testlink using a dedicated Docker Compose service. This is useful for initial setup or testing. ```bash docker compose up testlink-restore ``` -------------------------------- ### Basic ZipStream PHP Usage Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/maennchen/zipstream-php/guides/index.rst Demonstrates how to create a zip archive, add files by content, from a local path, and from a stream resource, and then finish the stream. ```php // Autoload the dependencies require 'vendor/autoload.php'; // enable output of HTTP headers $options = new ZipStream\Option\Archive(); $options->setSendHttpHeaders(true); // create a new zipstream object $zip = new ZipStream\ZipStream('example.zip', $options); // create a file named 'hello.txt' $zip->addFile('hello.txt', 'This is the contents of hello.txt'); // add a file named 'some_image.jpg' from a local file 'path/to/image.jpg' $zip->addFileFromPath('some_image.jpg', 'path/to/image.jpg'); // add a file named 'goodbye.txt' from an open stream resource $fp = tmpfile(); fwrite($fp, 'The quick brown fox jumped over the lazy dog.'); rewind($fp); $zip->addFileFromStream('goodbye.txt', $fp); fclose($fp); // finish the zip stream $zip->finish(); ``` -------------------------------- ### Get All Enum Names: myclabs/php-enum vs Native Enum Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/myclabs/php-enum/README.md Illustrates how to get a list of all possible enum names. ```php Action::keys() ``` ```php array_map(fn($case) => $case->name, Action::cases()) ``` -------------------------------- ### Get Enum Key/Name: myclabs/php-enum vs Native Enum Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/myclabs/php-enum/README.md Explains how to get the name or key of an enum instance. ```php $enumCase->getKey() ``` ```php $enumCase->name ``` -------------------------------- ### Configure SELinux for TestLink Source: https://github.com/testlinkopensourcetrms/testlink-code/wiki/TestLink-Installation-on-CentOS Apply SELinux context to the TestLink directory to allow the Apache web server to read and write content. This is crucial for preventing 'directory is not writable' errors. ```bash chcon -R -t httpd_sys_rw_content_t /var/www/html/ ``` -------------------------------- ### Get and Set CSS Properties with jQuery Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/docs/REST-API/newman/newman-run-report.html Use the `css()` method to get or set CSS properties for elements. When setting, you can pass a single property-value pair or an object of multiple properties. When getting, it returns the computed style for the first element in the set. ```javascript m.extend({ cssHooks:{ opacity:{ get: function(a,b){ if(b){ var c = Jb(a, "opacity"); return "" === c ? "1" : c; } } }}, cssNumber:{ columnCount:!0, fillOpacity:!0, flexGrow:!0, flexShrink:!0, fontWeight:!0, lineHeight:!0, opacity:!0, order:!0, orphans:!0, widows:!0, zIndex:!0, zoom:!0 }, cssProps:{ "float": m.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function(a, b, c, d) { if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) { var e, f, g, h = m.camelCase(b), i = a.style; if (b = m.cssProps[h] || (m.cssProps[h] = Ub(i, h)), g = m.cssHooks[b] || m.cssHooks[h], void 0 === c) return g && "get" in g && void 0 !== (e = g.get(a, !1, d)) ? e : i[b]; if (f = typeof c, "string" === f && (e = Qb.exec(c)) && (c = (e[1] + 1) * e[2] + parseFloat(m.css(a, b))), null != c && c === c && ("number" !== f || m.cssNumber[h] || (c += "px"), k.clearCloneStyle || "" !== c || 0 !== b.indexOf("background") || (i[b] = "inherit"), !(g && "set" in g && void 0 == (c = g.set(a, c, d))))) try { i[b] = c; } catch (j) {} } }, css: function(a, b, c, d) { var e, f, g, h = m.camelCase(b); return b = m.cssProps[h] || (m.cssProps[h] = Ub(a.style, h)), g = m.cssHooks[b] || m.cssHooks[h], g && "get" in g && (f = g.get(a, !0, c)), void 0 === f && (f = Jb(a, b, d)), "normal" === f && b in Sb && (f = Sb[b]), "" === c || c ? (e = parseFloat(f), c === !0 || m.isNumeric(e) ? e || 0 : f) : f } }), ``` -------------------------------- ### Install Specific Smarty 3.1 Version Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/smarty/smarty/README.md Install a particular version of Smarty 3.1 by specifying the exact version number in your composer.json. ```json "require": { "smarty/smarty": "3.1.19" } ``` -------------------------------- ### Install Mark Baker Complex Functions Library Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/vendor/markbaker/complex/README.md Use Composer to install the complex functions library, recommended for version 3.0 and above. ```shell composer require markbaker/complex-functions:^3.0 ``` -------------------------------- ### Docker Compose for Testlink Setup Source: https://github.com/testlinkopensourcetrms/testlink-code/blob/testlink_1_9_20_fixed/README.containers.md Defines the services, networks, and volumes required to run Testlink and its dependencies using Docker Compose. Includes configurations for MySQL database, Maildev for email testing, the Testlink application, and a restore utility. ```yaml networks: testlink: name: testlink services: db: image: mysql:8.3.0 networks: - testlink restart: unless-stopped user: mysql environment: - MYSQL_USER=teste - MYSQL_PASSWORD=teste - MYSQL_ROOT_PASSWORD=teste - MYSQL_DATABASE=testlink volumes: - mysql:/var/lib/mysql maildev: image: maildev/maildev:latest networks: - testlink ports: - 1080:1080 - 1025:1025 restart: unless-stopped environment: - NODE_TLS_REJECT_UNAUTHORIZED=0 app: image: ghcr.io/neiesc/testlink-code:testlink_1_9_20_fixed restart: unless-stopped depends_on: db: condition: service_started maildev: condition: service_started networks: - testlink ports: - 8090:80 volumes: - ./logs:/var/testlink/logs:Z - ./upload_area:/var/testlink/upload_area:Z restore: <<: *app depends_on: app: condition: service_started restart: no ports: [] profiles: - tools command: ['/bin/bash', '-c', 'cd ./docs/db_sample && ./restore_sample.sh'] volumes: mysql: ``` -------------------------------- ### Create TestLink Log and Upload Directories Source: https://github.com/testlinkopensourcetrms/testlink-code/wiki/TestLink-Installation-on-CentOS Create directories for TestLink logs and uploads, and set their ownership to the Apache user and group. These directories are essential for TestLink's operation. ```bash mkdir -p /var/testlink/logs ``` ```bash mkdir -p /var/testlink/upload_area ``` ```bash chown -R apache:apache /var/testlink/* ``` ```bash chown -R apache:apache /var/testlink ```