首页 > 其他分享 >composer:升级自身版本 self-update(2.5.x)

composer:升级自身版本 self-update(2.5.x)

时间:2023-07-27 14:33:16浏览次数:63  
标签:no -- self update version composer

一,查看升级前的版本:

liuhongdi@lhdpc:/data/php/tpapibase$ composer --version
Composer version 2.5.1 2022-12-22 15:33:54

二,升级,注意先sudo到root

liuhongdi@lhdpc:/data/php/tpapibase$ sudo -i
[sudo] liuhongdi 的密码:
root@lhdpc:~# composer self-update
Upgrading to version 2.5.8 (stable channel).
Use composer self-update --rollback to return to version 2.5.1

三,查看升级后的版本:

liuhongdi@lhdpc:/data/php/tpapibase$ composer --version
Composer version 2.5.8 2023-06-09 17:13:21

四,查看composer的可用命令

liuhongdi@lhdpc:/data/php/tpapibase$ composer list
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 2.5.8 2023-06-09 17:13:21

Usage:
  command [options] [arguments]

Options:
  -h, --help                     Display help for the given command. When no command is given display help for the list command
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi|--no-ansi           Force (or disable --no-ansi) ANSI output
  -n, --no-interaction           Do not ask any interactive question
      --profile                  Display timing and memory usage information
      --no-plugins               Whether to disable plugins.
      --no-scripts               Skips the execution of all scripts defined in composer.json file.
  -d, --working-dir=WORKING-DIR  If specified, use the given directory as working directory.
      --no-cache                 Prevent use of the cache
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  about                Shows a short information about Composer
  archive              Creates an archive of this composer package
  audit                Checks for security vulnerability advisories for installed packages
  browse               [home] Opens the package's repository URL or homepage in your browser
  bump                 Increases the lower limit of your composer.json requirements to the currently installed versions
  check-platform-reqs  Check that platform requirements are satisfied
  clear-cache          [clearcache|cc] Clears composer's internal package cache
  completion           Dump the shell completion script
  config               Sets config options
  create-project       Creates new project from a package into given directory
  depends              [why] Shows which packages cause the given package to be installed
  diagnose             Diagnoses the system to identify common errors
  dump-autoload        [dumpautoload] Dumps the autoloader
  exec                 Executes a vendored binary/script
  fund                 Discover how to help fund the maintenance of your dependencies
  global               Allows running commands in the global composer dir ($COMPOSER_HOME)
  help                 Display help for a command
  init                 Creates a basic composer.json file in current directory
  install              [i] Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json
  licenses             Shows information about licenses of dependencies
  list                 List commands
  outdated             Shows a list of installed packages that have updates available, including their latest version
  prohibits            [why-not] Shows which packages prevent the given package from being installed
  reinstall            Uninstalls and reinstalls the given package names
  remove               Removes a package from the require or require-dev
  require              [r] Adds required packages to your composer.json and installs them
  run-script           [run] Runs the scripts defined in composer.json
  search               Searches for packages
  self-update          [selfupdate] Updates composer.phar to the latest version
  show                 [info] Shows information about packages
  status               Shows a list of locally modified packages
  suggests             Shows package suggestions
  update               [u|upgrade] Updates your dependencies to the latest version according to composer.json, and updates the composer.lock file
  validate             Validates a composer.json and composer.lock

说明:刘宏缔的架构森林—专注it技术的博客,
网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/07/20/composer-sheng-ji-zi-shen-ban-ben-selfupdate-2-5-x/
代码: https://github.com/liuhongdi/ 或 https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: [email protected]

五,查看self-update的帮助信息

liuhongdi@lhdpc:/data/php/tpapibase$ composer help self-update
Description:
  Updates composer.phar to the latest version

Usage:
  self-update [options] [--] [<version>]
  selfupdate

Arguments:
  version                        The version to update to

Options:
  -r, --rollback                 Revert to an older installation of composer
      --clean-backups            Delete old backups during an update. This makes the current version of composer the only backup available after the update
      --no-progress              Do not output download progress.
      --update-keys              Prompt user for a key update
      --stable                   Force an update to the stable channel
      --preview                  Force an update to the preview channel
      --snapshot                 Force an update to the snapshot channel
      --1                        Force an update to the stable channel, but only use 1.x versions
      --2                        Force an update to the stable channel, but only use 2.x versions
      --2.2                      Force an update to the stable channel, but only use 2.2.x LTS versions
      --set-channel-only         Only store the channel as the default one and then exit
  -h, --help                     Display help for the given command. When no command is given display help for the list command
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi|--no-ansi           Force (or disable --no-ansi) ANSI output
  -n, --no-interaction           Do not ask any interactive question
      --profile                  Display timing and memory usage information
      --no-plugins               Whether to disable plugins.
      --no-scripts               Skips the execution of all scripts defined in composer.json file.
  -d, --working-dir=WORKING-DIR  If specified, use the given directory as working directory.
      --no-cache                 Prevent use of the cache
  -v|vv|vvv, --verbose           Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  The self-update command checks getcomposer.org for newer
  versions of composer and if found, installs the latest.
  
  php composer.phar self-update
  
  Read more at https://getcomposer.org/doc/03-cli.md#self-update-selfupdate

标签:no,--,self,update,version,composer
From: https://www.cnblogs.com/architectforest/p/17584826.html

相关文章

  • 自动化测试 | python | self说明
    1.从函数的语法上讲,self是形参,就可以是任意的变量名,只不过我们习惯性将这个形参写作self。 2.self是普通的形参,但是在调⽤的时候没有传递实参值,原因是,Python解释器在执⾏代码的时候,⾃动的将调⽤这个⽅法的对象传递给了self,即self的本质是对象。 3.......
  • 模型类中建立外键的常用方法 db_constraint=False,self.user.id
    1.user=models.ForeignKey(to=User,related_name='order_user',on_delete=models.DO_NOTHING,db_constraint=False,verbose_name="下单用户") to=Order:这是ForeignKey的一个参数,用于指定这个外键字段将关联到的目标模型。在这个例子中,外键字段将关联到名为Order的模......
  • mysql update死锁
    如何实现“mysqlupdate死锁”引言MySQL的死锁是指两个或多个事务相互等待对方释放资源而无法继续执行的情况。在开发中,我们需要了解如何实现死锁,以便更好地理解死锁产生的原因,并能够针对性地解决这类问题。本文将介绍如何使用MySQL实现一个简单的update死锁场景,并提供相应的代码......
  • mysql update 返回主键
    MySQLUpdate返回主键当我们在使用MySQL进行数据更新操作时,有时候需要获取被更新的数据的主键。MySQL提供了一种方法可以在更新数据时返回主键值,这对于某些特定的业务场景非常有用。为什么需要返回主键值?在某些情况下,我们需要在更新数据之后获取该数据的主键值。例如,假设我们有......
  • update ClosedSurfaceRepresentation python
    如何实现"updateClosedSurfaceRepresentationpython"流程概述要实现"updateClosedSurfaceRepresentationpython",需要按照以下步骤进行操作:步骤描述1导入所需的模块2加载或创建3D模型3获取闭合曲面的表示4执行更新操作5保存或显示更新后的结果......
  • python的传参 self
    Python的传参self在Python中,我们经常会看到类的方法定义中的第一个参数是self。但是,对于初学者来说,这个self是一个比较迷惑的概念。本文将详细介绍Python中的self参数,并通过一些代码示例来加深理解。什么是selfself是一个约定俗成的命名,它表示对象自身。它是类的实例方法的第一......
  • You can’t specify target table ‘aaa′ for update in FROM clause
    Youcan’tspecifytargettable‘aaa′forupdateinFROMclause使用MySQL执行DELETEFROM时,若子查询的FROM子句和更新/删除对象使用同一张表,会出现错误。针对“同一张表”这个限制,撇开效率不谈,多数情况下都可以通过多加一层SELECT别名表来变通解决,如下:DELETEFRO......
  • java字符串update sql语句实现逗号隔开多个修改
    实现Java字符串UpdateSQL语句实现逗号隔开多个修改作为一名经验丰富的开发者,我将教你如何使用Java字符串拼接和SQL语句来实现逗号隔开多个修改。首先,我将给你整个流程的概览,然后逐步教你每一步需要做什么,并提供相应的代码和注释。整体流程概览以下是实现此功能的大致流程:步......
  • mysql查询的时候可以同时update吗
    实现“mysql查询的时候可以同时update”作为一名经验丰富的开发者,我将向你介绍如何实现在MySQL查询的同时进行更新操作。流程图首先,我们来看一下整个操作的流程:步骤描述1.创建数据库连接2.开始一个事务3.执行查询操作4.根据查询结果进行更新操作5.提......
  • Jap update小例子
    使用Jpa更新时:@Transactional@Modifying@Query("updateGuideScreenSyncMonitoringgsetg.status='1'whereg.ipin(:ips)")voidupdateStatusOffline(@org.springframework.data.repository.query.Param("ips")List<String>ips);注意......