Giter Site home page Giter Site logo

disco-demos's People

Contributors

shochdoerfer avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

disco-demos's Issues

Expressive demo

It works nicely with expressive, however I would stick a bit more to the default expressive structure. This has a few advantages:

  • It's easier when someone wants to change to disco
  • You keep the autoload config functionality in case you need to change settings locally for development or production
  • I don't think you want everything in that App\Config class. e.g. if you have 50+ routes, you might want them organized within the config/autoload path.
  • Eventually it would be easier to integrate with the expressive skeleton

Files you need to get this working:

  • ./config/config.php
    Add this file back and change the last line to

    return $config;
  • ./config/container.php

    <?php
    
    use bitExpert\Disco\BeanFactoryConfiguration;
    use bitExpert\Disco\AnnotationBeanFactory;
    use bitExpert\Disco\BeanFactoryRegistry;
    
    // Load configuration
    $config = require __DIR__ . '/config.php';
    
    // Build container
    $beanConfig = new BeanFactoryConfiguration($config['di']['cache']);
    $container = new AnnotationBeanFactory($config['di']['config'], ['expressive' => $config], $beanConfig);
    BeanFactoryRegistry::register($container);
    
    return $container;
  • ./config/autoload/disco.global.php

    <?php
    
    return [
        'di' => [
            'config' => \App\Config::class,
            'cache'  => sys_get_temp_dir(),
        ],
    ];
  • ./src/App/Config.php
    Obviously you want that file.

Other files like public/index.php don't need to be changed this way.

And finally integrating this with the expressive installer will be a nice challenge.

  • The Disco container should only be available when PHP7+ is detected.
  • Testing can be done only when PHP7 is loaded on travis or locally.
    Maybe check the php version and mark the test as skipped if it's not compatible?
  • Some of the standard configuration files need to be changed (like removing dependencies). One solution could be to generate the config files on the fly and use print_r to regenerate those?
  • Also ./src/App/Config.php needs to be generated somehow in case different routers and template engines are going to be installed.

/cc @shochdoerfer @weierophinney

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.