Newscoop dependency management and autoloading with composer
  • I had a brief look at the next branch. 
    Currently the 3rd party libraries and dependencies are spread through the whole project (dependencies, newscoop/library, vendor etc.) and are loaded in various fashions. All deps are just checked into the repo (hard copies). Cloning the repo takes ages and consumes over 200mb of bandwidth. It´s a mess.

    As you already have a composer.json in the next branch, I suggest making use of it.

    I slightly modified application.php and added the following deps to composer
            "zendframework/zendframework1": ">=1.12",
            "symfony/dependency-injection": "2.0.15",
            "symfony/event-dispatcher": "2.0.15",
            "doctrine/orm": "2.1.*",

    Which works so far.
    Additionally I also tried to install smarty3 and Nette through composer - ran into some minor loading and BC issues.
    Pretty much all of your 3rd party libraries(smarty3, Nette, symfony/event&di etc.) are outdated by the way ;)

    You guys want a PR with my composer changes?
    I would be great to manage all the vendor libraries with composer in the near future, starting with the ones available through packagist, pear and git.

    Cheers
    Leander
  • 6 Comments sorted by
  • hi leander,

    good point. i've started using composer for travis ci but didn't manage to finish the transfer so far.
    PR would be great.

    petr
  • Hey Leander,

    Yep, this is a good point indeed, pull request is very welcome. Thanks.

    All Best,
  • Could someone give me some details on the versions of the used vendor libraries?
    Are we willing to replace outdated libraries with more up2date/stable ones? How much refactoring work does that involve for each component?

    so far I have a working state of Newscoop with composer
    - ZendFramework 1.12
    - Doctrine 2.1.*

    but need help with:
    - symfony/dependency-injection (https://github.com/fabpot/dependency-injection ?)
    - symfony/event-dispatcher (where did that exactly come from? symfony2 3 years ago?)
    - Nette (not fully PSR-0 compliant?, current stable seems to have changed a lot?)
    - Smarty3 (current stable version has minor BC breaks with version currently used)
    Ist there a list of Newscoops Pear dependencies somewhere?

    With composer it is a good practice to define/pin to a versions explicitly rather then just going for dev-master.
    At what point should libraries be removed from the repo, once they are managed through composer?
    So suggestions, which version to stick with and where to upgrade and what to replace would be great!!
  • zend 1.11+
    doctrine 2.1.*

    those symfony components are both from that github.com/fabpot and are pre php 5.3,
    refactoring here should be renaming classes/methods. personaly i would go for extending those
    in Newscoop namespace and provide those missing methods.

    from nette we use only some image handling, any 2.0 version should work fine.

    smarty 3.1 might require some changes in our dbcache adapter and maybe some of the custom plugins

    list of pear dependencies is in wiki.

    the idea would be to get rid of those pear dependencies, some functionality is provided by zend framework, some by doctrine etc. i might start removing adodb and php-db and provide that func via some doctrine connection decorator. at some point we should only use composer for dependencies.
  • see my pull request - https://github.com/sourcefabric/Newscoop/pull/1
    I tried to pin down smarty,sfDi, sfEvent etc. to the versions already used.
    I wasn't able to sucessfully run the unit tests due to an local old version of phpUnit (and could not be bothered to update - pains of PEAR)
    Hopefully travis-ci will run these Tests for me <3

    cheers
    Leander
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Leander,

    > Currently the 3rd party libraries and dependencies are spread through
    > the whole project (dependencies, newscoop/library, vendor etc.) and are
    > loaded in various fashions. All deps are just checked into the repo
    > (hard copies). Cloning the repo takes ages and consumes over 200mb of
    > bandwidth.

    This has also proved to be a challenge for Debian/Ubuntu packaging,
    where code copies are not allowed. I have opened a ticket:

    http://dev.sourcefabric.org/browse/CS-4396

    Thanks for your work on this :-)

    Cheers!

    Daniel