Download the PHP package rice/ctl without Composer

On this page you can find all versions of the php package rice/ctl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ctl

License .github/workflows/ci.yml

php 命令行 (php control)

安装

功能点

  1. setting, getting 注释生成命令 锚点
  2. json 转 class 对象命令 锚点

访问器自动生成注释

以这个 tests\Support\Annotation\Cat.php 文件为例,我们使用了 Accessor 这个 trait。所以会 存在 setxxx()getxxx(),但是这里面会造成实例化类后调用没有相关的函数提示。为了解决这个问题,可以 使用 php ctl.php rice:accessor xxx\tests\Support\Annotation\Cat.php 去执行自动生成注释。

只会生成protected 属性的注释,如果属性没有指定类型,那么会查看注释是否有 @var 指定相关类型,有的 话自动获取

生成前:

生成后:

tips:推荐属性是对象时不要使用长链式调用

bad
better

Cat重写一个方法

这样子做的好处是提高内聚性,虽然直接链式调用会方便使用,但是出现链式的一个 环节要修改名称的时候,如果多个地方都有使用到,那么修改起来就会存在多个地方。 重写方法后,统一使用 Cat 类的 getSpeakText 方法。需要修改时,就只 改动 Cat 类就行了,降低出错成本。

json 转 class 对象

_class_name: 类名称 _type: 类的类型(DTO 或 Entity) _namespace: 类的命名空间

调用 php generator.php rice:json_to_class xxx\basic\tests\Generate\tsconfig.json xxx\basic\tests\Generate\

第一个参数是输入的 json 文件路径,第二个参数是生成文件所在的目录


All versions of ctl with dependencies

PHP Build Version
Package Version
Requires friendsofphp/php-cs-fixer Version ^3.13
symfony/console Version ^5.4
phpunit/phpunit Version ^9.5
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rice/ctl contains the following files

Loading the files please wait ...