Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #18977 > unrolled thread

composer: dependences and dependents

Started bySupaPlex <old@gamer.s>
First post2022-06-22 11:08 +0200
Last post2022-06-24 13:31 +0200
Articles 8 — 2 participants

Back to article view | Back to comp.lang.php


Contents

  composer: dependences and dependents SupaPlex <old@gamer.s> - 2022-06-22 11:08 +0200
    Re: composer: dependences and dependents Arno Welzel <usenet@arnowelzel.de> - 2022-06-22 14:33 +0200
      Re: composer: dependences and dependents SupaPlex <old@gamer.s> - 2022-06-22 15:12 +0200
        Re: composer: dependences and dependents Arno Welzel <usenet@arnowelzel.de> - 2022-06-22 16:07 +0200
          Re: composer: dependences and dependents SupaPlex <old@gamer.s> - 2022-06-22 16:35 +0200
            Re: composer: dependences and dependents Arno Welzel <usenet@arnowelzel.de> - 2022-06-22 16:37 +0200
              Re: composer: dependences and dependents SupaPlex <old@gamer.s> - 2022-06-22 17:13 +0200
                Re: composer: dependences and dependents Arno Welzel <usenet@arnowelzel.de> - 2022-06-24 13:31 +0200

#18977 — composer: dependences and dependents

FromSupaPlex <old@gamer.s>
Date2022-06-22 11:08 +0200
Subjectcomposer: dependences and dependents
Message-ID<t8um63$n4e$1@gioia.aioe.org>
$ cat .composer/config.json
{
     "repositories": {
         "a": {
             "type": "path",
             "url": "repo/a"
         },
         "b": {
             "type": "path",
             "url": "repo/b"
         },
         "c": {
             "type": "path",
             "url": "repo/c"
         }
     }
}
$ cat repo/a/composer.json
{
     "name": "my/a",
     "require": {
         "my/b": "dev-master"
     }
}
$ cat repo/b/composer.json
{
     "name": "my/b",
     "require": {
         "my/c": "dev-master"
     }
}
$ cat repo/c/composer.json
{
     "name": "my/c"
}

How do you see

my/a requires my/b
my/b requires my/c

But I wanted to know if there is a way to view *quickly* the whole 
structure of dependences.
Above all, I would like to know the *dependents*.

I tried like this

$ COMPOSER_HOME=.composer composer show -a my/b
No composer.json found in the current directory, showing available 
packages from a, b, c, packagist.org
name     : my/b
descrip. :
keywords :
versions : dev-master
type     : library
homepage :
source   : []
dist     : [path] repo/b 6de0f9e677dcab7051f94dbbf05893d0165bb826
names    : my/b

requires
my/c dev-master

In summary

$ COMPOSER_HOME=.composer composer show -a my/b \
   | grep my/
No composer.json found in the current directory, showing available 
packages from a, b, c, packagist.org
name     : my/b
names    : my/b
my/c dev-master

It tell me that

my/b requires my/c

but it doesn't tell me that

my/b is required from my/a (this is the thing that interests me most).

For example, if I have to remove a package (obsolete package), how can I 
verify that it does not have dependents?

[toc] | [next] | [standalone]


#18978

FromArno Welzel <usenet@arnowelzel.de>
Date2022-06-22 14:33 +0200
Message-ID<jhggfvF10g9U1@mid.individual.net>
In reply to#18977
SupaPlex:

[...]
> For example, if I have to remove a package (obsolete package), how can I 
> verify that it does not have dependents?

You can try: composer show --tree




-- 
Arno Welzel
https://arnowelzel.de

[toc] | [prev] | [next] | [standalone]


#18979

FromSupaPlex <old@gamer.s>
Date2022-06-22 15:12 +0200
Message-ID<t8v4f0$18r6$1@gioia.aioe.org>
In reply to#18978
Il 22/06/22 14:33, Arno Welzel ha scritto:
> SupaPlex:
> 
> [...]
>> For example, if I have to remove a package (obsolete package), how can I
>> verify that it does not have dependents?
> 
> You can try: composer show --tree
> 
> 
> 
> 

Composer could not find a composer.json file
To initialize a project, please create a composer.json file as described 
in the https://getcomposer.org/ "Getting Started" section

[toc] | [prev] | [next] | [standalone]


#18980

FromArno Welzel <usenet@arnowelzel.de>
Date2022-06-22 16:07 +0200
Message-ID<jhgm0bF1stnU1@mid.individual.net>
In reply to#18979
SupaPlex:

> Il 22/06/22 14:33, Arno Welzel ha scritto:
>> SupaPlex:
>>
>> [...]
>>> For example, if I have to remove a package (obsolete package), how can I
>>> verify that it does not have dependents?
>>
>> You can try: composer show --tree
>>
>>
>>
>>
> 
> Composer could not find a composer.json file
> To initialize a project, please create a composer.json file as described 
> in the https://getcomposer.org/ "Getting Started" section

Why do you try to use Composer outside a folder with composer.json?

Of course you need to call this inside repo/a, repo/b and repo/c.


-- 
Arno Welzel
https://arnowelzel.de

[toc] | [prev] | [next] | [standalone]


#18981

FromSupaPlex <old@gamer.s>
Date2022-06-22 16:35 +0200
Message-ID<t8v9bt$1pci$1@gioia.aioe.org>
In reply to#18980
Il 22/06/22 16:07, Arno Welzel ha scritto:
> Why do you try to use Composer outside a folder with composer.json?

why shouldn't I do it?

[toc] | [prev] | [next] | [standalone]


#18982

FromArno Welzel <usenet@arnowelzel.de>
Date2022-06-22 16:37 +0200
Message-ID<jhgnpaF264jU1@mid.individual.net>
In reply to#18981
SupaPlex:

> Il 22/06/22 16:07, Arno Welzel ha scritto:
>> Why do you try to use Composer outside a folder with composer.json?
> 
> why shouldn't I do it?

Because composer.json is the file where your dependencies are defined.

Also see: <https://getcomposer.org/doc/01-basic-usage.md>


-- 
Arno Welzel
https://arnowelzel.de

[toc] | [prev] | [next] | [standalone]


#18983

FromSupaPlex <old@gamer.s>
Date2022-06-22 17:13 +0200
Message-ID<t8vbif$tvi$2@gioia.aioe.org>
In reply to#18982
Il 22/06/22 16:37, Arno Welzel ha scritto:
> SupaPlex:
> 
>> Il 22/06/22 16:07, Arno Welzel ha scritto:
>>> Why do you try to use Composer outside a folder with composer.json?
>>
>> why shouldn't I do it?
> 
> Because composer.json is the file where your dependencies are defined.
> 
> Also see: <https://getcomposer.org/doc/01-basic-usage.md>
> 
> 

What dependencies should i define?
The info I want is for packages global level, not for single project 
(*/composer.json).

-----BEGIN PGP MESSAGE-----

hQGMAyHa6HqE1N3qAQv+JiLsavPR603Uiqd2XvBLMV0UIp+6RmdSADu6E+MVIf/H
xWGPN68rIfRxVoQptDQRX8nW3EkA7/2agJKLhjbiNs6MuWz9M62pBcGArL1q2p7T
tiHqtPpW5nVN87hPZPi/NO6Lb/B6mW0Eytj4PsAL977oUeK1iFaxnMSGCfeBCnH3
yZVI1CoM4e5bSA668avRxMItFeIkY0+uRhPzHcvrT1/MJy/NDdil9sHoJGDj0YC/
5nwfP8FtkbU31N3xsH/2jW7OtGllN3ef1zNbiCnrNmLfMWEjPKiU451qU8qpC7mZ
WQ4xwprnxb2gTs4JxqLNEuWSRIz34K4sDb215edkWdlY3n8xk7kABscyaLv9ZP2w
as2n2dgp7o3VAR+skNh8Qp6jDrwpa8MSxhRzOw3QX+Nq3cGtm1TQeTHLvJ3n5Dzi
0xS93r+cUM6iDEtG2gXWoJUKdlmDVyp7fetVN4/6iybN6BdxWtlA7wG6b+Tq494T
R9B5fWnwUMQJIFo3rVlj0oEB1N3inMgJmdGriviq27JtTcoAhQq6ElnJ9DwZAmqT
j9ffYkhB6DuX4NsFDNg/MU6m+UAqEpySIX2Cm4pIjmEicQGsu1EhupfaA+SFFDA3
kJByFSdczDn/DJwln+iXwdNTOhDs7G11o0NxaLbi6tEL+dlEsolXMAOEmu9s0oiP
Nsg=
=hSlH
-----END PGP MESSAGE-----

[toc] | [prev] | [next] | [standalone]


#18984

FromArno Welzel <usenet@arnowelzel.de>
Date2022-06-24 13:31 +0200
Message-ID<jhlljoFqgl7U1@mid.individual.net>
In reply to#18983
SupaPlex:

> Il 22/06/22 16:37, Arno Welzel ha scritto:
>> SupaPlex:
>>
>>> Il 22/06/22 16:07, Arno Welzel ha scritto:
>>>> Why do you try to use Composer outside a folder with composer.json?
>>>
>>> why shouldn't I do it?
>>
>> Because composer.json is the file where your dependencies are defined.
>>
>> Also see: <https://getcomposer.org/doc/01-basic-usage.md>
>>
>>
> 
> What dependencies should i define?
> The info I want is for packages global level, not for single project 
> (*/composer.json).

There is no "global" level.

Each composer.json defines the dependencies for that very project. There
are no "global" dependencies covering multiple projects. If a project
wants to uses a component, it *must* have a reference for that in
composer.json. The specific version used when installing the components
using "composer install" are then recorded in composer.lock.


-- 
Arno Welzel
https://arnowelzel.de

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web