Phalcon Devtools

Phalcon Devtools是一组用于生成框架代码的有用脚本。 可以使用简单的命令生成应用程序的核心组件,从而可以使用Phalcon轻松开发应用程序。(Phalcon Devtools are a collection of useful scripts to generate skeleton code. Core components of your application can be generated with a simple command, allowing you to easily develop applications using Phalcon.)

Github星跟蹤圖

Phalcon PHP是一个作为C扩展提供的Web框架,可提供高性能和低资源消耗。

Phalcon Devtools 工具为您提供了有用的脚本来生成代码,有助于开发与Phalcon框架一起使用的更快速,更简单的应用程序。

要求
  • PHP >= 5.5
  • Phalcon >= 3.3.0

通过 Composer 安装

将composer安装在公共位置或项目中:

curl -s http://getcomposer.org/installer | php

创建composer.json文件,如下所示:

{
    "require-dev": {
        "phalcon/devtools": "~3.4"
    }
}

如果您仍在使用Phalcon 2.0.x,请使用以下代码创建composer.json:

{
    "require-dev": {
        "phalcon/devtools": "^2.0"
    }
}

运行composer安装程序:

php composer.phar install
用法

要获取可用命令列表,请执行以下命令:

phalcon命令帮助

此命令应显示类似于:

$ phalcon --help
Phalcon DevTools (3.4.0)
Help:
  Lists the commands available in Phalcon devtools
Available commands:
  info             (alias of: i)
  commands         (alias of: list, enumerate)
  controller       (alias of: create-controller)
  module           (alias of: create-module)
  model            (alias of: create-model)
  all-models       (alias of: create-all-models)
  project          (alias of: create-project)
  scaffold         (alias of: create-scaffold)
  migration        (alias of: create-migration)
  webtools         (alias of: create-webtools)
  serve            (alias of: server)
  console          (alias of: shell, psysh)
许可证

Phalcon Developer Tools是根据新BSD许可证授权的开源软件。
©Phalcon框架团队和贡献者

概覽

名稱與所有者phalcon/phalcon-devtools
主編程語言JavaScript
編程語言PHP (語言數: 9)
平台Linux, Mac, Windows
許可證Other
發布數63
最新版本名稱v4.2.0 (發布於 )
第一版名稱v2.0.1 (發布於 2015-05-07 22:29:45)
創建於2012-03-21 05:18:46
推送於2023-09-04 17:33:04
最后一次提交2021-09-16 14:04:11
星數1.3k
關注者數131
派生數631
提交數2.6k
已啟用問題?
問題數572
打開的問題數25
拉請求數792
打開的拉請求數8
關閉的拉請求數157
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

Phalcon Devtools

codecov
Latest Version
Software License
Total Downloads
Daily Downloads
Build Status

Phalcon WebTools

What's Phalcon?

Phalcon PHP is a web framework delivered as a C extension providing high performance and lower resource consumption.

What are Devtools?

This tools provide you useful scripts to generate code helping to develop faster and easy applications that use
with Phalcon framework.

Requirements

  • PHP >= 7.2
  • Phalcon >= 4.0.0

Installing via Composer

Install composer in a common location or in your project:

curl -s http://getcomposer.org/installer, php

Create the composer.json file as follows:

{
    "require-dev": {
        "phalcon/devtools": "~4.0"
    }
}

If you are still using Phalcon 3.4.x, create a composer.json with the following instead:

{
    "require-dev": {
        "phalcon/devtools": "^3.4"
    }
}

Run the composer installer:

php composer.phar install

Build .phar

Install composer and box in a common location or in your project:

curl -s http://getcomposer.org/installer, php
bin/composer install

Build phar file phalcon-devtools

bin/box build -v
chmod +xr ./phalcon.phar
# Test it!
php ./phalcon.phar

Installation via Git

Phalcon Devtools can be installed by using Git.

Just clone the repo and checkout the current branch:

cd ~
git clone https://github.com/phalcon/phalcon-devtools.git
cd phalcon-devtools

This method requires a little bit more of setup. Probably the best way would be to symlink
the phalcon file to a directory in your PATH, so you can issue phalcon commands in each directory
where a phalcon project resides.

cd phalcon-devtools
ln -s $(pwd)/phalcon /usr/bin/phalcon
chmod ugo+x /usr/bin/phalcon

If you get a "phalcon: command not found" message while creating the symlink, make an alias.

alias phalcon=/home/[USERNAME]/phalcon-devtools/phalcon

Usage

To get a list of available commands just execute following:

phalcon commands help

This command should display something similar to:

$ phalcon --help

Phalcon DevTools (3.4.0)

Help:
  Lists the commands available in Phalcon devtools

Available commands:
  info             (alias of: i)
  commands         (alias of: list, enumerate)
  controller       (alias of: create-controller)
  module           (alias of: create-module)
  model            (alias of: create-model)
  all-models       (alias of: create-all-models)
  project          (alias of: create-project)
  scaffold         (alias of: create-scaffold)
  migration        (alias of: create-migration)
  webtools         (alias of: create-webtools)
  serve            (alias of: server)
  console          (alias of: shell, psysh)

Database adapter

Should add adapter parameter in your db config file (if you use not MySQL database).

For PostgreSQL it will be something like:

$config = [
  'host'     => 'localhost',
  'dbname'   => 'my_db_name',
  'username' => 'my_db_user',
  'password' => 'my_db_user_password',
  'adapter'  => 'Postgresql'
];

Configuration file

By creating config.json or any other configuration file called config in root project you can set options for all possible commands, for example:

{
  "migration" : {
    "migrations": "App/Migrations",
    "config": "App/Config/db.ini"
  },
  "controller" : {
    "namespace": "Phalcon\\Test",
    "directory": "App/Controllers",
    "base-class": "App\\MyAbstractController"
  }
}

And then you can use use phalcon migration run or phalcon controller SomeClass and those commands will be executed with options from file. Arguments provided by developer from command line will overwrite existing one in file.

License

Phalcon Developer Tools is open source software licensed under the New BSD License.
© Phalcon Framework Team and contributors

去到頂部