driftphp/demo

Demo not working

jdecool opened this issue · 12 comments

Hi,

I want to test this demo, but it's not working.

After clone the project and install dependencies through Composer, I try to run the server using vendor/bin/server run 0.0.0.0:8100 --dev --debug.

I have a first error :

In FileLocator.php line 71:
                                                                                                         
  The file "../..//Controller" does not exist (in: /home/jdecool/Workspace/external/demo/Drift/config).  

I solved it by update this line with :

parameters:
    kernel.secret: yoursecretshouldbehere
    app.path: '../../src'

After that, I try to start the server again, but I have an another error :

In ClassExistenceResource.php line 150:
                                                                                                                                                     
  Class "Symfony\Component\DependencyInjection\ServiceSubscriberInterface" not found while loading "Symfony\Bundle\FrameworkBundle\Routing\Router".

@jdecool hello!
Yes!
Working on it!
Tomorrow will be working properly :D

@jdecool Could you update the dependencies? And if you have local changes, just back them to the demo code.

Thanks!

Thanks @mmoreram

Still have the same issue with Class "Symfony\Component\DependencyInjection\ServiceSubscriberInterface" not found while loading "Symfony\Bundle\FrameworkBundle\Routing\Router".

I clone the repo, install dependencies and run vendor/bin/server run 0.0.0.0:8100 --dev --debug command.

Capture d’écran_2019-11-26_20-27-37

@jdecool interesting. Is the first time I see this error.
Can you remove cache?

rm -Rf var/*

OK, I've find something interesting.

I try the demo on 2 machines.

The first one (which have the problem) is a PC which Linux Mint (latest release) using PHP 7.4.0.
The demo is not working even if I remove the var folder.

Then I try on a another machine. A Macbook (with the latest OS version) using php 7.3.12.
It's working with this configuration.

So it's maybe a problem with PHP 7.4.0 ?

@jdecool thanks for that review :D

Yes.
Probably.
In fact, and because this framework is still on alpha, not even beta, I'm thinking seriously to make PHP7.4 as the minimum PHP version.
What do you think?

@jdecool I've tested the demo in PHP7.4, and works properly.
I'm really interested in checking what the problem is :S
Seems a dependency problem...

Can you make composer update?

I just make a new try, have the same error.

I paste my PHP informations:

$ php -v

PHP 7.4.0 (cli) (built: Nov 28 2019 07:27:06) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.0, Copyright (c), by Zend Technologies
    with Xdebug v2.8.0, Copyright (c) 2002-2019, by Derick Rethans

And I share a video of what I've made :
https://drive.google.com/open?id=1BE15MgiNKX7Fl6Mo1yZZKlnu1wOqOJbE

OK. I need one more thing.
Can you paste here the result of composer show ?

Sure.

$ composer show

alecrabbit/php-cli-snake                  0.5.0    Lightweight cli spinner with zero dependencies
cakephp/core                              3.8.6    CakePHP Framework Core classes
cakephp/utility                           3.8.6    CakePHP Utility classes such as Inflector, String, Hash, and Security
clue/redis-protocol                       v0.3.1   A streaming redis wire protocol parser and serializer implementation in PHP
clue/redis-react                          v2.3.0   Async Redis client implementation, built on top of ReactPHP.
doctrine/inflector                        1.3.1    Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator                     1.3.0    A small, lightweight utility to instantiate objects in PHP without invoki...
drift/http-kernel                         0.1.1    Http Kernel component for Drift, based on Symfony Http Kernel component
drift/react-functions                     0.1.0    Lightweight library that provides regular PHP methods is a non-blocking i...
drift/redis-bundle                        0.1.0   
drift/server                              0.1.1    ReactPHP based server for DriftPHP
evenement/evenement                       v3.0.1   Événement is a very simple event dispatching library for PHP
indigophp/hash-compat                     v1.1.0   Backports hash_* functionality to older PHP versions
mmoreram/base-bundle                      2.0.1    Base Bundle for all standard Symfony Bundles
mmoreram/symfony-bundle-dependencies      2.2.0    Dependencies resolver for Symfony Bundles
paragonie/random_compat                   v9.99.99 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
psr/cache                                 1.0.1    Common interface for caching libraries
psr/container                             1.0.0    Common Container Interface (PHP FIG PSR-11)
psr/http-message                          1.0.1    Common interface for HTTP messages
psr/log                                   1.1.2    Common interface for logging libraries
react/cache                               v1.0.0   Async, Promise-based cache interface for ReactPHP
react/child-process                       v0.6.1   Event-driven library for executing child processes with ReactPHP.
react/dns                                 v1.2.0   Async DNS resolver for ReactPHP
react/event-loop                          v1.1.0   ReactPHP's core reactor event loop that libraries can use for evented I/O.
react/filesystem                          v0.1.2   Asynchronous filesystem abstraction.
react/http                                v0.8.5   Event-driven, streaming plaintext HTTP and secure HTTPS server for ReactPHP
react/promise                             v2.7.1   A lightweight implementation of CommonJS Promises/A for PHP
react/promise-stream                      v1.2.0   The missing link between Promise-land and Stream-land for ReactPHP
react/promise-timer                       v1.5.1   A trivial implementation of timeouts for Promises, built on top of ReactPHP.
react/socket                              v1.3.0   Async, streaming plaintext TCP/IP and secure TLS socket server and client...
react/stream                              v1.1.0   Event-driven readable and writable streams for non-blocking I/O in ReactPHP
ringcentral/psr7                          1.2.2    PSR-7 message implementation
seregazhuk/php-watcher                    v0.5.1   Automatically restart PHP application once the source code changes
symfony/cache                             v5.0.0   Symfony Cache component with PSR-6, PSR-16, and tags
symfony/cache-contracts                   v2.0.0   Generic abstractions related to caching
symfony/config                            v5.0.0   Symfony Config Component
symfony/console                           v4.4.0   Symfony Console Component
symfony/debug                             v4.4.0   Symfony Debug Component
symfony/dependency-injection              v5.0.0   Symfony DependencyInjection Component
symfony/dotenv                            v4.4.0   Registers environment variables from a .env file
symfony/error-handler                     v4.4.0   Symfony ErrorHandler Component
symfony/event-dispatcher                  v4.4.0   Symfony EventDispatcher Component
symfony/event-dispatcher-contracts        v1.1.7   Generic abstractions related to dispatching event
symfony/filesystem                        v5.0.0   Symfony Filesystem Component
symfony/finder                            v4.4.0   Symfony Finder Component
symfony/framework-bundle                  v4.4.0   Symfony FrameworkBundle
symfony/http-foundation                   v5.0.0   Symfony HttpFoundation Component
symfony/http-kernel                       v4.4.0   Symfony HttpKernel Component
symfony/mime                              v5.0.0   A library to manipulate MIME messages
symfony/polyfill-ctype                    v1.12.0  Symfony polyfill for ctype functions
symfony/polyfill-intl-idn                 v1.12.0  Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-mbstring                 v1.12.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php72                    v1.12.0  Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php73                    v1.12.0  Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/routing                           v5.0.0   Symfony Routing Component
symfony/service-contracts                 v2.0.0   Generic abstractions related to writing services
symfony/stopwatch                         v4.4.0   Symfony Stopwatch Component
symfony/var-dumper                        v5.0.0   Symfony mechanism for exploring and dumping PHP variables
symfony/var-exporter                      v5.0.0   A blend of var_export() + serialize() to turn any serializable data struc...
symfony/yaml                              v4.4.0   Symfony Yaml Component
tivie/php-os-detector                     1.1.0    A small utility library that detects the OS the server is running on
wyrihaximus/cpu-core-detector             1.0.2    Detect CPU core count and assign tasks to a specific code
wyrihaximus/file-descriptors              1.0.0    List open file descriptors for the current process cross platform
wyrihaximus/json-throwable                2.0.0    JSON encode and decode throwables and exceptions
wyrihaximus/json-utilities                1.1.0    Utilities for php-json-* packages
wyrihaximus/react-child-process-messenger 2.10.0   Messenger decorator for react/child-process
wyrihaximus/react-child-process-pool      1.6.0    Pool wyrihaximus/react-child-process-messenger processes
wyrihaximus/react-child-process-promise   2.0.2    Wrapping ticks into a promise
wyrihaximus/ticking-promise               1.6.3    Wrapping ticks into a promise
yosymfony/resource-watcher                v2.0.0   A simple resource watcher using Symfony Finder

This is so weird. I have exactly the same configuration than you have in my computer, using PHP7.4, and I don't have any problem.

Following the error itself, what we find in Symfony^5.0 is that the Framework worker is extending an interface located in the same package, named CompatibilityServiceSubscriberInterface. This interface really checks if there is an interface inside the dependency injection package named ServiceSubscriberInterface and aliased as LegacyServiceSubscriberInterface, so autoload should only load this class if it exists.

In your dependency injection version, this class does not exist, what makes sense, but this piece of code should work.

Can you debug a bit what's going on there?
Is a bit weird this behavior, so this could be a small Symfony bug, maybe.

It seems to be a Symfony bug.

On the environment which have the problem, I've test to launch bin/console, but I have the same error.

So next, I tried to update all Symfony all project dependencies with a composer update.

I paste the result of the command :

$ composer update                                                                                                              jdecool@pegasys
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 28 updates, 0 removals
  - Updating symfony/dotenv (v4.4.0 => v4.4.1): Loading from cache
  - Updating symfony/service-contracts (v2.0.0 => v2.0.1): Loading from cache
  - Updating symfony/stopwatch (v4.4.0 => v4.4.1): Loading from cache
  - Updating symfony/dependency-injection (v5.0.0 => v5.0.1): Loading from cache
  - Updating symfony/polyfill-php73 (v1.12.0 => v1.13.1): Loading from cache
  - Updating symfony/polyfill-ctype (v1.12.0 => v1.13.1): Loading from cache
  - Updating symfony/polyfill-mbstring (v1.12.0 => v1.13.1): Loading from cache
  - Updating symfony/polyfill-php72 (v1.12.0 => v1.13.1): Loading from cache
  - Updating symfony/polyfill-intl-idn (v1.12.0 => v1.13.1): Loading from cache
  - Updating symfony/mime (v5.0.0 => v5.0.1): Loading from cache
  - Updating symfony/http-foundation (v5.0.0 => v5.0.1): Loading from cache
  - Updating symfony/event-dispatcher (v4.4.0 => v4.4.1): Loading from cache
  - Updating symfony/var-dumper (v5.0.0 => v5.0.1): Loading from cache
  - Updating symfony/debug (v4.4.0 => v4.4.1): Loading from cache
  - Updating symfony/error-handler (v4.4.0 => v4.4.1): Loading from cache
  - Updating symfony/http-kernel (v4.4.0 => v4.4.1): Loading from cache
  - Updating symfony/yaml (v4.4.0 => v5.0.1): Loading from cache
  - Updating symfony/routing (v5.0.0 => v5.0.1): Loading from cache
  - Updating symfony/finder (v4.4.0 => v4.4.1): Loading from cache
  - Updating symfony/filesystem (v5.0.0 => v5.0.1): Loading from cache
  - Updating symfony/config (v5.0.0 => v5.0.1): Loading from cache
  - Updating symfony/var-exporter (v5.0.0 => v5.0.1): Loading from cache
  - Updating symfony/cache-contracts (v2.0.0 => v2.0.1): Loading from cache
  - Updating symfony/cache (v5.0.0 => v5.0.1): Loading from cache
  - Updating symfony/framework-bundle (v4.4.0 => v4.4.1): Loading from cache
  - Updating mmoreram/base-bundle (2.0.1 => 2.0.2): Loading from cache
  - Updating symfony/console (v4.4.0 => v4.4.1): Loading from cache
  - Updating seregazhuk/php-watcher (v0.5.1 => v0.5.2): Loading from cache
Writing lock file
Generating autoload files

Then I started the server vendor/bin/server run 0.0.0.0:8100 --dev --debug without error.