GithubHelp home page GithubHelp logo

spiral / app Goto Github PK

View Code? Open in Web Editor NEW
191.0 13.0 20.0 561 KB

Spiral Framework Skeleton HTTP Application: Queue, Console, Cycle ORM

Home Page: https://spiral.dev/

License: MIT License

PHP 69.32% CSS 2.34% Hack 28.35%
php7 spiral skeleton http queue orm php

app's Introduction

Spiral HTTP Application Skeleton Latest Stable Version

Spiral Framework is a High-Performance PHP Full-Stack framework and group of over sixty PSR-compatible components.

Github cover spiral application

Documentation | Discord | Twitter | Contributing

Hello developer!

Are you looking for an easier way to install Spiral Framework?

This package streamlines the installation process by allowing you to install only the desired components and packages for your application. Our installer handles all dependencies and configurations, making the process as smooth and hassle-free as possible.

This makes it super simple for you to get started with Spiral.

Server Requirements

Make sure that your server is configured with following PHP version and extensions:

Installation

composer create-project spiral/app my-app

After the project has been installed, open README.md file and follow the instructions.

Good luck with your future project!

License:

MIT License (MIT). Please see LICENSE for more information. Maintained by Spiral Scout.

app's People

Contributors

alexander-schranz avatar butschster avatar imbue avatar ishutin avatar krwu avatar meekstellar avatar msmakouz avatar roquie avatar roxblnfk avatar rustatian avatar serafimarts avatar stylecibot avatar twmbx avatar vizh avatar vladgorenkin avatar wolfy-j avatar

Stargazers

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

Watchers

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

app's Issues

PHP 8.1-php app.php encrypt:key -m .env doesn't work

โžœ PHP composer create-project spiral/app
Creating a "spiral/app" project at "./app"
Installing spiral/app (v1.4.0)

  • Downloading spiral/app (v1.4.0)
  • Installing spiral/app (v1.4.0): Extracting archive
    Created project in /Users/George/Develop/PHP/app
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 95 installs, 0 updates, 0 removals
  • Locking cocur/slugify (v3.2)
  • Locking codedungeon/php-cli-colors (1.12.2)
  • Locking composer/package-versions-deprecated (1.11.99.4)
  • Locking cycle/annotated (v2.4.1)
  • Locking cycle/migrations (v1.0.10)
  • Locking cycle/orm (v1.8.0)
  • Locking cycle/proxy-factory (v1.3.1)
  • Locking cycle/schema-builder (v1.2.0)
  • Locking defuse/php-encryption (v2.3.1)
  • Locking doctrine/annotations (1.13.2)
  • Locking doctrine/collections (1.6.8)
  • Locking doctrine/inflector (2.0.4)
  • Locking doctrine/instantiator (1.4.0)
  • Locking doctrine/lexer (1.2.1)
  • Locking egulias/email-validator (3.1.2)
  • Locking laminas/laminas-diactoros (2.8.0)
  • Locking laminas/laminas-hydrator (4.3.1)
  • Locking laminas/laminas-stdlib (3.6.1)
  • Locking league/flysystem (2.3.2)
  • Locking league/mime-type-detection (1.9.0)
  • Locking monolog/monolog (2.3.5)
  • Locking myclabs/deep-copy (1.10.2)
  • Locking nikic/php-parser (v4.13.2)
  • Locking nyholm/psr7 (1.4.1)
  • Locking paragonie/random_compat (v9.99.100)
  • Locking phar-io/manifest (2.0.3)
  • Locking phar-io/version (3.1.0)
  • Locking php-http/message-factory (v1.0.2)
  • Locking phpdocumentor/reflection-common (2.2.0)
  • Locking phpdocumentor/reflection-docblock (5.3.0)
  • Locking phpdocumentor/type-resolver (1.5.1)
  • Locking phpoption/phpoption (1.8.1)
  • Locking phpspec/prophecy (1.14.0)
  • Locking phpunit/php-code-coverage (9.2.10)
  • Locking phpunit/php-file-iterator (3.0.6)
  • Locking phpunit/php-invoker (3.1.1)
  • Locking phpunit/php-text-template (2.0.4)
  • Locking phpunit/php-timer (5.0.3)
  • Locking phpunit/phpunit (9.5.10)
  • Locking psr/cache (3.0.0)
  • Locking psr/container (1.1.2)
  • Locking psr/event-dispatcher (1.0.0)
  • Locking psr/http-factory (1.0.1)
  • Locking psr/http-message (1.0.1)
  • Locking psr/http-server-handler (1.0.1)
  • Locking psr/http-server-middleware (1.0.1)
  • Locking psr/log (1.1.4)
  • Locking psr/simple-cache (3.0.0)
  • Locking sebastian/cli-parser (1.0.1)
  • Locking sebastian/code-unit (1.0.8)
  • Locking sebastian/code-unit-reverse-lookup (2.0.3)
  • Locking sebastian/comparator (4.0.6)
  • Locking sebastian/complexity (2.0.2)
  • Locking sebastian/diff (4.0.4)
  • Locking sebastian/environment (5.1.3)
  • Locking sebastian/exporter (4.0.4)
  • Locking sebastian/global-state (5.0.3)
  • Locking sebastian/lines-of-code (1.0.3)
  • Locking sebastian/object-enumerator (4.0.4)
  • Locking sebastian/object-reflector (2.0.4)
  • Locking sebastian/recursion-context (4.0.4)
  • Locking sebastian/resource-operations (3.0.3)
  • Locking sebastian/type (2.3.4)
  • Locking sebastian/version (3.0.2)
  • Locking spiral/composer-publish-plugin (v1.1.2)
  • Locking spiral/database (v2.9.3)
  • Locking spiral/framework (v2.8.13)
  • Locking spiral/goridge (v2.4.5)
  • Locking spiral/jobs (v2.2.2)
  • Locking spiral/migrations (v2.3.0)
  • Locking spiral/nyholm-bridge (v1.1.0)
  • Locking spiral/roadrunner (v1.9.2)
  • Locking symfony/console (v5.4.0)
  • Locking symfony/deprecation-contracts (v3.0.0)
  • Locking symfony/event-dispatcher (v6.0.0)
  • Locking symfony/event-dispatcher-contracts (v3.0.0)
  • Locking symfony/finder (v5.4.0)
  • Locking symfony/mailer (v5.4.0)
  • Locking symfony/mime (v6.0.0)
  • Locking symfony/polyfill-ctype (v1.23.0)
  • Locking symfony/polyfill-intl-grapheme (v1.23.1)
  • Locking symfony/polyfill-intl-idn (v1.23.0)
  • Locking symfony/polyfill-intl-normalizer (v1.23.0)
  • Locking symfony/polyfill-mbstring (v1.23.1)
  • Locking symfony/polyfill-php72 (v1.23.0)
  • Locking symfony/polyfill-php73 (v1.23.0)
  • Locking symfony/polyfill-php80 (v1.23.1)
  • Locking symfony/service-contracts (v2.4.1)
  • Locking symfony/string (v6.0.0)
  • Locking symfony/translation (v5.4.0)
  • Locking symfony/translation-contracts (v2.5.0)
  • Locking theseer/tokenizer (1.2.1)
  • Locking vlucas/phpdotenv (v3.6.9)
  • Locking webmozart/assert (1.10.0)
  • Locking yiisoft/friendly-exception (1.1.0)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 95 installs, 0 updates, 0 removals
  • Downloading spiral/composer-publish-plugin (v1.1.2)
  • Downloading composer/package-versions-deprecated (1.11.99.4)
  • Downloading cocur/slugify (v3.2)
  • Downloading codedungeon/php-cli-colors (1.12.2)
  • Downloading vlucas/phpdotenv (v3.6.9)
  • Downloading symfony/translation (v5.4.0)
  • Downloading symfony/mime (v6.0.0)
  • Downloading psr/log (1.1.4)
  • Downloading egulias/email-validator (3.1.2)
  • Downloading symfony/mailer (v5.4.0)
  • Downloading psr/simple-cache (3.0.0)
  • Downloading psr/http-server-handler (1.0.1)
  • Downloading psr/http-server-middleware (1.0.1)
  • Downloading psr/cache (3.0.0)
  • Downloading league/flysystem (2.3.2)
  • Downloading doctrine/annotations (1.13.2)
  • Downloading paragonie/random_compat (v9.99.100)
  • Downloading defuse/php-encryption (v2.3.1)
  • Downloading spiral/framework (v2.8.13)
  • Downloading yiisoft/friendly-exception (1.1.0)
  • Downloading spiral/database (v2.9.3)
  • Downloading laminas/laminas-stdlib (3.6.1)
  • Downloading laminas/laminas-hydrator (4.3.1)
  • Downloading doctrine/collections (1.6.8)
  • Downloading cycle/orm (v1.8.0)
  • Downloading cycle/schema-builder (v1.2.0)
  • Downloading cycle/annotated (v2.4.1)
  • Downloading spiral/migrations (v2.3.0)
  • Downloading cycle/migrations (v1.0.10)
  • Downloading cycle/proxy-factory (v1.3.1)
  • Downloading php-http/message-factory (v1.0.2)
  • Downloading phpunit/php-code-coverage (9.2.10)
  • Downloading spiral/goridge (v2.4.5)
  • Downloading spiral/roadrunner (v1.9.2)
  • Downloading spiral/jobs (v2.2.2)
  • Downloading nyholm/psr7 (1.4.1)
  • Downloading spiral/nyholm-bridge (v1.1.0)
  • Installing spiral/composer-publish-plugin (v1.1.2): Extracting archive
  • Installing composer/package-versions-deprecated (1.11.99.4): Extracting archive
  • Installing cocur/slugify (v3.2): Extracting archive
  • Installing codedungeon/php-cli-colors (1.12.2): Extracting archive
  • Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
  • Installing phpoption/phpoption (1.8.1): Extracting archive
  • Installing vlucas/phpdotenv (v3.6.9): Extracting archive
  • Installing symfony/translation-contracts (v2.5.0): Extracting archive
  • Installing symfony/polyfill-php80 (v1.23.1): Extracting archive
  • Installing symfony/polyfill-mbstring (v1.23.1): Extracting archive
  • Installing symfony/deprecation-contracts (v3.0.0): Extracting archive
  • Installing symfony/translation (v5.4.0): Extracting archive
  • Installing symfony/polyfill-php73 (v1.23.0): Extracting archive
  • Installing psr/container (1.1.2): Extracting archive
  • Installing symfony/service-contracts (v2.4.1): Extracting archive
  • Installing symfony/polyfill-php72 (v1.23.0): Extracting archive
  • Installing symfony/polyfill-intl-normalizer (v1.23.0): Extracting archive
  • Installing symfony/polyfill-intl-idn (v1.23.0): Extracting archive
  • Installing symfony/mime (v6.0.0): Extracting archive
  • Installing psr/event-dispatcher (1.0.0): Extracting archive
  • Installing symfony/event-dispatcher-contracts (v3.0.0): Extracting archive
  • Installing symfony/event-dispatcher (v6.0.0): Extracting archive
  • Installing psr/log (1.1.4): Extracting archive
  • Installing doctrine/lexer (1.2.1): Extracting archive
  • Installing egulias/email-validator (3.1.2): Extracting archive
  • Installing symfony/mailer (v5.4.0): Extracting archive
  • Installing symfony/finder (v5.4.0): Extracting archive
  • Installing symfony/polyfill-intl-grapheme (v1.23.1): Extracting archive
  • Installing symfony/string (v6.0.0): Extracting archive
  • Installing symfony/console (v5.4.0): Extracting archive
  • Installing psr/simple-cache (3.0.0): Extracting archive
  • Installing psr/http-message (1.0.1): Extracting archive
  • Installing psr/http-server-handler (1.0.1): Extracting archive
  • Installing psr/http-server-middleware (1.0.1): Extracting archive
  • Installing psr/http-factory (1.0.1): Extracting archive
  • Installing psr/cache (3.0.0): Extracting archive
  • Installing nikic/php-parser (v4.13.2): Extracting archive
  • Installing myclabs/deep-copy (1.10.2): Extracting archive
  • Installing monolog/monolog (2.3.5): Extracting archive
  • Installing league/mime-type-detection (1.9.0): Extracting archive
  • Installing league/flysystem (2.3.2): Extracting archive
  • Installing doctrine/inflector (2.0.4): Extracting archive
  • Installing doctrine/annotations (1.13.2): Extracting archive
  • Installing paragonie/random_compat (v9.99.100): Extracting archive
  • Installing defuse/php-encryption (v2.3.1): Extracting archive
  • Installing spiral/framework (v2.8.13): Extracting archive
  • Installing yiisoft/friendly-exception (1.1.0): Extracting archive
  • Installing spiral/database (v2.9.3): Extracting archive
  • Installing webmozart/assert (1.10.0): Extracting archive
  • Installing laminas/laminas-stdlib (3.6.1): Extracting archive
  • Installing laminas/laminas-hydrator (4.3.1): Extracting archive
  • Installing doctrine/instantiator (1.4.0): Extracting archive
  • Installing doctrine/collections (1.6.8): Extracting archive
  • Installing cycle/orm (v1.8.0): Extracting archive
  • Installing cycle/schema-builder (v1.2.0): Extracting archive
  • Installing cycle/annotated (v2.4.1): Extracting archive
  • Installing spiral/migrations (v2.3.0): Extracting archive
  • Installing cycle/migrations (v1.0.10): Extracting archive
  • Installing cycle/proxy-factory (v1.3.1): Extracting archive
  • Installing php-http/message-factory (v1.0.2): Extracting archive
  • Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
  • Installing phpdocumentor/type-resolver (1.5.1): Extracting archive
  • Installing phpdocumentor/reflection-docblock (5.3.0): Extracting archive
  • Installing sebastian/version (3.0.2): Extracting archive
  • Installing sebastian/type (2.3.4): Extracting archive
  • Installing sebastian/resource-operations (3.0.3): Extracting archive
  • Installing sebastian/recursion-context (4.0.4): Extracting archive
  • Installing sebastian/object-reflector (2.0.4): Extracting archive
  • Installing sebastian/object-enumerator (4.0.4): Extracting archive
  • Installing sebastian/global-state (5.0.3): Extracting archive
  • Installing sebastian/exporter (4.0.4): Extracting archive
  • Installing sebastian/environment (5.1.3): Extracting archive
  • Installing sebastian/diff (4.0.4): Extracting archive
  • Installing sebastian/comparator (4.0.6): Extracting archive
  • Installing sebastian/code-unit (1.0.8): Extracting archive
  • Installing sebastian/cli-parser (1.0.1): Extracting archive
  • Installing phpunit/php-timer (5.0.3): Extracting archive
  • Installing phpunit/php-text-template (2.0.4): Extracting archive
  • Installing phpunit/php-invoker (3.1.1): Extracting archive
  • Installing phpunit/php-file-iterator (3.0.6): Extracting archive
  • Installing theseer/tokenizer (1.2.1): Extracting archive
  • Installing sebastian/lines-of-code (1.0.3): Extracting archive
  • Installing sebastian/complexity (2.0.2): Extracting archive
  • Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
  • Installing phpunit/php-code-coverage (9.2.10): Extracting archive
  • Installing phpspec/prophecy (1.14.0): Extracting archive
  • Installing phar-io/version (3.1.0): Extracting archive
  • Installing phar-io/manifest (2.0.3): Extracting archive
  • Installing phpunit/phpunit (9.5.10): Extracting archive
  • Installing spiral/goridge (v2.4.5): Extracting archive
  • Installing laminas/laminas-diactoros (2.8.0): Extracting archive
  • Installing spiral/roadrunner (v1.9.2): Extracting archive
  • Installing spiral/jobs (v2.2.2): Extracting archive
  • Installing nyholm/psr7 (1.4.1): Extracting archive
  • Installing spiral/nyholm-bridge (v1.1.0): Extracting archive
    25 package suggestions were added by new dependencies, use composer suggest to see details.
    Generating autoload files
    composer/package-versions-deprecated: Generating version class...
    composer/package-versions-deprecated: ...done generating version class
    58 packages you are using are looking for funding.
    Use the composer fund command to find out more!

php -r "copy('.env.sample', '.env');"
php app.php encrypt:key -m .env
Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Dotenv\Environment\AbstractVariables::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/George/Develop/PHP/app/vendor/vlucas/phpdotenv/src/Environment/AbstractVariables.php:162
Stack trace:
#0 /Users/George/Develop/PHP/app/vendor/vlucas/phpdotenv/src/Environment/AbstractVariables.php(13): Spiral\Boot\ExceptionHandler::handleError(8192, 'Return type of ...', '/Users/George/D...', 162)
#1 /Users/George/Develop/PHP/app/vendor/composer/ClassLoader.php(571): include('/Users/George/D...')
#2 /Users/George/Develop/PHP/app/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/Users/George/D...')
#3 /Users/George/Develop/PHP/app/vendor/vlucas/phpdotenv/src/Environment/DotenvVariables.php(8): Composer\Autoload\ClassLoader->loadClass('Dotenv\Environm...')
#4 /Users/George/Develop/PHP/app/vendor/composer/ClassLoader.php(571): include('/Users/George/D...')
#5 /Users/George/Develop/PHP/app/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/Users/George/D...')
#6 /Users/George/Develop/PHP/app/vendor/vlucas/phpdotenv/src/Environment/DotenvFactory.php(56): Composer\Autoload\ClassLoader->loadClass('Dotenv\Environm...')
#7 /Users/George/Develop/PHP/app/vendor/vlucas/phpdotenv/src/Loader.php(75): Dotenv\Environment\DotenvFactory->createImmutable()
#8 /Users/George/Develop/PHP/app/vendor/vlucas/phpdotenv/src/Loader.php(62): Dotenv\Loader->setImmutable(true)
#9 /Users/George/Develop/PHP/app/vendor/vlucas/phpdotenv/src/Dotenv.php(50): Dotenv\Loader->__construct(Array, Object(Dotenv\Environment\DotenvFactory), true)
#10 /Users/George/Develop/PHP/app/vendor/spiral/framework/src/Bridge/Dotenv/src/Bootloader/DotenvBootloader.php(36): Dotenv\Dotenv::create('/Users/George/D...', '.env')
#11 [internal function]: Spiral\DotEnv\Bootloader\DotenvBootloader->boot(Object(Spiral\Boot\Directories), Object(Spiral\Boot\Environment), Array)
#12 /Users/George/Develop/PHP/app/vendor/spiral/framework/src/Boot/src/BootloadManager.php(123): ReflectionMethod->invokeArgs(Object(Spiral\DotEnv\Bootloader\DotenvBootloader), Array)
#13 /Users/George/Develop/PHP/app/vendor/spiral/framework/src/Boot/src/BootloadManager.php(97): Spiral\Boot\BootloadManager->initBootloader(Object(Spiral\DotEnv\Bootloader\DotenvBootloader), Array)
#14 /Users/George/Develop/PHP/app/vendor/spiral/framework/src/Boot/src/BootloadManager.php(65): Spiral\Boot\BootloadManager->boot(Array)
#15 /Users/George/Develop/PHP/app/vendor/spiral/framework/src/Core/src/Container.php(268): Spiral\Boot\BootloadManager->Spiral\Boot{closure}()
#16 /Users/George/Develop/PHP/app/vendor/spiral/framework/src/Boot/src/BootloadManager.php(66): Spiral\Core\Container->runScope(Array, Object(Closure))
#17 /Users/George/Develop/PHP/app/vendor/spiral/framework/src/Boot/src/AbstractKernel.php(172): Spiral\Boot\BootloadManager->bootload(Array)
#18 /Users/George/Develop/PHP/app/vendor/spiral/framework/src/Boot/src/AbstractKernel.php(141): Spiral\Boot\AbstractKernel->bootload()
#19 /Users/George/Develop/PHP/app/vendor/spiral/framework/src/Core/src/ContainerScope.php(50): Spiral\Boot\AbstractKernel::Spiral\Boot{closure}()
#20 /Users/George/Develop/PHP/app/vendor/spiral/framework/src/Core/src/Container.php(265): Spiral\Core\ContainerScope::runScope(Object(Spiral\Core\Container), Object(Closure))
#21 /Users/George/Develop/PHP/app/vendor/spiral/framework/src/Boot/src/AbstractKernel.php(143): Spiral\Core\Container->runScope(Array, Object(Closure))
#22 /Users/George/Develop/PHP/app/app.php(33): Spiral\Boot\AbstractKernel::init(Array)
#23 {main} in /Users/George/Develop/PHP/app/vendor/vlucas/phpdotenv/src/Environment/AbstractVariables.php on line 13

Need help

Hello, guys! Amazing work!
I have a question...
How can i put together it with angular?

session_set_save_handler(): cannot change save handler when running feature tests

Hi!

When running the feature tests in \Tests\Feature\BasicTest I'm seeing:

PHPUnit\Framework\Error\Warning: session_set_save_handler(): 
Cannot change save handler when headers already sent in 
/var/www/app/vendor/spiral/framework/src/Session/src/SessionFactory.php at line 63

When I add debug code I get:

if (headers_sent($filename, $linenum)) {
    die("Headers already sent in $filename on line $linenum\n");
}

// Headers already sent in /var/www/app/vendor/phpunit/phpunit/src/Util/Printer.php on line 104

This led me to other people having the same issue here:

Can be fixed by an annotation:

/**
 * @runInSeparateProcess
 */

...but, it would be better if SessionFactory.php was a more clever?

Cannot use partial stempler file in base layout

I defined partial components (header.dark.php, footer.dark.php) under layout/partial/.

Then on base.dark.php I used following code

<block:header/>
<block:content>
    <use:element path="layout/partial/left-sidebar"/>
        <block:body/>
    <use:element path="layout/partial/right-sidebar"/>
    <use:element path="layout/partial/footer"/>
</block:content>
<block:footer/>

But it doesn't seem to render those partial files.

In each partial files I add some random text

How to select columns in Repository

I want to hide some columns for some entities.

class UserRepository extends Repository implements ActorProviderInterface
{
    public function getActor(TokenInterface $token): ?object
    {
        if (!isset($token->getPayload()['userID'])) {
            return null;
        }

        return $this->findByPK($token->getPayload()['userID']);
    }
}

How would I hide the columns or add extra columns

Cannot enable TCP_DEFER_ACCEPT: protocol not available

/www/spiral/app $ ./spiral serve -v -d

DEBU[0000] [headers]: disabled
DEBU[0000] [grpc]: disabled
DEBU[0000] [amqp]: disabled
DEBU[0000] [beanstalk]: disabled
DEBU[0000] [sqs]: disabled
DEBU[0000] [ws]: disabled
DEBU[0000] [health]: disabled
DEBU[0000] [reload]: disabled
DEBU[0000] [rpc]: started
DEBU[0000] [http]: started
DEBU[0000] [jobs]: started
DEBU[0000] [broadcast]: started
DEBU[0000] [metrics]: started
ERRO[0000] [rpc]: [rpc]: cannot enable TCP_DEFER_ACCEPT: protocol not available
DEBU[0000] [http]: stopped
DEBU[0000] [jobs]: stopped
DEBU[0000] [broadcast]: stopped
DEBU[0000] [metrics]: stopped

Error: [rpc]: cannot enable TCP_DEFER_ACCEPT: protocol not available

Version conflicts in skeleton

In skeleton v1.1.3, there is "phpunit/phpunit": "^9.0" which requires php 7.3 which is conflict with "php": ">=7.2" requirement. So it is impossible to create app fom skeleton in php 7.2.

What are the list of middlewares the framework provides?

When installing the framework what middleware we would get out-of-the box:

Preferred Categories

  • Route Middleware
  • Web Middleware
  • Api Middleware
  • Auth Middleware
  • Cors Middleware
  • CSRF Middleware

If they exists, then would be good to have some examples on how to use those.

FatalError after composer create-project.

After composer create-project spiral/app the script ended up with the following fatal error:

Writing lock file
Generating autoload files
15 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> php -r "copy('.env.sample', '.env');"
> php app.php encrypt:key -m .env
Fatal error: Access level to Spiral\Nyholm\Bootloader\NyholmBootloader::SINGLETONS must be public (as in class Spiral\Boot\Bootloader\Bootloader) in /Users/XXX/tool_schema-registry/vendor/spiral/nyholm-bridge/src/Bootloader/NyholmBootloader.php on line 32
 [Spiral\Boot\Exception\FatalException]                                                                                               
 Access level to Spiral\Nyholm\Bootloader\NyholmBootloader::SINGLETONS must be public (as in class Spiral\Boot\Bootloader\Bootloader) 
in /Users/XXX/tool_schema-registry/vendor/spiral/nyholm-bridge/src/Bootloader/NyholmBootloader.php:32

Exception Trace:
 Spiral\Boot\ExceptionHandler::handleShutdown() at /Users/XXX/tool_schema-registry/vendor/spiral/nyholm-bridge/src/Bootloader/NyholmBootloader.php:32
 Spiral\Boot\ExceptionHandler::handleShutdown() at n/a:n/a
Script php app.php encrypt:key -m .env handling the post-create-project-cmd event returned with error code 255

The visibility of the constant used in Spiral\Nyholm\Bootloader\NyholmBootloader::SINGLETONS is protected, but it has to be public. See Spiral\Boot\Bootloader\Bootloader::SINGLETONS

Could not install spiral framework on windows 10

Description

I got the below error while trying to install on windows 10
Warning: ZipArchive::getStream(): Invalid or uninitialized Zip object in C:\Users\HP\Documents\Fro Mac\Project\Docspera\jolter_master\app\vendor\spiral\framework\bin\spiral on line 165

How To Reproduce

run the command composer create-project spiral/app

Additional Info

Q A
Framework Version ^2.8
PHP version 7.4
Operating system Windows (10)

Dockerfile

You really need to have a Dockerfile in this repo ๐Ÿ˜ƒ

Can't access authorized user after login

I've set

// Session
Framework\Auth\TokenStorage\SessionTokensBootloader::class,
// Database Session Storage
Framework\Auth\TokenStorage\CycleTokensBootloader::class,

And I could login with following code LoginController.php:

public function loginPost(LoginRequest $login)
   {
       if (!$login->isValid()) {
           return [
               'status' => 400,
               'errors' => $login->getErrors()
           ];
       }

       // application specific login logic
       $user = $this->users->findOne(['username' => $login->getField('username')]);
       if (
           $user === null
           || !password_verify($login->getField('password'), $user->password)
       ) {
           return [
               'status' => 400,
               'error'  => 'No such user'
           ];
       }

       // create token
       $token = $this->authTokens->create(['userID' => $user->id]);
       $this->auth->start(
           $token
       );

       return [
           'status'  => 200,
           'message' => 'Authenticated!',
           'token' => $token
       ];
   }

But When I tried to access protected route, home HomeController.php, I'm not getting the details of authorized user

 public function index(): string
    {
        if ($this->auth->getActor() === null) {
            throw new ForbiddenException();
        }

        dump($this->auth->getActor());
    }

Here, I'm getting Forbidden.
I'm following as per this documentation:
https://spiral.dev/docs/security-authentication#actor-provider-and-token-payload

Here the browser testin : https://storyxpress.co/video/k8wzh5q7nz2rsgwv3

home/index: https://github.com/itsursujit/go-php/blob/master/app/src/Controller/HomeController.php#L43
Am I doing something wrong?

[UPDATED: $this->auth on Controller returning null]

The Framework ROCKS! Amazing :)

I just make a load test and the result is just amazing

System: Ubuntu 18.04 (i7 9700K, 64GB RAM)

Benchmark: Laravel + RoadRunner (hello world): https://github.com/avto-dev/roadrunner-laravel

Server Software:        
Server Hostname:        127.0.0.1
Server Port:            8080
Document Path:          /
Document Length:        11 bytes
Concurrency Level:      10
Time taken for tests:   72.544 seconds
Complete requests:      10000
Failed requests:        0
Keep-Alive requests:    10000
Total transferred:      9190000 bytes
HTML transferred:       110000 bytes
Requests per second:    137.85 [#/sec] (mean)
Time per request:       72.544 [ms] (mean)
Time per request:       7.254 [ms] (mean, across all concurrent requests)
Transfer rate:          123.71 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:     4   72  49.2     64     393
Waiting:        4   72  49.2     64     393
Total:          4   72  49.2     64     393
Percentage of the requests served within a certain time (ms)
  50%     64
  66%     90
  75%    106
  80%    115
  90%    139
  95%    161
  98%    189
  99%    211
 100%    393 (longest request)

Benchmark: Spiral + RR (hello world): https://github.com/spiral/app

Server Software:        
Server Hostname:        127.0.0.1
Server Port:            8080

Document Path:          /
Document Length:        11 bytes

Concurrency Level:      10
Time taken for tests:   0.594 seconds
Complete requests:      10000
Failed requests:        0
Keep-Alive requests:    10000
Total transferred:      2600038 bytes
HTML transferred:       110000 bytes
Requests per second:    16839.38 [#/sec] (mean)
Time per request:       0.594 [ms] (mean)
Time per request:       0.059 [ms] (mean, across all concurrent requests)
Transfer rate:          4275.69 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       1
Processing:     0    1   0.7      0      11
Waiting:        0    1   0.7      0      11
Total:          0    1   0.7      0      11
WARNING: The median and mean for the processing time are not within a normal deviation
        These results are probably not that reliable.
WARNING: The median and mean for the waiting time are not within a normal deviation
        These results are probably not that reliable.
WARNING: The median and mean for the total time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%      0
  66%      1
  75%      1
  80%      1
  90%      1
  95%      1
  98%      3
  99%      4
 100%     11 (longest request)

I'm wondering how reverse-proxy with nginx would affect the result.

Getting error when running seed

I created command using following command:

php app.php create:command seed\account seed:account

then used following command to create entity

php app.php create:entity account -f id:primary name:string -e

Then I ran php app.php configure

Then update AccountCommand as:

protected function perform(TransactionInterface $tr, Generator $faker): void
    {
        for ($i = 0; $i < 100; $i++) {
            $user = new Account();

            $tr->persist($user);
        }

        $tr->run();
    }

When I tried to run php app.php seed:account, I'm getting following error:

 [Cycle\ORM\Exception\ORMException]               
 Unable to resolve role of `App\Database\Account` 
in /Users/sujit/Sites/labs/php/spiral-demo/vendor/cycle/orm/src/ORM.php:112

I'm getting above error on freshly installed https://github.com/spiral/demo

Why am I getting this error?
Isn't there any resource to learn the framework easily?

Getting hard to understand the errors

Redirect with data

How would I redirect to URL with additional data, success message, errors?

Not redirecting as required

Because of issue I raised here: #21

I tried to implement Session.

Code: HomeController@index

public function index()
    {
        $authSession = $this->session->getSection('auth');
        if(empty($authSession->has('token'))) {
            dump(1);
            $this->response->redirect($this->router->getRoute('login')->uri());
        }
    }

Here the $authSession->has('token') is empty but not redirecting to login.

But redirecting is working from LoginController:
https://storyxpress.co/video/k8y3f79by43739kwh

Why is it happening? Any solution for this?

Changing folder structure.

I would like to use this package and when I follow the documentation and install it, everything works in its default state. However, I need to change the directory structure of the app, instead of having everything under the app folder, I would like everything under the root folder instead. No matter how I try to configure the application, it doesn't work. The documentation states I can change directories in the mapDirectories method, and after a dump, everything points to the right place.

This is the error I keep getting:

2022-11-12T16:27:41.731+1000    DEBUG   rpc             plugin was started      {"address": "tcp://127.0.0.1:6001", "list of the plugins with RPC methods:": ["metrics", "jobs", "kv", "informer", "resetter"]}
[INFO] RoadRunner server started; version: 2.11.4, buildtime: 2022-10-06T14:43:01+0000
2022-11-12T16:28:41.731+1000    ERROR   container/poller.go:16  vertex got an error     {"id": "http.Plugin", "error": "static_pool_allocate_workers: WorkerAllocate: failed to spawn a worker, possible reasons: https://roadrunner.dev/docs/known-issues-allocate-timeout/2.x/en"}
github.com/roadrunner-server/endure/pkg/container.(*Endure).poll.func1
        github.com/roadrunner-server/[email protected]/pkg/container/poller.go:16
2022-11-12T16:29:11.751+1000    ERROR   container/stop.go:147   vertices which are not stopped  {"id": ["logger.Plugin", "server.Plugin", "static.Plugin", "gzip.Plugin", "prometheus.Plugin", "send.Plugin", "memory.Plugin", "boltdb.Plugin", "redis.Plugin", "kv.Plugin", "memcached.Plugin", "config.Plugin"]}
github.com/roadrunner-server/endure/pkg/container.(*Endure).shutdown
        github.com/roadrunner-server/[email protected]/pkg/container/stop.go:147
github.com/roadrunner-server/endure/pkg/container.(*Endure).Shutdown
        github.com/roadrunner-server/[email protected]/pkg/container/endure.go:468
reflect.Value.call
        reflect/value.go:584
reflect.Value.Call
        reflect/value.go:368
github.com/roadrunner-server/endure/pkg/fsm.(*FSMImpl).Transition
        github.com/roadrunner-server/[email protected]/pkg/fsm/fsm.go:216
github.com/roadrunner-server/endure/pkg/container.(*Endure).Stop
        github.com/roadrunner-server/[email protected]/pkg/container/endure.go:340
github.com/roadrunner-server/endure/pkg/container.(*Endure).startMainThread.func1
        github.com/roadrunner-server/[email protected]/pkg/container/poller.go:52
2022-11-12T16:29:11.751+1000    ERROR   container/poller.go:54  error during stopping vertex    {"id": "http.Plugin", "error": "endure_shutdown: Timeout: timeout exceed, some vertices may not be stopped and can cause memory leak"}
github.com/roadrunner-server/endure/pkg/container.(*Endure).startMainThread.func1
        github.com/roadrunner-server/[email protected]/pkg/container/poller.go:54
error: static_pool_allocate_workers: WorkerAllocate: failed to spawn a worker, possible reasons: https://roadrunner.dev/docs/known-issues-allocate-timeout/2.x/en
plugin: http.Plugin

This is my mapDirectories() method:

protected function mapDirectories(array $directories): array
	{
		if (!isset($directories['root'])) {
			throw new BootException('Missing required directory `root`');
		}

		if (!isset($directories['app'])) {
			$directories['app'] = $directories['root'] . '/';
		}

		$directories = \array_merge(
			[		// public root
				'app' => $directories['root'] . '/',
				// public root
				'public' => $directories['root'] . '/public/',
				// vendor libraries
				'vendor' => $directories['root'] . '/vendor/',
				// data directories
				'runtime' => $directories['root'] . '/runtime/',
				'cache' => $directories['root'] . '/runtime/cache/',
				// application directories
				'config' => $directories['root'] . '/config/',
				'resources' => $directories['root'] . '/resources/',
			],
			$directories
		);
		
		return $directories;
	}

My folder structure:

root
|- /config
|- /locale
|- /migrations
|- /public
|- /runtime
|- /src
|- /tests
|- /vendor
|- /views
|- ...
|- .rr.yaml
|- app.php
|- composer.json
|- rr
|- ...

If I reset everything back to defaults, there are no problems. I have change no other files other than directory paths in.

Dotenv\Dotenv::create() must be an instance of Dotenv\Repository\RepositoryInterface

I entered composer update after it's can't serve ...
The Dotenv want Dotenv\Repository\RepositoryInterface on /Bootloader/DotenvBootloader.php on line 36

"name": "vlucas/phpdotenv",
"version": "v5.2.0",

Dotenv Document

$repository = Dotenv\Repository\RepositoryBuilder::createWithDefaultAdapters()
   ->allowList(['FOO', 'BAR'])
   ->make();

$dotenv = Dotenv\Dotenv::create($repository, __DIR__);
$dotenv->load();

and DotenvBootloader.php on line 36

foreach (Dotenv::create($path, $file)->load() as $key => $value) {
    $env->set($key, $value);
}

How to add Rest Verb on specific Route

I'm unable to add Verbs on specific route.
I want to allow POST|DELETE|GET|PUT on specific route

For e.g.

        $router->setRoute(
            'login.post',
            new Route('/loginPost', new Action(LoginController::class, 'loginPost'))
        );

I want to allow above Routee to be POST only. How would I do that?

How to add BigInt as primary auto_increment key?

how to add BigInt as primary auto increment key in migration?

Also I don't see the option to add Auto Increment as option.

How to add other options for fields in migration like:

  • Comment
  • Timestamp with CURRENT_TIMESTAMP
  • Timestamp with ON UPDATE CURRENT_TIMESTAMP

Getting error when following documentation

I tried to follow https://spiral.dev/docs/basics-quick-start
I changed the PostCommand as mentioned in documentation to this:

namespace App\Command\Seed;

use App\Repository\UserRepository;
use App\Service\PostService;
use Faker\Generator;
use Spiral\Console\Command;

class PostCommand extends Command
{
    protected const NAME = 'seed:post';

    /** @var UserRepository */
    private $users;

    /** @var PostService */
    private $postService;

    /**
     * @param UserRepository $users2
     * @param PostService    $postService
     * @param string|null    $name
     */
    public function __construct(UserRepository $users2, PostService $postService, ?string $name = null)
    {
        parent::__construct($name);
        $this->postService = $postService;
        $this->users = $users2;
    }

    protected function perform(Generator $faker): void
    {
        $users = $this->users->findAll();

        for ($i = 0; $i < 1000; $i++) {
            $user = $users[array_rand($users)];

            $post = $this->postService->createPost(
                $user,
                $faker->sentence(12),
                $faker->text(900)
            );

            $this->sprintf("New post: <info>%s</info>\n", $post->title);
        }
    }
}

And I'm getting following error.

 [Cycle\ORM\Exception\ORMException]                                      
 Unable to find Entity role for repository App\Repository\UserRepository 

What am I doing wrong.

Unable to retrieve JSON input

Hello,

I cannot access the raw JSON payload of a request either directly through a PSR7 ServerRequest nor through the input manager. This is a barebones project scaffolded through composer with no modifications. Nothing in the documentation states any bootloaders to enable/disable to be able to access JSON. Please advise.

How to get spiral binary for the existing project from github

I'm new to spiral framework. I pushed the code from one machine and pulled to another machine.
I didn't find the spiral binary to work with.
The documentation doesn't provide information on how to get spiral binary for existing project.

Please suggest me on how to get the binary

Remove unnecessary configs

monolog.php
mailer.php -> only with mailer package
cycle.php only with cycle-bridge
queue.php only with roadrunner-bridge package
storage.php - only with storage

Bug: "Spiral\Translator\Exception\LocaleException" thrown when 'accept-language' missing

Bug description

When I tried to test my controller with PHPUnit, it throws an error: Spiral\Translator\Exception\LocaleException: Undefined locale '' in //Data/Dev/spiral/vendor/spiral/translator/src/Translator.php at line 72

This is caused by the LocaleSelector middleware. It detects the client's locale by the 'accept-language' line in headers of the request.

When the request headers don't have 'accept-language', it will call:

$this->translator->setLocale('');

Reproducible Steps

  1. create a new project with `composer create-project
  2. start the server
  3. run `curl http://localhost:8080' in terminal or CMD.

How to create multiple route files for different roles

Is there anyway I create multiple route files for different purpose?

For e.g.

api.php for RESTful routes
manager.php for Admin routes
web.php for Users routes

Also If above is possible, How would I add group middleware?

For e.g.
Group middleware to handle TOKEN for api.php
Group middleware to handle Admin role for manager.php
group middleware to handle all web related roles for web.php

PHP 8.1.6 - composer create-project doesn't work

Creating a "spiral/app" project at "./backend"
Installing spiral/app (v3.0.0)
  - Downloading spiral/app (v3.0.0)
  - Installing spiral/app (v3.0.0): Extracting archive
Created project in /Users/guozhu/WorkSpace/onearth.fun/backend
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - spiral/roadrunner-bridge[2.0-beta, ..., 2.0.x-dev] require psr/simple-cache 2 - 3 -> satisfiable by psr/simple-cache[2.0.0, 2.x-dev, 3.0.0, 3.0.x-dev].
    - You can only install one version of a package, so only one of these can be installed: psr/simple-cache[1.0.0, 1.0.1, 2.0.0, 2.x-dev, 3.0.0, 3.0.x-dev].
    - spiral/roadrunner-kv v2.2.0 requires psr/simple-cache ^1.0 -> satisfiable by psr/simple-cache[1.0.0, 1.0.1].
    - Conclusion: install spiral/roadrunner-kv v2.2.0 (conflict analysis result)
    - Root composer.json requires spiral/roadrunner-bridge ^2.0 -> satisfiable by spiral/roadrunner-bridge[2.0-beta, ..., 2.0.x-dev].

InteractsWithConsole trait is broken

Just try to create an app using this skeleton, go to TestCase class and add $this->runCommand('test'); into setUp method:

PHPUnit 8.5.4 by Sebastian Bergmann and contributors.

E                                                                   1 / 1 (100%)

Time: 230 ms, Memory: 12.00 MB

There was 1 error:

1) Tests\Unit\DemoTest::testDemo
Error: Call to undefined method Tests\TestApp::console()

/app/tests/Traits/InteractsWithConsole.php:25
/app/tests/TestCase.php:44

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

PHP 8.0 - composer create-project doesn't work

Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - composer/semver is locked to version 1.7.0 and an update of this package was not requested.
    - composer/semver 1.7.0 requires php ^5.3.2 || ^7.0 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 2
    - cycle/annotated is locked to version v2.0.6 and an update of this package was not requested.
    - cycle/annotated v2.0.6 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 3
    - cycle/migrations is locked to version v1.0.8 and an update of this package was not requested.
    - cycle/migrations v1.0.8 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 4
    - cycle/orm is locked to version v1.2.12 and an update of this package was not requested.
    - cycle/orm v1.2.12 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 5
    - cycle/proxy-factory is locked to version v1.2.1 and an update of this package was not requested.
    - cycle/proxy-factory v1.2.1 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 6
    - cycle/schema-builder is locked to version v1.1.16 and an update of this package was not requested.
    - cycle/schema-builder v1.1.16 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 7
    - friendsofphp/php-cs-fixer is locked to version v2.16.4 and an update of this package was not requested.
    - friendsofphp/php-cs-fixer v2.16.4 requires php ^5.6 || ^7.0 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 8
    - laminas/laminas-diactoros is locked to version 2.4.1 and an update of this package was not requested.
    - laminas/laminas-diactoros 2.4.1 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 9
    - laminas/laminas-hydrator is locked to version 3.1.0 and an update of this package was not requested.
    - laminas/laminas-hydrator 3.1.0 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 10
    - nyholm/psr7 is locked to version 1.3.0 and an update of this package was not requested.
    - nyholm/psr7 1.3.0 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 11
    - paragonie/random_compat is locked to version v9.99.99 and an update of this package was not requested.
    - paragonie/random_compat v9.99.99 requires php ^7 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 12
    - php-cs-fixer/diff is locked to version v1.3.0 and an update of this package was not requested.
    - php-cs-fixer/diff v1.3.0 requires php ^5.6 || ^7.0 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 13
    - spiral/code-style is locked to version v1.0.2 and an update of this package was not requested.
    - spiral/code-style v1.0.2 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 14
    - spiral/composer-publish-plugin is locked to version v1.1.1 and an update of this package was not requested.
    - spiral/composer-publish-plugin v1.1.1 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 15
    - spiral/database is locked to version v2.7.17 and an update of this package was not requested.
    - spiral/database v2.7.17 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 16
    - spiral/dotenv-bridge is locked to version v1.0.1 and an update of this package was not requested.
    - spiral/dotenv-bridge v1.0.1 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 17
    - spiral/framework is locked to version dev-master and an update of this package was not requested.
    - spiral/framework dev-master requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 18
    - spiral/jobs is locked to version v2.2.0 and an update of this package was not requested.
    - spiral/jobs v2.2.0 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 19
    - spiral/migrations is locked to version v2.1.1 and an update of this package was not requested.
    - spiral/migrations v2.1.1 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 20
    - spiral/monolog-bridge is locked to version v1.1.1 and an update of this package was not requested.
    - spiral/monolog-bridge v1.1.1 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 21
    - spiral/nyholm-bridge is locked to version v1.0.3 and an update of this package was not requested.
    - spiral/nyholm-bridge v1.0.3 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 22
    - spiral/prototype is locked to version v1.2.1 and an update of this package was not requested.
    - spiral/prototype v1.2.1 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 23
    - spiral/roadrunner is locked to version v1.8.3 and an update of this package was not requested.
    - spiral/roadrunner v1.8.3 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 24
    - spiral/scaffolder is locked to version v2.3.6 and an update of this package was not requested.
    - spiral/scaffolder v2.3.6 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 25
    - spiral/stempler is locked to version v2.2.13 and an update of this package was not requested.
    - spiral/stempler v2.2.13 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 26
    - spiral/stempler-bridge is locked to version v1.3.1 and an update of this package was not requested.
    - spiral/stempler-bridge v1.3.1 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 27
    - phpspec/prophecy is locked to version 1.11.1 and an update of this package was not requested.
    - phpspec/prophecy 1.11.1 requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
  Problem 28
    - spiral/framework dev-master requires php ^7.2 -> your php version (8.0.0) does not satisfy that requirement.
    - spiral/framework 2.6.x-dev is an alias of spiral/framework dev-master and thus requires it to be installed too.
    - spiral/framework is locked to version 2.6.x-dev and an update of this package was not requested.

Composer lock out of sync

Description

composer.lock file out of sync with composer.json causes issues when trying to require a new package, example:

composer require psr/simple-cache
Using version ^1.0 for psr/simple-cache
./composer.json has been updated
Running composer update psr/simple-cache
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires spiral/framework ^2.7, found spiral/framework[dev-master, v2.7.0, ..., 2.8.x-dev (alias of dev-master)] but the package is fixed to 2.6.x-dev (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Proposed solutions:

run composer update and commit/push new composer.lock file

OR

remove composer.lock and add to .gitignore and add "composer install" as the first entry within the "post-create-project-cmd" script, example:

"post-create-project-cmd": [
    "composer install",
    "php -r \"copy('.env.sample', '.env');\"",
    "php app.php encrypt:key -m .env",
    "php app.php configure -vv",
    "spiral get-binary"
]

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.