Starting to use composer when I currently dont use any PHP libraries - composer-php

So i recently came to the decision that I should start using composer to better manage my projects.
This stemmed from the fact that not to long ago I started using requireJS for my javascript and found it very useful.
The problem I am having is I currently do not use any PHP libraries and feel composer solves a problem I do not have.
So my Question is:
Should I focus on learning and using composer even before I know of any useful libraries? Or would I be better served exploring libraries until I reach a need for composer to manage them?
Should composer be used in a similar manner to requireJS to help me modulate my php code?

Related

How to fix when I update composer on laravel

I trying to run my laravel 5 project on laravel 8. When I am trying to update my laravel composer. I am fetching this kind of problem.
In order to have enough coverage on the updates and changes that you need you have to look at at least 2 parts.
PHP
There will be breaking changes to the languages and updates that you would need to make in order to ensure consistent behaviours across the PHP versions. The following link should have the relevant guides to help you with this.
E.g. https://www.php.net/manual/en/migration70.php
Laravel
Look at the /upgrade portion of the Laravel documentation. You should be able to find them at https://laravel.com/docs/{version}/upgrade
E.g. https://laravel.com/docs/5.1/upgrade
Given the large number of version jumps, you might want to consider re-writing the application in a fresh Laravel 9 (or latest) installation.
Best of luck!

Why do I need to compile Bootstrap instead of using the CDN in Laravel 8

I'm a graphic designer who just started learning Laravel this week, recently I've been searching how to install the latest bootstrap version in my project correctly, which is all I need to be honest and I'm not too comfortable with other options like Tailwind.
As some tutorials and answers have suggested I ended up compiling and using a famous project named laravel/ui, sadly the resulting version comes with a few changes, that just doesn't look as good in my opinion (different fonts like Nonito, colors and margins)
So now I'm wondering...
Why is it not recommended to just add the CDN links in my master template?
Is it possible to update this compiled CSS somehow to make it look as the CDN?
Sorry if this questions might be opinion based, but I'm really out of places to ask, seems like the documentation for Laravel 8.x has removed everything related to Frontend, which are making thing even more confusing for me with all these options Laravel offers.

How to install libraries without composer in drupal 8

In drupal 8, I am encountering modules that require libraries to be installed by Composer. However, I was wondering if I could skip the composer part and just install the libraries by hand.
Would I ever be able to do this?
(I have never gotten Composer to work)
Just extract the library at /libraries.
For colorbox, you should have root/libraries/colorbox/jquery.colorbox-min.js
But this way you miss the main purpose of composer cause it won't be possible to update all the dependence automatically.

Laravel Download and Installation

I'm a webdeveloper and I'm starting a huge project requested by a company.
I'm trying to figure out if is best to use a PHP framework or not, and in case, which one.
I know Codeigniter, but I wanted to look around to see what's the best framework at the moment. I found out Laravel is trending at the top so I wanted to try it out.
Being used to Codeigniter I usually download the zip file with all the phps inside and start working. I'm trying to do the same with Laravel but I saw you are to download and use composer to install it.
I'm not really used to the Terminal and I wanted to ask if that's the only way of installing it or if there is a downloadable version as in Codeigniter, CakePHP, etc...
You can always download the ZIPped code directly from project's GitHub site. You can find the base application here: https://github.com/laravel/laravel - you'll find a link at the bottom of the right column. This code is what composer downloads when you use that to setup the application.
If you want to use Laravel you will have to use Composer as this is what the application uses to manage its dependencies. It's not hard, as you'll only need to run a few commands.
You can learn more about how to install and use composer in the docs: https://getcomposer.org/download/

Installing yii2 framework using Xampp - do i need a github account?

A couple of years of go i used to program using PHP, but without frameworks. With these recent developments I've decided to get in the to the game and try using one. I've decided to use yii 2.0 .
I've read some of the documentation and in my opinion there is some lack of information (at least for who is getting started), so i´m having some problems installing yii 2.0 on my computer using Xampp. The PHP version is 5.5.9.
From what i could understand i downloaded the yii 2.0 framework, extracted the content and copied to c:\xampp\htdocs\yii2
I've already installed the composer, so the the next thing to do i think would be, using the cmd, do these two lines of code:
composer global require "fxp/composer-asset-plugin:1.0.0"
composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
The problem is when i do the last one it asks for username and password i think of GitHub. Can you tell me if I'm obligated to have an account on github to install yii 2.0 framework.
Is there a way to get around this?
Yii2 is integrated with composer asset plugin. It allows download Bower and NodeJs packages through Composer.
Github account is required to overcome API rate limit. Here is the explanation from the main contributor of this extension:
It's a rate limit of Github API. In anonymous access, Github at a
greatly reduced limit (60/hr it seems to me), and we must be logged
with a token for have a much higher limit.
See composer/composer#1569 and composer/composer#1877
The problem also exists using Nodejs and Bower.
You can find it in this issue, it's 9th from the top.
I think workaround with installing Bower and the same packages is not an option, because initially and with each framework update you must manually synchronize packages with their versions and override some configuration. Also some extensions require javascript plugins and using composer asset plugin too. So you have to do the same with each of them too. It simply not worth it. And having account on Github for web developer nowadays is kind of de facto standard.
Just create Github account if you are still don't have one and everything should be fine. Earlier updating process was pretty slow, now it's faster and I found this approach pretty interesting and flexible.

Resources