Step 1 : Download and run Composer-Setup.exe
Step 2 : Open Command Prompt on Windows and Run Script
-Download the installer to the current directory
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
-Verify the installer SHA-384 which you can also cross-check here
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
-Run the installer
php composer-setup.php
-Remove the installer
php -r "unlink('composer-setup.php');"
-----------------------After Install and Telling Message-------------------------
All settings correct for using Composer
Downloading 1.1.3...
Composer successfully installed to: C:\Users\suttipong\composer.phar
Use it: php composer.phar
-Update Composer
php composer.phar self-update
HOW TO USE COMPOSER
- Introduction
- composer.json: Project Setup
- Installing Dependencies
- composer.lock - The Lock File
- Packagist
- Autoloading
Example : Create Project laravel with Composer :
composer create-project laravel/laravel exampleProject --prefer-dist
<?php
// Pull in our bootstrap file.
require_once '../src/ProjectName/bootstrap.php';
$app->run();
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}% !-f
RewriteCond %{REQUEST_FILENAME}% !-d
RewriteRule ^ index.php [QSA,L]
<?php
require_once '../vendor/autoload.php';
$app = new \Slim\App();
require_once 'Routes.php';
$app->get('/example/{name}', function ($request, $response, $args) {
echo 'Hello ' . $args['name'];
}
/A
foo.php
tar.php
B/
bar.php
<?php
require_once( 'B/bar.php' );
?>
<?php
require_once( 'tar.php');
?>
1.) Composer - Dependency Management for PHP
https://github.com/kullawattana/composer
2.) Slim Framework 3 Skeleton Application
https://github.com/slimphp/Slim-Skeleton
3.) Download Composer for Create laravel and Slim Project
https://getcomposer.org/download/
4.) Laravel Project
https://laravel.com/docs/4.2/quick
5.) Install Composer on Windows
https://www.youtube.com/watch?v=ZocYVPP3nQY
6.) CURL
http://php.net/manual/en/book.curl.php
ไม่มีความคิดเห็น :
แสดงความคิดเห็น