Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fadilxcoder/packagist

Packagist - Testing multiple packages codebase
https://github.com/fadilxcoder/packagist

notes packagist php poc

Last synced: 5 days ago
JSON representation

Packagist - Testing multiple packages codebase

Awesome Lists containing this project

README

        

# Resources

- https://getcomposer.org/doc/articles/scripts.md#command-events - Composer Command Events

```
"scripts": {
"post-install-cmd": "execute a command here", # occurs after the install command has been executed with a lock file present.
"post-update-cmd": "cghooks update", # occurs after the update command has been executed, or after the install command has been executed without a lock file present.
...
},
```

- https://packagist.org/packages/tracy/tracy - Debugger

- https://packagist.org/packages/fzaninotto/faker - Fake data generator

- https://packagist.org/packages/brainmaestro/composer-git-hooks - Git hooks in your composer config
- - https://git-scm.com/docs/githooks
- - Run `composer update` to update hooks if modify

- https://packagist.org/packages/dompdf/dompdf - DOM pdf

- https://packagist.org/packages/nategood/httpful - PHP HTTP Client

- https://packagist.org/packages/squizlabs/php_codesniffer - CodeSniffer
- - https://github.com/squizlabs/PHP_CodeSniffer/wiki/Reporting - Reporting
- - http://manpages.ubuntu.com/manpages/bionic/man1/phpcs.1.html - Manual
- - Use `dos2unix ` : Convert DOS file to UNIX format
- - Run `vendor/bin/phpcs ` and get errors
- - E.g `phpcs --report=code $(ls *.php) > file.txt`

- `composer require league/fractal` - (https://fractal.thephpleague.com/)
- /fractal.php

- https://craig.is/writing/chrome-logger (Debugging server side applications in the Chrome console.)
- https://github.com/ccampbell/chromephp (Chrome)
- Activate **Chrome Logger** in chrome web browser to see debugging codes in console.

# Set Up - docker version

- Clone docker branch (Dockerize the environment)
- GOTO `src`
- Clone master branch (Source Code)

# Notes

- `image-file.php` - never execute in browser, used as a template and rendered dynamically in `index.php`
- PHPCS
- - Exec in terminal `./phpcs/bin.sh`
- - Create `phpcs/report.txt` -> `phpcs/index.html` (HTML report)
- Git Hooks in `composer.json` on commit changes

# Script to combine HTML/CSS into inline styles

- https://packagist.org/packages/tijsverkoyen/css-to-inline-styles
- Install `composer require tijsverkoyen/css-to-inline-styles`
- HTML page
```


FX




PSB Logo + Text

fadilxcoder 🎉

Design, Develop, Deploy !




```

- PHP script
```
require 'vendor/autoload.php';

use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;

// create instance
$cssToInlineStyles = new CssToInlineStyles();

$html = file_get_contents(__DIR__ . '/html-page.html');
$css = file_get_contents("https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css");

// output

echo $cssToInlineStyles->convert(
$html,
$css
);

```

# Git hook

`.git\hooks\pre-commit`

```bash
#!/bin/bash

echo committing as $(git config user.name)
#./vendor/bin/phpcs --report=code $(ls *.php) > ./phpcs/report.txt
#./phpcs/bin.sh

```

# Selenium - Automated testing

- Download driver : https://chromedriver.chromium.org/downloads (*Chrome version 110*)
- Launch chrome driver : `./chromedriver.exe --port=4444`
- GIT repo : https://github.com/php-webdriver/php-webdriver
- Download JAR : https://www.selenium.dev/downloads/ (*Latest stable version 4.8.0*)
- CLI : `java -jar selenium-server-4.8.0.jar`
- GOTO : http://localhost/packagist/selenium

# Addons.



php-8-new-string-functions.jpg


proxy.jpg