phalcon / devtools
This tools provide you useful scripts to generate code helping to develop faster and easy applications that use with Phalcon framework.
Fund package maintenance!
phalcon
Open Collective
Installs: 1 852 491
Dependents: 71
Suggesters: 3
Security: 0
Stars: 1 332
Watchers: 132
Forks: 630
Open Issues: 34
Language:JavaScript
Requires
- php: >=7.3
- ext-pdo: *
- ext-phalcon: >4.0
- nikic/php-parser: ^4.2.4
- phalcon/migrations: ^2.0
- psy/psysh: ~0.9
- vlucas/phpdotenv: ^3.6|^4.0|^5.0
Requires (Dev)
- codeception/codeception: ^4.1
- codeception/module-asserts: ^1.3
- codeception/module-cli: ^1.0
- codeception/module-filesystem: ^1.0
- codeception/module-phpbrowser: ^1.0
- codeception/specify: ^1.2
- codeception/verify: ^1.2
- humbug/box: ^3.13
- phalcon/ide-stubs: ^4.0.0
- phpdocumentor/reflection-docblock: ^5.2
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: ^3.5
- vimeo/psalm: ^4.6
- dev-master
- 5.0.x-dev
- 4.3.x-dev
- 4.2.x-dev
- v4.2.0
- 4.1.x-dev
- v4.1.1
- v4.1.0
- 4.0.x-dev
- v4.0.8
- v4.0.7
- v4.0.6
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v4.0.0-rc.1
- v4.0.0-beta.2
- v4.0.0-beta.1
- 3.4.x-dev
- v3.4.14
- v3.4.13
- v3.4.12
- v3.4.11
- v3.4.10
- v3.4.9
- v3.4.8
- v3.4.7
- v3.4.6
- v3.4.5
- v3.4.4
- v3.4.3
- v3.4.2
- v3.4.1
- v3.4.0
- 3.3.x-dev
- 3.2.x-dev
- v3.2.13
- v3.2.12
- v3.2.11
- v3.2.10
- v3.2.9
- v3.2.8
- v3.2.7
- v3.2.6
- v3.2.5
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- 3.1.x-dev
- v3.1.2
- v3.1.1
- v3.1.0
- 3.0.x-dev
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- 2.1.x-dev
- 2.0.x-dev
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.2
- v2.0.1
- 1.3.x-dev
- 1.2.x-dev
- 1.0.0.x-dev
This package is auto-updated.
Last update: 2024-11-29 18:04:27 UTC
README
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.1" } }
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 composer install 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 (4.1.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 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 a file.
License
Phalcon Developer Tools is open source software licensed under the New BSD License.
© Phalcon Framework Team and contributors