Give thanks (in the form of a GitHub ★) to your fellow PHP package maintainers

Related tags

Strings thanks
Overview

Give thanks (in the form of a GitHub ★ ) to your fellow PHP package maintainers (not limited to Symfony components)!

Install

Install this as any other (dev) Composer package:

$ composer require --dev symfony/thanks

You can also install it once for all your local projects:

$ composer global require symfony/thanks

Usage

$ composer thanks

This will find all of your Composer dependencies, find their github.com repository, and star their GitHub repositories. This was inspired by cargo thanks, which was inspired in part by Medium's clapping button as a way to show thanks for someone else's work you've found enjoyment in.

If you're wondering why did some dependencies get thanked and not others, the answer is that this plugin only supports github.com at the moment. Pull requests are welcome to add support for thanking packages hosted on other services.

Original idea by Doug Tangren (softprops) 2017 for Rust (thanks!)

Implemented by Nicolas Grekas (SensioLabs & Blackfire.io) 2017 for PHP.

Forwarding stars

Package authors can send a star to another package that they would like to thank.

If you are a package author and want to thank another repository, you can add a thanks entry in the extra section of your composer.json file.

For example, symfony/webpack-encore-pack sends a star to symfony/webpack-encore:

{
    "extra": {
        "thanks": {
            "name": "symfony/webpack-encore",
            "url": "https://github.com/symfony/webpack-encore"
        }
    }
}
Comments
  • star only direct dependencies

    star only direct dependencies

    It seems the plugin currently sends stars to all dependencies of a project, including the dependencies of the the libraries you actually added to your composer file.

    It would be nice if there would be an option to star the explicit dependencies only.

    opened by splitbrain 12
  • Issue with Composer 2 PreFileDownloadEvent

    Issue with Composer 2 PreFileDownloadEvent

    After https://github.com/composer/composer/commit/5c13c974286969e4c5298e74c1a3ee66ef6e2bef, symfony/thanks breaks with the following error:

    PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function Composer\Plugin\PreFileDownloadEvent::__construct(),
    3 passed in /var/www/html/site/vendor/symfony/thanks/src/GitHubClient.php on line 191
    and at least 4 expected in phar:///home/eddie/bin/composer2/src/Composer/Plugin/PreFileDownloadEvent.php:54
    

    I'm not sure what the 4th parameter should be here? The commit above uses package and metadata. Maybe metadata?

    Maybe @Seldaek could tell more.

    opened by emodric 7
  • composer thanks works but getting

    composer thanks works but getting "[Composer\Downloader\TransportException]"

    Hello,

    I'm proud to have finally run composer thanks on a small project I developed :smiley:
    But after running it, I get the following error :

    [Composer\Downloader\TransportException]                                                      
      The "https://api.github.com/graphql" file could not be downloaded (HTTP/1.1 502 Bad Gateway)
    

    I thought it hadn't worked, but after looking at the issues mentionning graphql in this repo, I realized it had actually worked & I'm now starring the ~ hundred repos I use in the project. Still, I was wondering why there was this mistake and if it was normal, thought I'd tell you about it.

    Have a nice day :)

    opened by rooselle 6
  • "composer thanks" returning an exception

    Hello, just installed this package and when I'm running the command "composer thanks" in the root of my repo, composer thanks return me :

    [ErrorException]
    Undefined index: data

    and just after :

    thanks [--dry-run]

    I checked on two packages on GitHub and no stars have been given to them.

    opened by InfRandomness 6
  • Add support for composer-plugin-api v2

    Add support for composer-plugin-api v2

    Composer version 2 has composer-plugin-api version 2, and this plugin attemts to support both API versions.

    See What's new in Composer 2 and UPGRADE-2.0 for more changes in API.

    • Empty methods \Symfony\Thanks\Thanks::deactivate() and \Symfony\Thanks\Thanks::uninstall() are added to make it compatible both versions.
    • On Composer v2, \Hirak\Prestissimo\CurlRemoteFilesystem is not used in favor of Composer's native \Composer\Util\HttpDownloader which make multiple Curl connections.

    Related: #84 and composer/composer#8726.

    thanks 🙏

    opened by Ayesh 5
  • Error when running command on my project.

    Error when running command on my project.

    If a package repository cannot be resolved, the thank command fail and not complete other repositories thank.

    composer thanks --dry-run -vvv
    Reading ./composer.json
    Loading config file /Users/dev/.composer/config.json
    Loading config file /Users/dev/.composer/auth.json
    Loading config file ./composer.json
    Checked CA file /private/etc/ssl/cert.pem: valid
    Executing command (/Users/dev/projects/myproject): git branch --no-color --no-abbrev -v
    Reading /Users/dev/.composer/composer.json
    Loading config file /Users/dev/.composer/config.json
    Loading config file /Users/dev/.composer/auth.json
    Loading config file /Users/dev/.composer/composer.json
    Loading config file /Users/dev/.composer/auth.json
    Reading /Users/dev/.composer/auth.json
    Reading /Users/dev/projects/myproject/vendor/composer/installed.json
    Reading /Users/dev/.composer/vendor/composer/installed.json
    Loading plugin cweagans\Composer\Patches
    Loading plugin PackageVersions\Installer
    Loading plugin Symfony\Flex\Flex
    Composer >=1.7 not found, downloads will happen in sequence
    Loading plugin Symfony\Thanks\Thanks
    Running 1.6.5 (2018-05-04 11:44:59) with PHP 7.2.5 on Darwin / 17.5.0
    Reading ./composer.json
    Downloading https://api.github.com/graphql
    
    
      [Composer\Downloader\TransportException]
      Could not resolve to a Repository with the name 'jmespath'.
    
    
    Exception trace:
     () at /Users/dev/.composer/vendor/symfony/thanks/src/Command/ThanksCommand.php:222
     Symfony\Thanks\Command\ThanksCommand->callGitHub() at /Users/dev/.composer/vendor/symfony/thanks/src/Command/ThanksCommand.php:171
     Symfony\Thanks\Command\ThanksCommand->execute() at phar:///usr/local/Cellar/composer/1.6.4/bin/composer/vendor/symfony/console/Command/Command.php:242
     Symfony\Component\Console\Command\Command->run() at phar:///usr/local/Cellar/composer/1.6.4/bin/composer/vendor/symfony/console/Application.php:843
     Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/Cellar/composer/1.6.4/bin/composer/vendor/symfony/console/Application.php:193
     Symfony\Component\Console\Application->doRun() at phar:///usr/local/Cellar/composer/1.6.4/bin/composer/src/Composer/Console/Application.php:251
     Composer\Console\Application->doRun() at phar:///usr/local/Cellar/composer/1.6.4/bin/composer/vendor/symfony/console/Application.php:117
     Symfony\Component\Console\Application->run() at phar:///usr/local/Cellar/composer/1.6.4/bin/composer/src/Composer/Console/Application.php:100
     Composer\Console\Application->run() at phar:///usr/local/Cellar/composer/1.6.4/bin/composer/bin/composer:59
     require() at /usr/local/Cellar/composer/1.6.4/bin/composer:24
    
    opened by Webonaute 5
  • Can't thank anyone

    Can't thank anyone

    I'm running this on my machine:

     $ composer thanks -vvv
    Reading ./composer.json
    Loading config file ./composer.json
    Checked CA file E:\dev\cacert.pem: valid
    Executing command (e:\dev\www\corahn_rin): git branch --no-color --no-abbrev -v
    Reading C:/Users/Pierstoval/AppData/Roaming/Composer/composer.json
    Loading config file C:/Users/Pierstoval/AppData/Roaming/Composer/composer.json
    Reading e:\dev\www\corahn_rin/vendor/composer/installed.json
    Reading C:/Users/Pierstoval/AppData/Roaming/Composer/vendor/composer/installed.json
    Loading plugin PackageVersions\Installer
    Loading plugin Pyrech\ComposerChangelogs\ChangelogsPlugin
    Loading plugin Symfony\Flex\Flex
    Loading plugin Hirak\Prestissimo\Plugin
    Loading plugin Symfony\Thanks\Thanks
    Running 1.8.4 (2019-02-11 10:52:10) with PHP 7.3.1 on Windows NT / 10.0
    Reading ./composer.json
    Downloading https://api.github.com/graphql
    Executing command (CWD): git config github.accesstoken
    Downloading https://api.github.com/graphql
    Executing command (CWD): git config github.accesstoken
    Downloading https://api.github.com/graphql
    Executing command (CWD): git config github.accesstoken
    Downloading https://api.github.com/graphql
    Executing command (CWD): git config github.accesstoken
    Downloading https://api.github.com/graphql
    # ... goes on and on like this
    

    What could be causing this issue?

    Running 1.8.4 (2019-02-11 10:52:10) with PHP 7.3.1 on Windows NT / 10.0

    opened by Pierstoval 4
  • Feature Idea: Also watch for new releases

    Feature Idea: Also watch for new releases

    Github recently introduced the new "Releases only" watch option for repositories.

    grafik

    https://github.com/isaacs/github/issues/410#issuecomment-442385230

    The idea is: Introduce a new flag or command to not just "star" the repo but also mark it as "watch for new releases".

    Let me know what you think about it.

    opened by mablae 4
  • Exception when running composer update

    Exception when running composer update

    When I run composer update I get the following exception:

    Writing lock file
    Generating autoload files
    composer/package-versions-deprecated: Generating version class...
    composer/package-versions-deprecated: ...done generating version class
    134 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    PHP Fatal error:  Uncaught Error: Call to undefined method Composer\Util\StreamContextFactory::getTlsDefaults() in /Users/loevgaard/.composer/vendor/composer/composer/src/Composer/Util/HttpDownloader.php:63
    Stack trace:
    #0 /Users/loevgaard/PhpstormProjects/SyliusMailchimpPlugin/vendor/symfony/thanks/src/GitHubClient.php(103): Composer\Util\HttpDownloader->__construct(Object(Composer\IO\ConsoleIO), Object(Composer\Config))
    #1 /Users/loevgaard/PhpstormProjects/SyliusMailchimpPlugin/vendor/symfony/thanks/src/Thanks.php(81): Symfony\Thanks\GitHubClient->__construct(Object(Composer\Composer), Object(Composer\IO\ConsoleIO))
    #2 [internal function]: Symfony\Thanks\Thanks->displayReminder(Object(Composer\Script\Event))
    #3 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Composer\Script\Event))
    #4 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(96): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Script\Event))
    #5 phar: in /Users/loevgaard/.composer/vendor/composer/composer/src/Composer/Util/HttpDownloader.php on line 63
    
    Fatal error: Uncaught Error: Call to undefined method Composer\Util\StreamContextFactory::getTlsDefaults() in /Users/loevgaard/.composer/vendor/composer/composer/src/Composer/Util/HttpDownloader.php:63
    Stack trace:
    #0 /Users/loevgaard/PhpstormProjects/SyliusMailchimpPlugin/vendor/symfony/thanks/src/GitHubClient.php(103): Composer\Util\HttpDownloader->__construct(Object(Composer\IO\ConsoleIO), Object(Composer\Config))
    #1 /Users/loevgaard/PhpstormProjects/SyliusMailchimpPlugin/vendor/symfony/thanks/src/Thanks.php(81): Symfony\Thanks\GitHubClient->__construct(Object(Composer\Composer), Object(Composer\IO\ConsoleIO))
    #2 [internal function]: Symfony\Thanks\Thanks->displayReminder(Object(Composer\Script\Event))
    #3 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Composer\Script\Event))
    #4 phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(96): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Script\Event))
    #5 phar: in /Users/loevgaard/.composer/vendor/composer/composer/src/Composer/Util/HttpDownloader.php on line 63
    

    My composer version:

    $ composer --version
    Composer version 1.10.17 2020-10-30 22:31:58
    
    opened by loevgaard 2
  • syntax error, unexpected '}'

    syntax error, unexpected '}'

    Parse error: syntax error, unexpected '}' in symfony/thanks/src/GitHubClient.php on line 108
    

    You are missing a ; on line 107.

    $this->rfs = new HttpDownloader($io, $composer->getConfig())
    
    opened by tanthammar 2
  • Star only root dependencies

    Star only root dependencies

    There is a lot of people arguing against Symfony/Thanks because they don't think it's useful/relevant/whatever.

    Mitchell on the public slack pointed something interesting (link):

    Mitchell: If symfony/thanks would only star the top level dependencies them I wouldn't mind (as much). Starring every depedency that a package has seems a bit overkill, especially if that depedency should have been a suggest and not an actual require (and I'm sure there a lot of those).

    IMO this is a great idea: we actually better like the dependencies we really add to the project, but sometimes we just don't care about our deps' deps, because well it ends up starring tons of projects on Github we wouldn't even be interested about, just because our dependencies depend on them.

    Imagine doing a "thanks" plugin for NodeJS: one run would star hundreds of projects that are not really useful but just depended on because of legacy/bad practices/whatever issue that is not yet fixed via npm audit fix... For PHP it could be the same for some old versions of some packages, that's why root deps only is maybe a better option.

    And it better reflects the real popularity of a package.

    Proposal:

    • Either star root dependencies only by default and add --with-dependencies option to star other packages.
    • Or just keep the current behavior and add --root-only|--root option.

    WDYT?

    opened by Pierstoval 2
Releases(v1.2.10)
Owner
Symfony
Symfony
A PHP string manipulation library with multibyte support. Compatible with PHP 5.4+, PHP 7+, and HHVM.

A PHP string manipulation library with multibyte support. Compatible with PHP 5.4+, PHP 7+, and HHVM. s('string')->toTitleCase()->ensureRight('y') ==

Daniel St. Jules 2.5k Dec 28, 2022
"結巴"中文分詞:做最好的 PHP 中文分詞、中文斷詞組件。 / "Jieba" (Chinese for "to stutter") Chinese text segmentation: built to be the best PHP Chinese word segmentation module.

jieba-php "結巴"中文分詞:做最好的 PHP 中文分詞、中文斷詞組件,目前翻譯版本為 jieba-0.33 版本,未來再慢慢往上升級,效能也需要再改善,請有興趣的開發者一起加入開發!若想使用 Python 版本請前往 fxsjy/jieba 現在已經可以支援繁體中文!只要將字典切換為 bi

Fukuball Lin 1.2k Dec 31, 2022
highlight.php is a server-side syntax highlighter written in PHP that currently supports 185 languages

highlight.php is a server-side syntax highlighter written in PHP that currently supports 185 languages. It's a port of highlight.js by Ivan Sagalaev that makes full use of the language and style definitions of the original JavaScript project.

Geert Bergman 633 Dec 27, 2022
Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.

Motto: "Every business should have a detection script to detect mobile readers." About Mobile Detect is a lightweight PHP class for detecting mobile d

Şerban Ghiţă 10.2k Jan 4, 2023
A PHP library for generating universally unique identifiers (UUIDs).

ramsey/uuid A PHP library for generating and working with UUIDs. ramsey/uuid is a PHP library for generating and working with universally unique ident

Ben Ramsey 11.9k Jan 8, 2023
👮 A PHP desktop/mobile user agent parser with support for Laravel, based on Mobiledetect

Agent A PHP desktop/mobile user agent parser with support for Laravel, based on Mobile Detect with desktop support and additional functionality. Insta

Jens Segers 4.2k Jan 5, 2023
A lightweight php class for formatting sql statements. Handles automatic indentation and syntax highlighting.

SqlFormatter A lightweight php class for formatting sql statements. It can automatically indent and add line breaks in addition to syntax highlighting

Jeremy Dorn 3.9k Jan 1, 2023
A PHP string manipulation library with multibyte support

A PHP string manipulation library with multibyte support. Compatible with PHP 5.4+, PHP 7+, and HHVM. s('string')->toTitleCase()->ensureRight('y') ==

Daniel St. Jules 2.5k Jan 3, 2023
A sane interface for php's built in preg_* functions

Making regex great again Php's built in preg_* functions require some odd patterns like passing variables by reference and treating false or null valu

Spatie 1.1k Jan 4, 2023
A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.

URLify for PHP A fast PHP slug generator and transliteration library, started as a PHP port of URLify.js from the Django project. Handles symbols from

Aband*nthecar 667 Dec 20, 2022
🉑 Portable UTF-8 library - performance optimized (unicode) string functions for php.

?? Portable UTF-8 Description It is written in PHP (PHP 7+) and can work without "mbstring", "iconv" or any other extra encoding php-extension on your

Lars Moelleken 474 Dec 22, 2022
ColorJizz is a PHP library for manipulating and converting colors.

#Getting started: ColorJizz-PHP uses the PSR-0 standards for namespaces, so there should be no trouble using with frameworks like Symfony 2. ###Autolo

Mikeemoo 281 Nov 25, 2022
🔡 Portable ASCII library - performance optimized (ascii) string functions for php.

?? Portable ASCII Description It is written in PHP (PHP 7+) and can work without "mbstring", "iconv" or any other extra encoding php-extension on your

Lars Moelleken 380 Jan 6, 2023
:clamp: HtmlMin: HTML Compressor and Minifier via PHP

??️ HtmlMin: HTML Compressor and Minifier for PHP Description HtmlMin is a fast and very easy to use PHP library that minifies given HTML5 source by r

Lars Moelleken 135 Dec 8, 2022
Extensive, portable and performant handling of UTF-8 and grapheme clusters for PHP

Patchwork UTF-8 for PHP Patchwork UTF-8 gives PHP developpers extensive, portable and performant handling of UTF-8 and grapheme clusters. It provides

Nicolas Grekas 80 Sep 28, 2022
PHP library to parse urls from string input

Url highlight - PHP library to parse URLs from string input. Works with complex URLs, edge cases and encoded input. Features: Replace URLs in string b

Volodymyr Stelmakh 77 Sep 16, 2022
A lightweight php class for formatting sql statements. Handles automatic indentation and syntax highlighting.

SqlFormatter A lightweight php class for formatting sql statements. It can automatically indent and add line breaks in addition to syntax highlighting

Jeremy Dorn 3.9k Jan 3, 2023
:accept: Stringy - A PHP string manipulation library with multibyte support, performance optimized

?? Stringy A PHP string manipulation library with multibyte support. Compatible with PHP 7+ 100% compatible with the original "Stringy" library, but t

Lars Moelleken 144 Dec 12, 2022
Paranoid text spacing in PHP

pangu.php Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width charac

Clancey Lin 79 May 29, 2022