tutorials How to Install Composer and add the dompdf library

in #utopian-io9 years ago

Composer is a tool dependency management which is destined for PHP.Usefulness of this tool it self is to help developers in managing the library used when the web creation process.
Useful Composer
When the composer has not created yet, many of the problems experienced by web developers in developing applications such as:
-When building applications and requires a lot of libraries, then whether to download one by one?
-Some libraries used are interconnected and require other libraries, indirectly developers have to download other libraries right?
-Then if the library used to release the latest version, does the developer have to redownload and then upload it again?
To overcome the above problems, the problem is having to use composer.How the composer work is quite simple, later you are required to write the required library in a file (composer.json). Then the composer will search and install the library automatically. Similarly, if there is a new update on the library used, simply change the composer.json file then automatically also composer will update it.
In essence the composer indirectly helps the developer in lightening his work, because the composer install and update the library automatically.
How to Install Composer .
Attention!
-Before installing composer first you must have xampp and wampp applications because as commandline.
-Do not forget to connect to the internet, because during the process the installer will download the composer and some necessary components.
The first step
Double click composer-setup.exe >> next. Next will appear a window like below
1.png
The next step we are asked to determine the location of the php file (php.exe file) that will be used in the command line.
2.png
From the above screenshot, the php.exe file is located at C:\ xampp\ php\php.exe Then click next.
In the proxy window setting directly next only, without checklist "use a proxy server to connect internet" because I do not use proxy server.
3.jpg
On this page will show you the review settings that will be run. Click install to continue the installation process.
4.png
then the notification window will appear that there has been a change in windows environment. This change is intended to allow the composer to run at a command prompt.
5.jpg
Klik next>>
the installation process is complete and click finish to close the installation window.
6.jpg
How to add a dompdf library in a web application Before adding the dompdf library we make sure first whether the composer is installed or not yet.How to enter command prompt then type composer. If already installed will appear as shown below:
7.jpg
And do not forget to connect internet when want to add dompdf.
The first step to add dompdf.
-Create a folder as you like in htdocs
-Then copy and paste the composer.json file in the folder you created earlier
8.jpg
Edit composer.json
9.jpg
Add commands like the red circle,
Open the folder you created earlier (CI_Utami) via the command prompt, then type
composer update.
10.jpg
Then the composer will automatically download and update. When the update process is complete then the composer creates a folder named vendor and a file called composer.lock inside the CI_Utami folder.
11.jpg
And the dompdf library has been created, it is located inside the vendor folder.
12.jpg



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @isfar I am @utopian-io. I have just upvoted you at 7% Power!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!
  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • I introduced a competition factor. My vote is based also on how competitive the category used is.

Human Curation

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.098
BTC 64388.69
ETH 1869.17
USDT 1.00
SBD 0.38