Composer doesn't autoload php packages [duplicate] - php

Laravel Version: 5.6.35
PHP Version: 7.1.20
Database Driver & Version: MySQL v5.5.61-0ubuntu0.14.04.1
Description:
At the time of this question, the latest version of Laravel is 5.6.37 - released 2 days ago i.e., 2nd September, 2018.
I already have a project that I am working on. On running composer update, I always get the following:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
This started only after I updated my laravel project to 5.6.35.
This is not the case when I install a new laravel project. On new installation, the latest version of laravel, i.e., 5.6.37 gets downloaded.
Below is my composer.json file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.6.*",
"laravel/tinker": "^1.0",
"spinen/laravel-mail-assertions": "^0.3.4"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.1",
"codedungeon/phpunit-result-printer": "^0.19.13",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"Larammerce\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Steps To Reproduce:
Have a Laravel project <= 5.6.35
Run composer update
I don't know where and what should be the mistake that I must have committed.
I have tried the following
Running composer dump-autoload && composer update
Deleting composer.lock file and vendor directory. Then running composer update
But couldn't get my project updated to Laravel version 5.6.37
Update 1
On running composer show -i I got the following:
barryvdh/laravel-debugbar v3.1.5 PHP Debugbar integration for Laravel
codedungeon/php-cli-colors 1.10.7 PHP Package for using color output in CLI commands
codedungeon/phpunit-result-printer 0.19.13 PHPUnit Pretty Result Printer
dnoegel/php-xdg-base-dir 0.1 implementation of xdg base directory specification for php
doctrine/inflector v1.3.0 Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator 1.1.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer v1.0.1 Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
dragonmantank/cron-expression v2.2.0 CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
egulias/email-validator 2.1.5 A library for validating emails against several RFCs
erusev/parsedown 1.7.1 Parser for Markdown.
fideloper/proxy 4.0.0 Set trusted proxies for Laravel
filp/whoops 2.2.0 php error handling for cool kids
fzaninotto/faker v1.8.0 Faker is a PHP library that generates fake data for you.
hamcrest/hamcrest-php v2.0.0 This is the PHP port of Hamcrest Matchers
hassankhan/config 1.1.0 Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files
jakub-onderka/php-console-color 0.1
jakub-onderka/php-console-highlighter v0.3.2
laravel/framework v5.6.35 The Laravel Framework.
laravel/tinker v1.0.7 Powerful REPL for the Laravel framework.
league/flysystem 1.0.46 Filesystem abstraction: Many filesystems, one API.
maximebf/debugbar v1.15.0 Debug bar in the browser for php application
mockery/mockery 1.1.0 Mockery is a simple yet flexible PHP mock object framework
monolog/monolog 1.23.0 Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy 1.8.1 Create deep copies (clones) of your objects
nesbot/carbon 1.25.0 A simple API extension for DateTime.
nikic/php-parser v4.0.3 A PHP parser written in PHP
nunomaduro/collision v2.0.3 Cli error handling for console/command-line PHP applications.
paragonie/random_compat v9.99.99 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phar-io/manifest 1.0.3 Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version 2.0.1 Library for handling version information and constraints
phpdocumentor/reflection-common 1.0.1 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 4.3.0 With this component, a library can provide support for annotations via DocBlocks or otherwise r...
phpdocumentor/type-resolver 0.4.0
phpspec/prophecy 1.8.0 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 6.0.7 Library that provides collection, processing, and rendering functionality for PHP code coverage...
phpunit/php-file-iterator 2.0.1 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 2.0.0 Utility class for timing
phpunit/php-token-stream 3.0.0 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 7.3.2 The PHP Unit Testing framework.
psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11)
psr/log 1.0.2 Common interface for logging libraries
psr/simple-cache 1.0.1 Common interfaces for simple caching
psy/psysh v0.9.7 An interactive shell for modern PHP.
ramsey/uuid 3.8.0 Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 univer...
sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code belongs to
sebastian/comparator 3.0.2 Provides the functionality to compare PHP values for equality
sebastian/diff 3.0.1 Diff implementation
sebastian/environment 3.1.0 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 3.1.0 Provides the functionality to export PHP variables for visualization
sebastian/global-state 2.0.0 Snapshotting of global state
sebastian/object-enumerator 3.0.3 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector 1.1.1 Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context 3.0.0 Provides functionality to recursively process PHP variables
sebastian/resource-operations 1.0.0 Provides a list of PHP built-in functions that operate on resources
sebastian/version 2.0.1 Library that helps with managing the version number of Git-hosted PHP projects
spinen/laravel-mail-assertions 0.3.4 PHPUnit mail assertions for testing email in Laravel.
swiftmailer/swiftmailer v6.1.2 Swiftmailer, free feature-rich PHP mailer
symfony/console v4.1.4 Symfony Console Component
symfony/css-selector v4.1.4 Symfony CssSelector Component
symfony/debug v4.1.4 Symfony Debug Component
symfony/event-dispatcher v4.1.4 Symfony EventDispatcher Component
symfony/finder v4.1.4 Symfony Finder Component
symfony/http-foundation v4.1.4 Symfony HttpFoundation Component
symfony/http-kernel v4.1.4 Symfony HttpKernel Component
symfony/polyfill-ctype v1.9.0 Symfony polyfill for ctype functions
symfony/polyfill-mbstring v1.9.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php72 v1.9.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/process v4.1.4 Symfony Process Component
symfony/routing v4.1.4 Symfony Routing Component
symfony/translation v4.1.4 Symfony Translation Component
symfony/var-dumper v4.1.4 Symfony mechanism for exploring and dumping PHP variables
symfony/yaml v4.1.4 Symfony Yaml Component
theseer/tokenizer 1.1.0 A small library for converting tokenized PHP source code into XML and potentially other formats
tijsverkoyen/css-to-inline-styles 2.2.1 CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files...
vlucas/phpdotenv v2.5.1 Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
webmozart/assert 1.3.0 Assertions to validate method input/output with nice error messages.

Deleting vendor folder and running composer install did it for me.

If deleting vendor and running composer install doesn't work, it might be a user-related issue. I was running composer install as the wrong user, and I got the same message. Running it as root fixed it.

Related

Composer update says nothing to install or update

Laravel Version: 5.6.35
PHP Version: 7.1.20
Database Driver & Version: MySQL v5.5.61-0ubuntu0.14.04.1
Description:
At the time of this question, the latest version of Laravel is 5.6.37 - released 2 days ago i.e., 2nd September, 2018.
I already have a project that I am working on. On running composer update, I always get the following:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> #php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
This started only after I updated my laravel project to 5.6.35.
This is not the case when I install a new laravel project. On new installation, the latest version of laravel, i.e., 5.6.37 gets downloaded.
Below is my composer.json file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.6.*",
"laravel/tinker": "^1.0",
"spinen/laravel-mail-assertions": "^0.3.4"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.1",
"codedungeon/phpunit-result-printer": "^0.19.13",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"Larammerce\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Steps To Reproduce:
Have a Laravel project <= 5.6.35
Run composer update
I don't know where and what should be the mistake that I must have committed.
I have tried the following
Running composer dump-autoload && composer update
Deleting composer.lock file and vendor directory. Then running composer update
But couldn't get my project updated to Laravel version 5.6.37
Update 1
On running composer show -i I got the following:
barryvdh/laravel-debugbar v3.1.5 PHP Debugbar integration for Laravel
codedungeon/php-cli-colors 1.10.7 PHP Package for using color output in CLI commands
codedungeon/phpunit-result-printer 0.19.13 PHPUnit Pretty Result Printer
dnoegel/php-xdg-base-dir 0.1 implementation of xdg base directory specification for php
doctrine/inflector v1.3.0 Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator 1.1.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer v1.0.1 Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
dragonmantank/cron-expression v2.2.0 CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
egulias/email-validator 2.1.5 A library for validating emails against several RFCs
erusev/parsedown 1.7.1 Parser for Markdown.
fideloper/proxy 4.0.0 Set trusted proxies for Laravel
filp/whoops 2.2.0 php error handling for cool kids
fzaninotto/faker v1.8.0 Faker is a PHP library that generates fake data for you.
hamcrest/hamcrest-php v2.0.0 This is the PHP port of Hamcrest Matchers
hassankhan/config 1.1.0 Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files
jakub-onderka/php-console-color 0.1
jakub-onderka/php-console-highlighter v0.3.2
laravel/framework v5.6.35 The Laravel Framework.
laravel/tinker v1.0.7 Powerful REPL for the Laravel framework.
league/flysystem 1.0.46 Filesystem abstraction: Many filesystems, one API.
maximebf/debugbar v1.15.0 Debug bar in the browser for php application
mockery/mockery 1.1.0 Mockery is a simple yet flexible PHP mock object framework
monolog/monolog 1.23.0 Sends your logs to files, sockets, inboxes, databases and various web services
myclabs/deep-copy 1.8.1 Create deep copies (clones) of your objects
nesbot/carbon 1.25.0 A simple API extension for DateTime.
nikic/php-parser v4.0.3 A PHP parser written in PHP
nunomaduro/collision v2.0.3 Cli error handling for console/command-line PHP applications.
paragonie/random_compat v9.99.99 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phar-io/manifest 1.0.3 Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version 2.0.1 Library for handling version information and constraints
phpdocumentor/reflection-common 1.0.1 Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock 4.3.0 With this component, a library can provide support for annotations via DocBlocks or otherwise r...
phpdocumentor/type-resolver 0.4.0
phpspec/prophecy 1.8.0 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage 6.0.7 Library that provides collection, processing, and rendering functionality for PHP code coverage...
phpunit/php-file-iterator 2.0.1 FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template 1.2.1 Simple template engine.
phpunit/php-timer 2.0.0 Utility class for timing
phpunit/php-token-stream 3.0.0 Wrapper around PHP's tokenizer extension.
phpunit/phpunit 7.3.2 The PHP Unit Testing framework.
psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11)
psr/log 1.0.2 Common interface for logging libraries
psr/simple-cache 1.0.1 Common interfaces for simple caching
psy/psysh v0.9.7 An interactive shell for modern PHP.
ramsey/uuid 3.8.0 Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 univer...
sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code belongs to
sebastian/comparator 3.0.2 Provides the functionality to compare PHP values for equality
sebastian/diff 3.0.1 Diff implementation
sebastian/environment 3.1.0 Provides functionality to handle HHVM/PHP environments
sebastian/exporter 3.1.0 Provides the functionality to export PHP variables for visualization
sebastian/global-state 2.0.0 Snapshotting of global state
sebastian/object-enumerator 3.0.3 Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector 1.1.1 Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context 3.0.0 Provides functionality to recursively process PHP variables
sebastian/resource-operations 1.0.0 Provides a list of PHP built-in functions that operate on resources
sebastian/version 2.0.1 Library that helps with managing the version number of Git-hosted PHP projects
spinen/laravel-mail-assertions 0.3.4 PHPUnit mail assertions for testing email in Laravel.
swiftmailer/swiftmailer v6.1.2 Swiftmailer, free feature-rich PHP mailer
symfony/console v4.1.4 Symfony Console Component
symfony/css-selector v4.1.4 Symfony CssSelector Component
symfony/debug v4.1.4 Symfony Debug Component
symfony/event-dispatcher v4.1.4 Symfony EventDispatcher Component
symfony/finder v4.1.4 Symfony Finder Component
symfony/http-foundation v4.1.4 Symfony HttpFoundation Component
symfony/http-kernel v4.1.4 Symfony HttpKernel Component
symfony/polyfill-ctype v1.9.0 Symfony polyfill for ctype functions
symfony/polyfill-mbstring v1.9.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php72 v1.9.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/process v4.1.4 Symfony Process Component
symfony/routing v4.1.4 Symfony Routing Component
symfony/translation v4.1.4 Symfony Translation Component
symfony/var-dumper v4.1.4 Symfony mechanism for exploring and dumping PHP variables
symfony/yaml v4.1.4 Symfony Yaml Component
theseer/tokenizer 1.1.0 A small library for converting tokenized PHP source code into XML and potentially other formats
tijsverkoyen/css-to-inline-styles 2.2.1 CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files...
vlucas/phpdotenv v2.5.1 Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
webmozart/assert 1.3.0 Assertions to validate method input/output with nice error messages.
Deleting vendor folder and running composer install did it for me.
If deleting vendor and running composer install doesn't work, it might be a user-related issue. I was running composer install as the wrong user, and I got the same message. Running it as root fixed it.

I can't update package I forked anymore, was working a week ago

I forked a php package and am using forked version in my local machine, I plan to extend the package, while I was working with it a week ago everything was working fine, today when I focused on this part of the application again and had to update the package with latest code I had pushed to repo, so I tried to update the package like
composer update author/package-name
and I also have this part in the composer.json
"repositories": [
{
"type": "vcs",
"url": "https://github.com/myproject/package-name"
}
],
I suddenly get this:
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
symfony/event-dispatcher v4.0.3 requires php ^7.1.3 -> your PHP version
(7.1.1) does not satisfy that requirement.
symfony/event-dispatcher v4.0.3 requires php ^7.1.3 -> your PHP version (7.1.1) does not satisfy that requirement.
Installation request for symfony/event-dispatcher (locked at v4.0.3) -> satisfiable by symfony/event-dispatcher[v4.0.3].
I currently have php 7.1.1 installed and am running laravel 5.4, I wonder why after a week or so where I was able to run the command above without a problem today I can't and what is also confusing me is this:
https://laravel.com/docs/5.4/installation
php requirement for laravel on the server is 5.6.4 or higher.
So why would symfony/event-dispatcher require 7.1.3 and why would laravel's own page claim version 5.4 min-requirment is php 5.6.4?
Anyone has any clues?
The 3.4 and the 4.0 branch of the symfony/event-dispatcher package have different PHP requirements. It looks like a package inside your dependency tree has caused an update from symfony/event-dispatcher 3.4 to 4.0.
To find out why this package was installed, you can use Composer:
composer why symfony/event-dispatcher
You could also grep for symfony/event-dispatcher in the composer.json files in your vendor directory:
grep -r --include=composer.json symfony/event-dispatcher vendor/
You will most likely see that some of them work with both branches of that package, e.g.
…
"symfony/event-dispatcher": "~3.4|~4.0",
…
(Note that some of the entries, for example those with a <3.4 value, are not from the require, but from the conflict section.)
You can try forcing your project to use a 3.x version of the symfony/event-dispatcher package. Add the following to your root composer.json:
"symfony/event-dispatcher": "<4.0"
This should force the installation of the 3.4 branch. But you might run into a dependency conflict if there’s a package requiring the 4.0 branch.

Why Composer require jquery installs unwanted PHP packages?

I just wanted jQuery and entered in the command line
composer require components/jquery ^1.11
But the log shows me:
Package operations: 4 installs, 0 updates, 0 removals
- Installing symfony/process (v3.2.7): Loading from cache
- Installing kriswallsmith/assetic (v1.4.0): Loading from cache
- Installing robloach/component-installer (0.2.3): Loading from cache
- Installing components/jquery (1.11.0): Loading from cache
Why does Composer install PHP related packages I never intended to install? And how do I get rid of the unwanted packages? Is there an better/cleaner install method?
you are trying to install on of 1.11 versions of a package, which is requires "robloach/component-installer" package to install , you can see that clearly here :
"require": {
"robloach/component-installer": "*"
},
however, robloach/component-installer requires some additional packages too,
also you can see that here
"require": {
"php": ">=5.3.2",
"kriswallsmith/assetic": "1.*",
"composer-plugin-api": "^1.0"
},

unable to make bake work with cakePhp 3.2

I'm trying to create new local project with cakephp 3.2, following the cakephp doc, on wamp local server. I used composer to install it.
Everythings seems ok after installation : I configure my db access on app.php and the cakephp default homepage confirms that everything is OK with the configuration (PHP version & extensions OK / write rights OK / connect to db OK)
But when I try to use bake commands (from my project root directory), I've got an error :
$ bin/cake bake
Could not open input file: /cygdrive/c/wamp64/www/cemafor/bin/cake.php
However, the file c/wamp64/www/cemafor/bin/cake.php exists !
I try to use "./bin/cake bake" command (according to cakephp bake doc recommendation), still the same error.
Try also to remove and reinstall the project, no change.
I saw the bake version installed was 1.2.1 (see the result of install command). I've looked into /composer.json file, and saw this :
"require-dev": {
"psy/psysh": "#stable",
"cakephp/debug_kit": "~3.2",
"cakephp/bake": "~1.1"
},
So I try to change version value for cakephp/bake version by this :
"cakephp/bake": "~1.2"
But doesn't change anything...
I try to install version 1.0 according to bake doc but doesn't work.
And unable to find a single person having the same problem... feel alone in the world with a stupid bug ^^
Thanks a lot for your help !
For information, here is the result of the instal command :
$ composer create-project --prefer-dist cakephp/app cemafor
Installing cakephp/app (3.2.1)
- Installing cakephp/app (3.2.1)
Loading from cache
Created project in cemafor
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing aura/installer-default (1.0.0)
Loading from cache
- Installing cakephp/plugin-installer (0.0.12)
Loading from cache
- Installing psr/log (1.0.0)
Loading from cache
- Installing mobiledetect/mobiledetectlib (2.8.19)
Loading from cache
- Installing aura/intl (1.1.1)
Loading from cache
- Installing cakephp/chronos (0.4.7)
Loading from cache
- Installing cakephp/cakephp (3.2.3)
Loading from cache
- Installing symfony/yaml (v3.0.3)
Loading from cache
- Installing symfony/filesystem (v3.0.3)
Loading from cache
- Installing symfony/config (v3.0.3)
Loading from cache
- Installing symfony/polyfill-mbstring (v1.1.0)
Loading from cache
- Installing symfony/console (v3.0.3)
Loading from cache
- Installing robmorgan/phinx (v0.5.1)
Loading from cache
- Installing cakephp/migrations (1.5.6)
Loading from cache
- Installing jakub-onderka/php-console-color (0.1)
Loading from cache
- Installing jakub-onderka/php-console-highlighter (v0.3.2)
Loading from cache
- Installing dnoegel/php-xdg-base-dir (0.1)
Loading from cache
- Installing nikic/php-parser (v2.0.1)
Loading from cache
- Installing symfony/var-dumper (v3.0.3)
Loading from cache
- Installing psy/psysh (v0.7.1)
Loading from cache
- Installing jdorn/sql-formatter (v1.2.17)
Loading from cache
- Installing cakephp/debug_kit (3.2.6)
Loading from cache
- Installing cakephp/bake (1.2.1)
Loading from cache
symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing symfony/process ()
symfony/var-dumper suggests installing ext-symfony_debug ()
psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :))
psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSIX extension as well.)
psy/psysh suggests installing ext-readline (Enables support for arrow-key history navigation, and showing and manipulating command history.)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
cakephp/debug_kit suggests installing ext-sqlite (DebugKit needs to store panel data in a database. SQLite is simple and easy to use.)
Writing lock file
Generating autoload files
> Cake\Composer\Installer\PluginInstaller::postAutoloadDump
> App\Console\Installer::postInstall
Created `config/app.php` file
Set Folder Permissions ? (Default to Y) [Y,n]? Y
Updated Security.salt value in config/app.php
And here is my composer.json content :
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "http://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=5.5.9",
"cakephp/cakephp": "~3.2",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/plugin-installer": "*"
},
"require-dev": {
"psy/psysh": "#stable",
"cakephp/debug_kit": "~3.2",
"cakephp/bake": "^1.2"
},
"suggest": {
"phpunit/phpunit": "Allows automated tests to be run without system-wide install.",
"cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP."
},
"autoload": {
"psr-4": {
"App\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests",
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump"
},
"minimum-stability": "stable",
"prefer-stable": true
}
Finally succeed !
...fiercely helps compensate incompetence ^^
I follow the steps here : https://stackoverflow.com/a/14904607/2614077.
On the step 4, when I edit /bin/php file (in notepadd++ in my case), I have 2 small operations to do to make it work :
convert document to a UNIX format
encode it on UTF8 (without BOM)
This time everything work fine.
Happy to finally been abble to solve this problem.
Thanks a lot.

Downgrade Doctrine ORm 2.5 to 2.4

i want Downgrade Doctrine Orm 2.5 to 2.4 For solve this Error :
syntax error, unexpected '[', expecting ')'
Note : My php Version : 5.3 (Doctrine 2.5 needed to php 5.4 and later version)
And write this Code in Composer.json file :
{
"require": {
"doctrine/common": "2.4.*",
"doctrine/dbal": "2.4.*",
"doctrine/orm": "2.4.*"
}
}
and run composer task in cmd with this Code :
composer install
But Composer Download Doctrine 2.5
How Download Doctrine 2.4 With Composer
I just did a quick test and it downloads 2.4
just put this composer.json into a folder an run composer install:
composer.json
{
"name": "test/test",
"description": "test",
"license": "no",
"require": {
"doctrine/common": "2.4.*",
"doctrine/dbal": "2.4.*",
"doctrine/orm": "2.4.*"
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "stable"
}
As you can see in composer install output, doctrine/common, doctrine/dbal and doctrine/orm are all version 2.4.x. I run the test also with "preferred-install": "source" and "minimum-stability": "dev" same result.
composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing doctrine/lexer (v1.0.1)
Loading from cache
- Installing doctrine/annotations (v1.2.4)
Loading from cache
- Installing doctrine/collections (v1.3.0)
Loading from cache
- Installing doctrine/cache (v1.4.1)
Loading from cache
- Installing doctrine/inflector (v1.0.1)
Loading from cache
- Installing doctrine/common (v2.4.2)
Loading from cache
- Installing symfony/console (v2.6.7)
Loading from cache
- Installing doctrine/dbal (v2.4.4)
Loading from cache
- Installing doctrine/orm (v2.4.7)
Loading from cache
symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing symfony/process ()
symfony/console suggests installing psr/log (For using the console logger)
doctrine/orm suggests installing symfony/yaml (If you want to use YAML Metadata Mapping Driver)
Writing lock file
Generating autoload files

Categories