phalcon
Introduction
Phalcon in Tars
Support Packing code
Support Phalcon develop
Support TarsConfig
Support http & tars Protocol
Limited by the design of the framework itself, it does not support cooperation
Related
tars-php-phalcon (https://github.com/luoxiaojun1992/tars-php-phalcon)
Phalcon (https://github.com/phalcon/cphalcon)
TARSPHP (https://github.com/TarsPHP)
TARSPHP DOCKER (https://github.com/tangramor/docker-tars)
Thanks
Project Directory Structure
component: Common base class of Controller
conf: The configuration required by the business
controller: The C layer in the MVC model
database: Database connection configuration
libs: Common libs、server/model extensions、utils
models: The model file for the database table
servant: Client code generated by tars2php, this directory name is completely customizable, just need to be distinguished when using them
services: Business Logic Code
tasks: Console commands of business, for making debugging easier, can also be used as a timed task
composer.json: Description of the project's dependencies
index.php: The entrance of the service, the file name can be customized, but you must change the private template on the platform and add the field of entrance under the server
services.php: Declare the base namespaceName of the entire project
Use
Create project
Clone code example
Install composer dependencies
Basic service config
Change
appName、serverName、objName
in tars/tars.proto.phpIf you use the tasrsprotocol
Write the tars interface description file in the tars directory,tars/tars.proto.php,add tarsFiles
Executing compilation script in scripts directory to generate interface code
Create interface implementation class in src/services directory and write business logic code
Edit services in src/services.php,replace interface and interface implementation namespace
Setting up the development environment of TarsPHP
If using the HTTP protocol, refer toTARS-PHP-HTTP Server and client development
If using the tars protocol, refer toTARS-PHP-TCP Server and client development
Package the project in the tars PHP development environment(run
composer run-script deploy
in src)Publish the project in the tars management background, please refer to TARS-PHP-TCP Server and client development),test
curl 'http://{ip}:{port}/{api_route}'
Last updated