{"id":21556972,"url":"https://github.com/carbonorm/carbonphp","last_synced_at":"2025-04-10T10:23:10.098Z","repository":{"id":25978184,"uuid":"107019570","full_name":"CarbonORM/CarbonPHP","owner":"CarbonORM","description":"CarbonPHP [C6] is a PHP Library ^8.2  ⊃ { MySQL ORM  ∪  WebSockets  ∪ Sessions }","archived":false,"fork":false,"pushed_at":"2024-05-17T02:32:41.000Z","size":194568,"stargazers_count":10,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"lts","last_synced_at":"2024-05-18T01:03:09.878Z","etag":null,"topics":["javascript","mysql","orm","pdo-mysql","php","react","typescript"],"latest_commit_sha":null,"homepage":"https://CarbonPHP.com","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/CarbonORM.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-15T14:28:31.000Z","updated_at":"2024-06-12T16:27:56.871Z","dependencies_parsed_at":"2023-12-23T02:54:07.726Z","dependency_job_id":"3841b208-0142-4e0a-9b8f-bcde84a13182","html_url":"https://github.com/CarbonORM/CarbonPHP","commit_stats":{"total_commits":1255,"total_committers":12,"mean_commits":"104.58333333333333","dds":0.6533864541832669,"last_synced_commit":"6334098290567e62bd594bcba52087aed42964b0"},"previous_names":["carbonorm/carbonphp","richardtmiles/carbonphp"],"tags_count":574,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarbonORM%2FCarbonPHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarbonORM%2FCarbonPHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarbonORM%2FCarbonPHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarbonORM%2FCarbonPHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CarbonORM","download_url":"https://codeload.github.com/CarbonORM/CarbonPHP/tar.gz/refs/heads/lts","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248199079,"owners_count":21063641,"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":["javascript","mysql","orm","pdo-mysql","php","react","typescript"],"created_at":"2024-11-24T08:10:33.603Z","updated_at":"2025-04-10T10:23:10.072Z","avatar_url":"https://github.com/CarbonORM.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![PHP Version](https://img.shields.io/packagist/php-v/carbonorm/carbonphp)\n![GitHub Release](https://img.shields.io/github/v/release/carbonorm/carbonphp)\n![Packagist Version](https://img.shields.io/packagist/v/carbonorm/carbonphp)\n![License](https://img.shields.io/packagist/l/carbonorm/carbonphp)\n![Size](https://img.shields.io/github/languages/code-size/carbonorm/carbonphp)\n![Documentation](https://img.shields.io/website?down_color=lightgrey\u0026down_message=Offline\u0026up_color=green\u0026up_message=Online\u0026url=https%3A%2F%2Fcarbonorm.dev)\n![CarbonPHP Feature Test Suit](https://github.com/carbonorm/CarbonPHP/workflows/CarbonPHP%20Feature%20Test%20Suit/badge.svg)\n![Monthly Downloads](https://img.shields.io/packagist/dm/carbonorm/carbonphp)\n![All Downloads](https://img.shields.io/packagist/dt/carbonorm/carbonphp)\n![Old Repository Location Downloads](https://img.shields.io/packagist/dt/richardtmiles/carbonphp)\n![Star](https://img.shields.io/github/stars/carbonorm/carbonphp?style=social)\n\n# Welcome to CarbonPHP\n\nOur full documentation is available at our [GitHub Wiki](https://github.com/CarbonORM/CarbonPHP/wiki) or with runnable examples at [Carbonorm.dev](https://carbonorm.dev/).\n\n## Installation\n\n`composer require carbonorm/carbonphp`\n\nThis command will install the [latest release](https://github.com/CarbonORM/CarbonPHP/releases) of CarbonPHP using Composer. If you do not already have Composer installed,\nyou may do so by following the instructions at [getcomposer.org](https://getcomposer.org/download/). Composer is PHP's\n[package manager](https://en.wikipedia.org/wiki/Package_manager), and is required to use CarbonPHP. [Packagist](https://packagist.org/packages/carbonorm/carbonphp)\nis the official repository for Composer packages, and is where download statistics are gathered from. The old repository location `composer require richardtmiles/carbonphp` will still work with composer/packagist, but it is reccomended to move to the new location. The total number # of downloads above is duplicated to refect the two ways to download via composer.\n\n### Wordpress\n\nAlternatively, you may install [CarbonPHP as a WordPress Plugin](https://github.com/CarbonORM/CarbonWordPress). This\nwill allow you to use CarbonPHP's features with a guided user interface.\n\n# CarbonPHP Tool Kit and Performance Library\n\nCarbonPHP has grown into the [CarbonORM Public Organization](https://github.com/CarbonORM/). There you can find\ndocumentation over the front end process of using the ORM. C6 now refers to any of Carbon* prefixed CarbonORM packages.\n\n[CarbonORM.dev](http://carbonorm.dev/)\n\nCarbonPHP has reached a stable level of trust in its own features through PHPUnit Tests +\nGitHub Actions but is still in active development. CarbonPHP is being used in production environments. Anyone, or team,\nwho attempts using this code\nwill find support on GitHub through issues and forums. We generally expect any issue you many encountered to be minor.\nIf you edit the codebase, please consider submitting those changes on GitHub! C6\nuses [Semantic Versioning 2.0.0](https://semver.org).\nGenerally: MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards\ncompatible manner, and PATCH version when you make backwards compatible bug fixes. Changes to function/class/etc will be\ncalled out in the Changelog with every minor release. Please read the changelog or code changes carefully when updating.\nRefer to the guide at [carbonphp.com](https://carbonphp.com)\n\n## Introduction - { MySQL ORM ∪ WebSockets ∪ $_SESSION Management ∪ PDO Database Management }\n\nCarbonPHP is a PHP 8.2+ library to simplify the building of custom, dynamic web applications. Its main focus is to make\nwebapps run ridiculously fast, with performance and high-traffic scalability being the absolute highest concern.\nCarbonPHP\nhas clocked in with impressive statistics, sometimes doubling the traffic that small servers with MySQL-intensive sites\ncan handle.\nC6 works as a standalone backbone for your dev needs or in the corporation with other popular frameworks\nlike [WordPress](https://developer.wordpress.org)\nor [Laravel](https://laravel.com).\n\nCarbonPHP's other goals include portability; allowing your webapps to be installed on servers with different operating\nsystems (Windows, Mac, and Linux Support). Full MySQL ORM REST generator, and php written database tools designed around\nthe MySQL. Windows PHP currently lacks a library capable of forking. Should your development require a Windows\ncomputers look into [WSL](https://learn.microsoft.com/en-us/windows/wsl/install). I hope to contribute a php library\nwritten in C (PHP is written in C) to support this task, however time is a factor. Should you feel compelled to help in\nthis goal please contact me at Richard@Miles.Systems. Please see the documentation at Carbonphp.com for more\ninformation.\nFor the rest of us who live outside windows Hell C6 has a Websocket Library Class for Standard use and WordPress use.\n\n## Quick Start\n\n### Existing projects\n\n    composer require carbonorm/carbonphp\n\n## Standards\n\nC6 should follow the [PHP Standards Recommendations](https://www.php-fig.org/psr/) listed below.\n\n[PSR-4](https://www.php-fig.org/psr/psr-4/)\n\n[PSR-12](https://www.php-fig.org/psr/psr-12/)\n\n[SEMVAR](https://semver.org)\n\n## Requirements\n\nCarbonPHP currently requires PHP 8.2 or later. We try to stay up-to-date\nwith [PHP's Supported Versions](https://www.php.net/supported-versions.php).\nIt makes use of return type object notation, and should not be ported back to earlier PHP versions.\nCarbonPHP will always try to stay upto date with the latest version of PHP.\nUse of an opcode cache such as XCache is highly recommended, as Carbon is able to run entirely without stat()\ncalls when paired with an opcode cache. Also recommended (but optional) is a RAM-caching engine such as memcached.\nPHP8, if not already supported, will receive support WITH C6's FIRST Backwards Compatible Release. Plans to drop 7.4\nare currently scheduled for the summer of 2022.\n\n## Documentation\n\nAll function should have PHPDoc-style documentation in the code. [CarbonPHP.com](https://carbonphp.com/) also has full\nexplanations of the codebase.\nssed to MVC. Please ensure your namespace mappings are correct!\";\n\n### RESTFUL ORM\n\nCarbonPHP's largest feature is the MySQL ORM. By running a customizable CLI command our program\nwill analyze your database schema and generate powerful classes used to manipulate your tables. The auto generated files\nmay be used in conjunction for an incredibly pleasing RESTFUL semantics structure. Below are examples for using the REST\nORM. You\ncan [see the generated source here](https://github.com/RichardTMiles/CarbonPHP/blob/master/carbonphp/tables/Carbon_Users.php).\n\n```PHP\n\u003c?php\n\n$id = Users::Post([\n        Users::USER_TYPE =\u003e 'Athlete',\n        Users::USER_IP =\u003e '127.0.0.1',\n        Users::USER_SPORT =\u003e 'GOLF',\n        Users::USER_EMAIL_CONFIRMED =\u003e 1,\n        Users::USER_USERNAME =\u003e Config::ADMIN_USERNAME,\n        Users::USER_PASSWORD =\u003e Config::ADMIN_PASSWORD,\n        Users::USER_EMAIL =\u003e 'richard@miles.systems',\n        Users::USER_FIRST_NAME =\u003e 'Richard',\n        Users::USER_LAST_NAME =\u003e 'Miles',\n        Users::USER_GENDER =\u003e 'Male'\n    ]);\n```\n\nJoining across multiple tables.\n\n```PHP\nUsers::Get($user, $uid, [\n    Users::SELECT =\u003e [\n        Users::USER_USERNAME,\n        Carbon_Locations::STATE\n    ],\n    Users::JOIN =\u003e [\n        Users::INNER =\u003e [\n            Carbon_Location_References::TABLE_NAME =\u003e [\n                Users::USER_ID =\u003e Carbon_Location_References::ENTITY_REFERENCE\n            ],\n            Carbon_Locations::TABLE_NAME =\u003e [\n                Carbon_Locations::ENTITY_ID =\u003e Carbon_Location_References::LOCATION_REFERENCE\n            ]\n        ]\n    ],\n    Users::PAGINATION =\u003e [\n        Users::LIMIT =\u003e 1,\n        Users::ORDER =\u003e [Users::USER_USERNAME =\u003e Users::ASC]\n    ]\n]);\n```\n\nUsing the ORM from the Frontend. This example showcases multiple table joins, as well as the use of aggregate function(\ns)\nGROUP_CONCAT.\n\n```typescript\n    const {axios} = this.props;\n\naxios.get('/rest/' + C6.carbon_users.TABLE_NAME, {\n    params: {\n        [C6.SELECT]: [\n            C6.carbon_users.USER_USERNAME,\n            C6.carbon_users.USER_FIRST_NAME,\n            C6.carbon_users.USER_LAST_NAME,\n            C6.carbon_users.USER_ID,\n            [C6.GROUP_CONCAT, C6.carbon_features.FEATURE_CODE],\n            [C6.GROUP_CONCAT, C6.carbon_groups.GROUP_NAME]\n        ],\n        [C6.JOIN]: {\n            [C6.LEFT]: {\n                [C6.carbon_user_groups.TABLE_NAME]: [\n                    C6.carbon_users.USER_ID,\n                    C6.carbon_user_groups.USER_ID\n                ],\n                [C6.carbon_groups.TABLE_NAME]: [\n                    C6.carbon_user_groups.GROUP_ID,\n                    C6.carbon_groups.ENTITY_ID\n                ],\n                [C6.carbon_feature_group_references.TABLE_NAME]: [\n                    C6.carbon_groups.ENTITY_ID,\n                    C6.carbon_feature_group_references.GROUP_ENTITY_ID\n                ],\n                [C6.carbon_features.TABLE_NAME]: [\n                    C6.carbon_features.FEATURE_ENTITY_ID,\n                    C6.carbon_feature_group_references.FEATURE_ENTITY_ID\n                ]\n            }\n        },\n        [C6.PAGINATION]: {\n            [C6.LIMIT]: 100\n        }\n    }\n}).then(response =\u003e this.setState({users: (response.data.rest || [])}));\n```\n\n\n# Builtin Command Line Interface\n\nMuch like laravel's artisan, any file that invokes CarbonPHP from the command line will execute the CLI Interface. I\nplan to make a system in place for user commands in Beta. See all available commands with:\n\n    php index.php help\n\n## Support\n\nSupport for CarbonPHP is offered at https://github.com/RichardTMiles/CarbonPHP.\n\n## Legal\n\nUse of CarbonPHP implies agreement with its software license, available in the LICENSE file. This license is subject to\nchange from release to release, so before upgrading to a new version of C6, please review its license.\n\n## Credits\n\nCarbonPHP was created by Richard Tyler Miles, the BDFL, and inspired\nby [Tom Frost's](https://github.com/TomFrost) [Hydrogen](https://github.com/TomFrost/Hydrogen).\n\nContributors can be found on the [contributors](https://github.com/CarbonORM/CarbonPHP/graphs/contributors) page.\n\n## TODO - Double down on apache configs \nhttps://gist.github.com/RichardTMiles/ae5718aff63ab4633457b6285c825aa2\nThis will be in CarbonWordPress and modified for general use in CarbonPHP.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarbonorm%2Fcarbonphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarbonorm%2Fcarbonphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarbonorm%2Fcarbonphp/lists"}