How to use composer
如何使用 composer 管理 第三方依賴
Dependency / Package Manager
npm
npm is nodejs package manager. It therefore targets nodejs environments, which usually means server-side nodejs projects or command-line projects (bower itself is a npm package). If you are going to do anything with nodejs, then you are going to use npm.bower
bower is a package manager that aims at (front-end) web projects. You need npm and nodejs to install bower and to execute it, though bower packages are not meant specifically for nodejs, but rather for the "browser" environment.composer
composer is a dependency manager that targets php projects. If you are doing something with symfony (or plain old php), this is likely the way to go當你是一人團隊/無需企業備份規格/或者老闆缺錢/
找供應商麻煩/沒有合適的軟件/沒有合適的經銷商、供應商
以下方法適合一些規模較少的備份用途,0成本
Terminology
Real-time processing
Real-Time Processing involves continuous input, process, and output of data. Hence, it processes in a short period of time.Batch processing
Batch processing is the processing of transactions in a group or batch. No user interaction is required once batch processing is underway.Command Line Interface (CUI)
Short for character user interface or command-line user interface, CUI is a way for users to interact with computer programs. It works by allowing the user (client) to issue commands as one or more lines of text (referred to as command lines) to a program. Good examples CUIs are MS-DOS and the Windows Command Prompt.Graphical User Interface (GUI)
GUI is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, instead of text-based user interfacesArchive
An archive is a collection of data moved to a repository for backup, to keep separate for compliance reasons or for moving off primary storage media. It can include a simple list of files or files organized under a directory or catalog structure (depending on how a particular program supports archiving).Housekeep
When referring to computers, housekeeping is a term used to describe the optimization of a hard drive. Housekeeping commonly involves removing old or unused files and programs, backing up data, or running disk utilities such as a ScanDisk, Defrag, or an antivirus scan. Housekeeping keeps the computer organized, running properly, and should be performed at least once a year.Oracle 產品的價錢都不是一般的平,不會是平民使用的東西。
打個比喻,有資本可以負擔這成本的公司,規模不會是一間辦公室,不會是一層辦公室,會是一棟大廈。
使用Oracle DB的客戶例如有政府,企業,頒授副學士或以上學歷的教育機構……
接下來完整教學,看圖識字。
Download
Visit https://getcomposer.org/download/For windows, Download the Composer-Setup.exe
Installation
Execute the installer (.exe)Do not tick "Developer mode"
Click [Next]
The program will auto-detect the command-line PHP location
Click [Browser...] to point your command-line PHP location (php.exe) if it failed to auto-detect
Click [Next]
If you using proxy
Tick "Use a proxy server to connect to internet"
If you don't use proxy, don't check the "Use a proxy server to connect to internet" option and leave proxy url blank.
It will create two https_proxy, http_proxy System variables
After the installation, you may change it
Add composer.exe to the Path, after that you may use composer.exe in cmd instead of putting the absolute path
Right click on PC > Properties
or
Go to Control Panel > System
Click "System protection"
Go to "Advanced" tab
Click [Environment Variables...]
Add for the current user, edit Path under "User variables..." section
Add for all users, edit Path under "System variables..." section
Select "Path"
Click [Edit]
Click [New]
Add the composer installed directory
Default at C:\ProgramData\ComposerSetup\bin
add ; to the path, append
C:\ProgramData\ComposerSetup\bin;
to the end of the path value
for windows 10, the UI enhanced and no ; required
Composer Syntax Examples
The below composer examples, I uploaded on Gitgist
Check composer installed version
composer --versionmy installed version is 1.9.1 2019-11-01
add/install/update the resource
composer require phpoffice/phpspreadsheetinstall the resource with a specified version
composer require phpoffice/phpspreadsheet:1.8.2
update resource according to the composer.json
composer update --no-dev
Reference
NPM/Bower/Composer - differences?
https://stackoverflow.com/questions/22918517/npm-bower-composer-differences
Composer
https://getcomposer.org/
https://stackoverflow.com/questions/22918517/npm-bower-composer-differences
Composer
https://getcomposer.org/
No comments:
Post a Comment