zoukankan      html  css  js  c++  java
  • composer的安装和使用

      由于工作中需要用到leancloud的LeanCloud PHP SDK,支持composer安装,所以就下载composer工具了,

      安装之前可以用composer命令检测是否已经安装了,命令是:composer直接回车,如果显示command not found: composer表示还未安装;如果显示了composer的图标表示已经安装了。

    Suppose:

    You have a project that depends on a number of libraries.
    Some of those libraries depend on other libraries.
    Composer:

    Enables you to declare the libraries you depend on.
    Finds out which versions of which packages can and need to be installed, and installs them (meaning it downloads them into your project).

      安装步骤:  

      1.php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
      2.php -r "if (hash_file('SHA384', 'composer-setup.php') === 'e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
      3.php composer-setup.php
      4.php -r "unlink('composer-setup.php');"

      5.把composer.phar移动到环境变量里,同时把composer.phar重命名为composer,用命令 mv composer.phar /usr/local/bin/composer

      

      使用方法:

      1.在你的项目目录使用composer,切换到你的项目目录,命令 cd /Applications/MAMP/htdocs/DPOpenAPI/

      2.下载你需要的文件,命令 composer require leancloud/leancloud-sdk

  • 相关阅读:
    1. DataBinding
    DataBinding 笔记
    做过的自定义 View
    自定义View
    拖拖看小游戏
    UIView
    UIButton
    故事板
    (译)Getting Started——1.3.4 Writing a Custom Class(编写自定义的类)
    (译)Getting Started——1.3.3 Working with Foundation(使用Foundation框架)
  • 原文地址:https://www.cnblogs.com/zhangxiaoliu/p/5806575.html
Copyright © 2011-2022 走看看