I don't know how to use twbs in my Laravel project. So how can I delete this folder?
composer.json
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"twbs/bootstrap": "4.0.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
}
}
The good idea is to use composer remove command without updating all other packages:
composer remove twbs/bootstrap
Remove "twbs/bootstrap": "4.0.0" line from composer.json and then run command:
composer update
Run This command For Remove any package
composer remove twbs/bootstrap
Related
This has just randomly started happening and i've never seen this so i'm not sure how to fix it. I came to reinstall all the plugins for a bedrock install from wpackagist and instead of going into web/app/plugins they are all installing in the vendor folder. They weren't doing this last time i installed them, here is composer.json, nothing has changed so i don't know what is going on:
{
"name": "roots/bedrock",
"type": "project",
"license": "MIT",
"description": "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure",
"homepage": "https://roots.io/bedrock/",
"authors": [
{
"name": "Scott Walkinshaw",
"email": "scott.walkinshaw#gmail.com",
"homepage": "https://github.com/swalkinshaw"
},
{
"name": "Ben Word",
"email": "ben#benword.com",
"homepage": "https://github.com/retlehs"
}
],
"keywords": [
"bedrock", "composer", "roots", "wordpress", "wp", "wp-config"
],
"support": {
"issues": "https://github.com/roots/bedrock/issues",
"forum": "https://discourse.roots.io/category/bedrock"
},
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org",
"only": ["wpackagist-plugin/*", "wpackagist-theme/*"]
},
{
"type": "vcs",
"url": "git#github.com:clickds/save-share-cart.git"
},
{
"type": "vcs",
"url" : "git#github.com:clickds/woocommerce-additional-variation-images.git"
}
],
"require": {
"php": ">=7.1",
"composer/installers": "^1.11",
"vlucas/phpdotenv": "^5.3",
"oscarotero/env": "^2.1",
"roots/bedrock-autoloader": "^1.0",
"roots/bedrock-disallow-indexing": "^2.0",
"roots/wordpress": "5.8",
"roots/wp-config": "1.0.0",
"roots/wp-password-bcrypt": "1.0.0",
"wpackagist-plugin/woocommerce": "^5.7",
"wpackagist-plugin/disable-gutenberg": "^2.5",
"wpackagist-plugin/custom-field-builder": "^1.2",
"clickds/save-share-cart" : "^1.0.4",
"wpackagist-plugin/woocommerce-gateway-stripe": "^5.8",
"wpackagist-plugin/all-in-one-wp-security-and-firewall": "^4.4",
"wpackagist-plugin/w3-total-cache": "^2.1",
"wpackagist-plugin/woocommerce-gateway-paypal-express-checkout": "^2.1",
"wpackagist-plugin/simple-taxonomy-ordering": "^2.3",
"wpackagist-plugin/wp-mail-smtp": "^3.2",
"glenelkins84/woocommerce-additional-variation-images" : "^1.9.2",
"wpackagist-plugin/import-xml-feed": "^2.1",
"wpackagist-plugin/woo-variation-swatches": "^1.1",
"wpackagist-plugin/woo-custom-related-products": "^1.3",
"wpackagist-plugin/purchase-orders-for-woocommerce": "^1.8"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.6.0",
"roave/security-advisories": "dev-master"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"allow-plugins": {
"composer/installers": false,
"roots/wordpress-core-installer": true
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"installer-paths": {
"web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
"web/app/plugins/{$name}/": ["type:wordpress-plugin"],
"web/app/themes/{$name}/": ["type:wordpress-theme"]
},
"wordpress-install-dir": "web/wp"
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"test": [
"phpcs"
]
}
}
It seems "WordPress boilerplate" works separately from WordPress core.
Generally, using composer, the installed packages are stored in the vendor folder and can be called by requiring autoload.php file in your project.
I modified a symfony 4 bundle to fix some bug. I now want to deploy my project through https://deployer.org/.
So I added this bundle not ignored in the .gitignore so that the folder of the bundle with my modifications is available on my github repo.
When executing the "deploy" command of deployer, it executes the command "/composer.phar install --verbose --prefer -dist --no-progress --no-interaction --no-dev --optimize-autoloader --no-suggest" so that the folder of my bundle edit is overwritten by the original bundle folder from https://packagist.org/.
I would like to modify my composer.json to define the path of my modified bundle and that it is not overwritten.
Here is what I tried in the composer.json of my main project:
{
"type": "my-project",
"license": "proprietary",
"repositories": [
{
"type": "path",
"url": "/vendor/my/modifiedBundle",
"packagist.org": false,
}
],
"require": {
......
"my/modifiedBundle": "0.6.1",
......
},
"require-dev": {
.....
},
"config": {
"preferred-install": {
"my/modifiedBundle": "source",
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
....
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"#auto-scripts"
],
"post-update-cmd": [
"#auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": true,
"require": "4.3.*"
}
}
}
Here is the composer.json of my modified bundle:
{
"name": "my/modifiedBundle",
"type": "symfony-bundle",
"license": "MIT",
"require": {
...
},
"require-dev": {
...
},
"config": {
"sort-packages": true
},
"autoload": {
"psr-4": {
"my\\modifiedBundle\\": ""
}
},
"autoload-dev": {
"psr-4": {
"my\\modifiedBundle\\Tests\\": "tests/"
}
}
}
But after my modifications, the modified bundle is still overwritten by the original bundle, do you have any idea?
#Skros2 solved his problem on:
Fork the bundle to its own repository
Edit the fork
Refer his fork on his composer.jsonproject
how to refer a fork.
{
"repositories": [
{
"type": "git",
"url": "https://github.com/foobar/intermediate.git"
},
{
"type": "pear",
"url": "http://pear.foobar.repo",
"vendor-alias": "foobar"
}
],
"require": {
"foobar/TopLevelPackage1": "*",
"foobar/TopLevelPackage2": "*"
}
}
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"MatthiasMullie/Minify": "^1.3",
"guzzlehttp/psr7": "^1.0",
"intervention/image": "^2.3",
"kbsali/redmine-api": "^1.5",
"kordy/ticketit": "^0.3.6",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"laravelcollective/html": "5.*",
"maatwebsite/excel": "~2.1.0",
"maddhatter/laravel-fullcalendar": "1.*",
"milon/barcode": "^5.0",
"psr/http-message": "^1.0",
"unisharp/laravel-filemanager": "^1.7"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.7",
"jamesiarmes/php-ntlm": "dev-master",
"php-ews/php-ews": "dev-master"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true
}
}
I'm in the process of upgrading our Laravel 5.1 app to Laravel 5.5, and have been following the upgrade guides.
Whilst performing the upgrade from 5.3 to 5.4, I've run into an issue with failing unit tests that use MailThief's InteractsWithMail trait.
composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7",
"laravel/framework": "5.4.*",
"laravelcollective/html": "5.4.*",
"jeremykendall/php-domain-parser": "^3.0",
"laracasts/flash": "^2.0",
"aws/aws-sdk-php": "^3.21",
"league/flysystem-aws-s3-v3": "~1.0",
"maatwebsite/excel": "^2.1",
"league/oauth2-client": "1.4.*",
"microsoft/microsoft-graph": "^0.1.1",
"guzzlehttp/guzzle": "^6.2",
"dusterio/laravel-aws-worker": "^0.1.9",
"zizaco/entrust": "5.2.x-dev",
"anchu/ftp": "^2.0",
"predis/predis": "~1.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~6",
"phpspec/phpspec": "~2.1",
"laravel/homestead": "^4.0",
"tightenco/mailthief": ">=0.3.8",
"barryvdh/laravel-ide-helper": "*",
"doctrine/dbal": "^2.5",
"symfony/dom-crawler": "~3.1",
"symfony/css-selector": "~3.1",
"laravel/browser-kit-testing": "^2.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
},
"files": [
"app/Support/Helpers.php"
]
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
],
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan ide-helper:generate -M",
"php artisan ide-helper:meta",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
Unit test stack trace:
Target [Illuminate\Contracts\View\Factory] is not instantiable while building [MailThief\MailThiefFiveFourCompatible].
/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:895
/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:735
/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:608
/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:575
/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:728
/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:862
/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:790
/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:756
/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:608
/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:575
/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:728
/app/vendor/laravel/framework/src/Illuminate/Container/Container.php:1172
/app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:159
/app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:128
/app/vendor/tightenco/mailthief/src/Testing/InteractsWithMail.php:21
/app/vendor/tightenco/mailthief/src/Testing/InteractsWithMail.php:59
I'm using Homestead hosted on Windows 10.
I'm trying to install some external JS libraries located in Github in a SF2 project with composer.json.
composer.json:
{
"name": "myproject",
"license": "my project",
"type": "project",
"description": "my project",
"autoload": {
"psr-0": { "": "src/" }
},
"repositories": {
"medium-editor" : {
"type": "package",
"package": {
"name": "daviferreira/medium-editor",
"type": "component",
"version": "master",
"source": {
"url": "git://github.com/daviferreira/medium-editor.git",
"type": "git",
"reference": "master"
},
"extra": {
"component": {
"scripts": [
"dist/js/medium-editor.min.js"
],
"styles": [
"dist/css/medium-editor.min.css",
"dist/css/themes/*.min.css"
]
}
},
"require": {
"robloach/component-installer": "*"
}
}
},
"classList" : {
"type": "package",
"package": {
"name": "eligrey/classList.js",
"type": "component",
"version": "master",
"source": {
"url": "git://github.com/eligrey/classList.js.git",
"type": "git",
"reference": "master"
},
"extra": {
"component": {
"scripts": [
"classList.min.js"
]
}
},
"require": {
"robloach/component-installer": "*"
}
}
}
},
"require": {
...
"daviferreira/medium-editor" : "dev-master",
"eligrey/classList.js" : "dev-master"
},
"require-dev": {
"phpunit/phpunit": "3.7.*"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin",
"component-dir": "web/components"
},
"minimum-stability": "stable",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "symlink",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}
The libraries are downloaded but...
I'm expecting that composer will create, with the "robloach/component-installer" dependency, a copy of the files specified in "extra" of the "component" type package to the "web/component" directory, but it doesn't.
What's wrong with my config? Thanks!
After reading more carefully the robloach plugin documentation, I've tried again and finally found a solution. The problem was that I probably had made a lot of "composer update" with different configs and was obliged to remove / reinstall the packages to make it work! So the original config post in the question is the good one...
I put it again to be sure!
"medium-editor" : {
"type": "package",
"package": {
"require": {
"robloach/component-installer": "*"
},
"name": "daviferreira/medium-editor",
"type": "component",
"version": "master",
"source": {
"url": "git://github.com/daviferreira/medium-editor.git",
"type": "git",
"reference": "master"
},
"extra": {
"component": {
"scripts": [
"dist/js/medium-editor.min.js"
],
"styles": [
"dist/css/medium-editor.min.css",
"dist/css/themes/*.min.css"
]
}
}
}
},
And for sure, don't forget to add the Robloach component in the "require" libraries:
"robloach/component-installer": "dev-master",
I would suggest to use bower for fetching frontend libraries. Composer was created for managing php libs dependencies. It is importand to separate this layers because it's the easiest solution to implement.
Try PHP Composer Asset Manager package with composer if the problem persist i think you should execute the command manualy:
app/console assets:install .