Download the PHP package puko/console without Composer

On this page you can find all versions of the php package puko/console. 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 console

Puko Console

puko/console is the CLI scaffolding tool for the Puko Framework. It automates database setup, model/controller generation, routing, authentication scaffolding, UI generation, and localization scanning.

This is a development-time tool. It generates and modifies files inside an existing Puko Framework project (the "project root"). It is not a runtime library for application code.


Installation

The console is invoked from the project root (the directory containing your Puko project's config/, controller/, model/, plugins/, assets/, tests/ folders).


Usage

The console is interactive: many commands prompt for input on STDIN. Pressing Enter with an empty value accepts the previously selected/default value.


Command Reference

setup — Installation & first-time project setup

Initializes database connections, security config, and scaffolds project classes.

Directive Action Attribute Effect
db — <schema> Interactive DB setup; generates models, contracts and test files for every table in the schema.
secure — — Interactive AES-256 encryption config → writes config/encryption.php.
auth <name> — Generates an auth plugin → plugins/auth/<name>.php.
controller view <name> Generates a view controller → plugins/controller/<name>.php.
controller service <name> Generates a service controller → plugins/controller/<name>.php.
model add <name> <schema> Interactive model builder; generates model + model/controller test files.
model update <name> <schema> Reserved (currently a no-op).
model remove <name> <schema> Reserved (currently a no-op).

setup db interactive prompts

Prompted in order (Enter accepts the default shown in parentheses):

  1. Database Type — mysql, oracle, sqlsrv, mongo
  2. Hostname
  3. Port
  4. Schema Name
  5. Database Name
  6. Username
  7. Password
  8. Driver (odbc or sqlsrv — used for SQL Server connections)
  9. Ignored Table Prefix (default _; tables starting with it are skipped)
  10. Hide Column list (default created,modified,cuid,muid,dflag,password)
  11. "Add another database connection schema? (y/n)" — repeat the flow for extra schemas

For each table, setup db generates:

Connection blocks are appended to config/database.php. The config file structure per schema:

Supported for setup db: mysql (fully supported), sqlsrv (supported). oracle and mongo are stubbed (error "not yet supported").


refresh db — Reapply database config without rewriting the file

Same interactive prompts as setup db, but does not rewrite config/database.php — useful when you only want to regenerate models/contracts/tests from external DB changes.


routes — Routing and controller scaffolding

Reads/writes config/routes.php.

Directive Action Attribute Effect
list — — Print all registered routes (path => controller@function [ACCEPT]).
dir — — Print route paths only, with accepted methods.
resort — — Re-sort routes alphabetically and rewrite config/routes.php.
error — — Set the error-handler controller.
lost — — Set the not-found controller.
service add <url> Register a service route + scaffold controller.
service update <url> Update an existing service route.
service crud <schema>/<table> Generate a full CRUD service + 7 routes (see below).
view add <url> Register a view route + scaffold controller + HTML/JS assets.
view update <url> Update an existing view route.
console add <url> Register a console route (accepts GET).
console update <url> Update an existing console route.
socket add <url> Register a socket route + scaffold a WebSocket controller (Ratchet).
remove — — Intentionally disabled — delete routes manually.

Interactive prompts (for add/update/error/lost):

  1. Controller (use \ for sub-directories, e.g. entities\reports)
  2. Function name
  3. Accept? GET,POST,PUT,PATCH,DELETE (comma-separated; console/socket routes default to GET)

URL parameter syntax: use {?} in the URL for a parameter, e.g. posts/{?}/update. The scaffolded controller method receives $id# args (e.g. $id1 = '').

view routes additionally generate:

routes service crud <schema>/<table>

Prerequisite: model exists at plugins/model/<schema>/<table>.php (run setup db first). Generates controller/<schema>/<table>.php with methods create, update, delete, explore, search, table, read, and registers these routes:

Route Method
<table>/create POST
<table>/{?}/update PUT
<table>/{?}/delete DELETE
<table>/explore POST
<table>/table POST
<table>/search POST
<table>/{?} GET

Columns listed in the schema's hideColumns are excluded from validation/vars/responses. After generation, rebuild language with php puko language controller/<schema>.


generate — Wizards

Directive Effect
db Interactive "generate" pass: reads models from plugins/model/<schema> and creates the database/tables from their doc-comment metadata (MySQL only).
ui Interactive DataTables generator (see below).

generate ui (DataTables)

Prompts for Database Schema (primary) (default primary) and Table, then reads the table schema from the DB and generates:

Prerequisite: a working backend CRUD API (e.g. from routes service crud).


language — Localization scanner

Recursively scans PHP files under <directory> for say(...) directives, appends missing keys to assets/master/id.master.json, and writes it back (pretty-printed). Existing keys are preserved.


serve — Local dev server

Starts the PHP built-in server: php -S localhost:<port> routes.php (default port 4000). Ctrl+C to stop.


cli — Console-mode execution

Runs the router's console controller without a web server: php cli <router path>.


tests — Run unit tests (beta)

Runs vendor\bin\phpunit in the project root.


element — View elements

Directive Attribute Effect
add <element name> Generates a scaffolded element plugin (PHP + HTML + JS + CSS) in plugins/elements/<lowercase-name>/.
download <element name> (*beta) Downloads an element from the GitHub elements repo (config/init.php repo key) into plugins/elements/.

docs — Automated docs

Currently a stub (no-op; "Command not supported!").


Not implemented / reserved

Feature Status
migrate command Referenced in help; migration code lives at src/migration/Table.php (all methods empty) — not wired in Console.php.
setup db for oracle / mongo Error "not yet supported".
generate db for non-MySQL No-op.
setup model update / remove Reserved no-ops.
routes remove Deliberately disabled.
docs Stub.
tests Beta.

Generated file map

Command Files written
setup db <schema> config/database.php, plugins/model/<schema>/*.php, model/<schema>/*Contracts.php, tests/unit/{model,controller}/<schema>/*.php
setup secure config/encryption.php
setup auth <name> plugins/auth/<name>.php
setup controller <view\|service> <name> plugins/controller/<name>.php
setup model add <name> <schema> plugins/model/<schema>/<name>.php, tests/unit/model/<schema>/<name>ModelTest.php, tests/unit/controller/<schema>/<name>ControllerTest.php
routes ... add config/routes.php, controller/**/*.php, assets/html/{en,id}/..., assets/scripts/...
routes service crud controller/<schema>/<table>.php, config/routes.php
generate ui controller/ui/<schema>.php, assets/html/{en,id}/ui/<schema>/<table>.html, assets/scripts/ui/<schema>/<table>.js, config/routes.php
language <dir> assets/master/id.master.json
element add <name> plugins/elements/<name>/{name,<name>.php,<name>.html,<name>.js,<name>.css}

Project structure


All versions of console with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0|>=8.0
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 puko/console contains the following files

Loading the files please wait ...