[General] Add support for installing dependencies through composer

Review Request #515 — Created April 24, 2017 and submitted

p.valk
Lunr
composer
lunr

Added Composer.json

manual

  • 0
  • 0
  • 34
  • 4
  • 38
Description From Last Updated
pprkut
  1. 
      
  2. composer.json (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    Can you explain some more on what this all means?

    1. repositories points to custom repositories to search for the versions we want.
      require is a list of what librarys we need and which version of those libraries.
      of some libraries we want a specific git commit, we need to do this in a specific style dev-'branch name'#'commit hash'
      the config "optimize-autoloader": true makes composer optimise its output, the install process is a bit slower but they recommend to use this on live to make to compuser loader process faster.

    2. Then I don't think we need to point to repos that are already the default, no?

  3. composer.lock (Diff revision 1)
     
     

    Do we really want the lock file in the repo?

    1. well they advice to put it in the repo, this way everyone will have the same version of the libraries. (when doing compose install)
      when you update composer update the lock file changes and this would be reflected in the reviews/git.

      i agree this seems usefull.

    2. Fair enough

  4. tests/test.bootstrap.inc.php (Diff revision 1)
     
     

    this will fail if it's not present. Composer must stay optional

  5. 
      
p.valk
pprkut
  1. 
      
  2. composer.lock (Diff revision 2)
     
     

    this is too new. We need 1.7

  3. composer.lock (Diff revision 2)
     
     

    wrong repo

  4. tests/test.bootstrap.inc.php (Diff revision 2)
     
     
     
     
     
     

    First, this needs to be the other way around.
    Second, even the other way around is still wrong, because also include_once barks if the file does not exist.

    1. ah my mistake, replaced the wrong one.
      include only barks, whats wrong with that? it doesnt crash~

  5. 
      
p.valk
pprkut
  1. 
      
  2. tests/test.bootstrap.inc.php (Diff revisions 2 - 3)
     
     

    this is not how it works...

    1. why not? stream_resolve_include_path returns the absolute path.

    2. stream_resolve_include_path() is file_exists()

  3. tests/test.bootstrap.inc.php (Diff revisions 2 - 3)
     
     

    "else" is fine

  4. 
      
p.valk
pprkut
  1. Looks better now, but the pecl extensions are missing :)

  2. 
      
p.valk
pprkut
  1. 
      
  2. composer.json (Diff revision 5)
     
     
     
     
     
     
     
     

    missing at least:
    - mysqlnd_ms
    - msgpack

    maybe also
    - gettext
    - mysqli

  3. composer.json (Diff revision 5)
     
     

    where is this needed?

    1. i got this of the list from Sean.

    2. i cant find it in the lunr project, i'l remove it from the list.

  4. 
      
smillernl
  1. 
      
  2. composer.json (Diff revision 5)
     
     
     

    these are from our own clones

    1. add php-resque repo from m2mobi.

  3. tests/test.bootstrap.inc.php (Diff revision 5)
     
     

    this can be anywhere, doesn't have to be in this directory.

    1. set a config key so the vendor directory is always at the same place.

    2. That was not the point. The point was that stream_resolve_include_path() could pick up any vendor/vendor.php, not specifically the one from Lunr.

  4. 
      
smillernl
  1. 
      
  2. tests/test.bootstrap.inc.php (Diff revision 5)
     
     

    should be vendor/autoload.php

  3. 
      
p.valk
pprkut
  1. 
      
  2. composer.json (Diff revisions 5 - 6)
     
     
     
     
     
     
     
     
     

    Explanations here need to get to the point where people actually know what this is needed for. At the very least this needs to mention the packages they are used in, and even better would be if they mentioned for what.

  3. composer.lock (Diff revisions 5 - 6)
     
     

    I don't think that's the case anymore

  4. 
      
p.valk
smillernl
  1. 
      
  2. composer.json (Diff revision 7)
     
     
     
     

    why is this in here twice?

  3. composer.json (Diff revision 7)
     
     

    this is default

  4. composer.json (Diff revision 7)
     
     

    shouldn't this be src/Lunr/?

  5. tests/test.bootstrap.inc.php (Diff revision 7)
     
     

    RTFM / try again

  6. 
      
p.valk
p.valk
pprkut
  1. 
      
  2. composer.json (Diff revision 9)
     
     
     
     
     
     
     
     
     
     
     

    should non-pecl extension be listed here too?

    1. possible, suggest will only give a notification so you can add anything you want.

    2. You can grep for "requires extension" and add the missing ones

  3. composer.json (Diff revision 9)
     
     

    I'd just reduce this to "Needed for mocking in unit tests"

    1. NR in latest change.

  4. composer.json (Diff revision 9)
     
     

    "Needed for unit tests"

    1. NR in latest change.

  5. composer.json (Diff revision 9)
     
     

    "Extended" suggests there's "Basic" HTTP support without it, which is not true. Also, Shadow is not supporting HTTP at all. It's using pecl_http for other reasons

  6. composer.json (Diff revision 9)
     
     

    you can skip the libcapn part

  7. 
      
p.valk
pprkut
  1. 
      
  2. composer.json (Diff revisions 9 - 10)
     
     
     
     
     
     
     
     
     

    probably need to require a specific PHP version too, which would need to be 5.6 in our case.

  3. composer.json (Diff revisions 9 - 10)
     
     

    Missing the requirement for Shadow

  4. composer.json (Diff revisions 9 - 10)
     
     
     
     
     
     

    what are those version supposed to denote?

    1. suggested versions

    2. ok, then pls fix the versions for gettext and mysqli

    3. well those are versions i got reported by composer xD
      not sure which versions we need/use?
      both of them the pecl pages are dead too.

    4. Both of them are core extensions, not pecl.

  5. composer.json (Diff revisions 9 - 10)
     
     

    1.0.4 should be good enough

  6. composer.json (Diff revisions 9 - 10)
     
     

    not new enough

  7. composer.lock (Diff revisions 9 - 10)
     
     

    I don't think this will work

  8. 
      
p.valk
pprkut
  1. 
      
  2. composer.json (Diff revisions 10 - 11)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    I think these should be less exact. It's unlikely that someone else will just include all of Lunr in their project (particularly because I won't put it on packagist), but if someone would do it, the exact versions would cause conflicts.
    Just stick to the respective stable branches, except for the ones that need specific versions (mysqldn_ms, php-resque, apns-php)

  3. 
      
p.valk
pprkut
  1. 
      
  2. composer.json (Diff revisions 11 - 12)
     
     

    ">=" is no good, since it doesn't shield against API breaks. There's a different operator for staying on the same stable branch

    1. you mean the Next Significant Release Operators?

    2. yes

  3. 
      
p.valk
pprkut
  1. 
      
  2. composer.json (Diff revisions 12 - 13)
     
     

    xdebug doesn't need to be that strict. I think ~2.4 should be fine

  3. composer.lock (Diff revisions 12 - 13)
     
     

    We need svn revision 335219, which is 2 years newer than 1.6.0

    1. this one? http://svn.php.net/viewvc?view=revision&revision=335219

    2. yes

  4. 
      
p.valk
pprkut
  1. 
      
  2. composer.json (Diff revisions 13 - 14)
     
     

    typically svn revisions are noted as r335219, is the format a given from composer's side?

    1. i didnt know that. but its just a suggestion. composer will never install it automatically from this point.

  3. 
      
smillernl
  1. 
      
  2. composer.json (Diff revision 14)
     
     

    you can also use UOPZ as per my latest review

    1. currently we are not using UOPZ yet right?

    2. We are, but only for PHP7

  3. 
      
p.valk
p.valk
p.valk
pprkut
  1. 
      
  2. composer.json (Diff revision 15)
     
     

    this is non-functional

    1) we have PHP 5.6 as required, but uopz 5 is PHP 7 only
    2) it's either runkit or uopz, not both. They don't even run on the same PHP version

    1. so either we move them both to suggested or make the composer file only for php 5.6; this as it already recuires php version 5.6.*.

    2. I'd just move uopz to suggests and note when it is needed.

  3. 
      
smillernl
  1. 
      
  2. composer.lock (Diff revision 15)
     
     

    Should be 5.7.*

    1. That's the phpunit requirement of php-resque, not ours

  3. 
      
p.valk
p.valk
Review request changed

Status: Closed (submitted)

Change Summary:

Merged fixed version into master

Loading...