{"id":15029589,"url":"https://github.com/00f100/fcphp-command","last_synced_at":"2026-04-06T00:03:30.070Z","repository":{"id":56893991,"uuid":"142950987","full_name":"00F100/fcphp-command","owner":"00F100","description":"Library to manipulate Console Command into FcPhp","archived":false,"fork":false,"pushed_at":"2018-08-12T21:08:58.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T21:49:34.274Z","etag":null,"topics":["command","console","fcphp","php7","php72"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/00F100.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-07-31T02:19:05.000Z","updated_at":"2022-02-12T12:48:27.000Z","dependencies_parsed_at":"2022-08-21T01:50:18.133Z","dependency_job_id":null,"html_url":"https://github.com/00F100/fcphp-command","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/00F100%2Ffcphp-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/00F100","download_url":"https://codeload.github.com/00F100/fcphp-command/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243339322,"owners_count":20275668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command","console","fcphp","php7","php72"],"created_at":"2024-09-24T20:11:07.804Z","updated_at":"2025-12-30T00:25:12.345Z","avatar_url":"https://github.com/00F100.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FcPhp Command\n\nPackage to manupulate commands of terminal into FcPhp\n\n[![Build Status](https://travis-ci.org/00F100/fcphp-command.svg?branch=master)](https://travis-ci.org/00F100/fcphp-command) [![codecov](https://codecov.io/gh/00F100/fcphp-command/branch/master/graph/badge.svg)](https://codecov.io/gh/00F100/fcphp-command)\n\n[![PHP Version](https://img.shields.io/packagist/php-v/00f100/fcphp-command.svg)](https://packagist.org/packages/00F100/fcphp-command) [![Packagist Version](https://img.shields.io/packagist/v/00f100/fcphp-command.svg)](https://packagist.org/packages/00F100/fcphp-command) [![Total Downloads](https://poser.pugx.org/00F100/fcphp-command/downloads)](https://packagist.org/packages/00F100/fcphp-command)\n\n## How to install\n\nComposer:\n```sh\n$ composer require 00f100/fcphp-command\n```\n\nor add in composer.json\n```json\n{\n    \"require\": {\n        \"00f100/fcphp-command\": \"*\"\n    }\n}\n```\n\n## How to use\n\nThis package use [FcPhp Security Console](https://github.com/00F100/fcphp-sconsole) to manipulate permissions and [FcPhp Cache](https://github.com/00F100/fcphp-cache) to save commands cache for better performance\n\n```php\n\nuse FcPhp\\SConsole\\SCEntity;\nuse FcPhp\\Command\\Interfaces\\ICEntity;\nuse FcPhp\\Command\\Facades\\CommandFacade;\n\n\n// Instance of SCEntity provider from FcPhp Security Console\n// or ...\n$entity = new SCEntity();\n\n// Custom commands...\n$commands = [];\n\n// Composer dir to autoload find \"commands.php\" into packages and cache into FcPhp Cache\n$vendorPathAutoload = 'vendor/*/*/config';\n\n$instance = CommandFacade::getInstance($entity, $commands, $vendorPathAutoload);\n\n// Args from console request\n// Example: php index.php package datasource connect -h localhost -u user -p password\n$args = [\n    'package',\n    'datasource',\n    'connect',\n    '-h',\n    'localhost',\n    '-u',\n    'user',\n    '-p',\n    'password'\n];\n\n// Return instance FcPhp\\Command\\Interfaces\\ICEntity\n$match = $this-\u003einstance-\u003ematch($args);\n\nif($match instanceof ICEntity) {\n    // Print status code\n    echo $match-\u003egetStatusCode();\n\n    // Print action\n    echo $match-\u003egetAction();\n\n    // ...\n}\n```\n\n### [FcPhp\\Command\\Interfaces\\ICEntity](https://github.com/00F100/fcphp-command/tree/master/src/Interfaces/ICEntity.php)\n\n```php\n\u003c?php\n\nnamespace FcPhp\\Command\\Interfaces\n{\n    interface ICEntity\n    {\n        /**\n         * Method to contruct instance\n         *\n         * @param array $params Params to entity\n         * @return void\n         */\n        public function __construct(array $params = []);\n\n        /**\n         * Method to get command\n         *\n         * @return string|null\n         */\n        public function getCommand();\n\n        /**\n         * Method to get action\n         *\n         * @return string|null\n         */\n        public function getAction();\n\n        /**\n         * Method to get rule\n         *\n         * @return string|null\n         */\n        public function getRule();\n\n        /**\n         * Method to get params to controller\n         *\n         * @return array\n         */\n        public function getParams() :array;\n\n        /**\n         * Method to get status code\n         *\n         * @return int\n         */\n        public function getStatusCode() :int;\n\n        /**\n         * Method to get status message\n         *\n         * @return string|null\n         */\n        public function getStatusMessage();\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F00f100%2Ffcphp-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F00f100%2Ffcphp-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F00f100%2Ffcphp-command/lists"}