{"id":18659047,"url":"https://github.com/delboy1978uk/bonemvc","last_synced_at":"2025-04-11T20:30:46.731Z","repository":{"id":17504941,"uuid":"20292808","full_name":"delboy1978uk/bonemvc","owner":"delboy1978uk","description":"Bone Framework","archived":false,"fork":false,"pushed_at":"2020-03-25T14:04:46.000Z","size":1285,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T17:49:16.687Z","etag":null,"topics":["bone-framework","php-framework"],"latest_commit_sha":null,"homepage":"https://bonemvc.delboysplace.co.uk","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"edos4/cpedstrucl-e21","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/delboy1978uk.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":"2014-05-29T12:21:39.000Z","updated_at":"2023-08-21T09:50:02.000Z","dependencies_parsed_at":"2022-08-02T20:15:35.433Z","dependency_job_id":null,"html_url":"https://github.com/delboy1978uk/bonemvc","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delboy1978uk%2Fbonemvc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delboy1978uk%2Fbonemvc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delboy1978uk%2Fbonemvc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/delboy1978uk%2Fbonemvc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/delboy1978uk","download_url":"https://codeload.github.com/delboy1978uk/bonemvc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248476119,"owners_count":21110213,"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":["bone-framework","php-framework"],"created_at":"2024-11-07T07:35:29.877Z","updated_at":"2025-04-11T20:30:46.240Z","avatar_url":"https://github.com/delboy1978uk.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bone framework\n[![Latest Stable Version](https://poser.pugx.org/delboy1978uk/bonemvc/v/stable)](https://packagist.org/packages/delboy1978uk/bonemvc) [![Total Downloads](https://poser.pugx.org/delboy1978uk/bone/downloads)](https://packagist.org/packages/delboy1978uk/bonemvc) [![Latest Unstable Version](https://poser.pugx.org/delboy1978uk/bonemvc/v/unstable)](https://packagist.org/packages/delboy1978uk/bonemvc) [![License](https://poser.pugx.org/delboy1978uk/bonemvc/license)](https://packagist.org/packages/delboy1978uk/bonemvc)\u003cbr /\u003e\n[![Build Status](https://travis-ci.org/delboy1978uk/bonemvc.png?branch=master)](https://travis-ci.org/delboy1978uk/bonemvc) [![Code Coverage](https://scrutinizer-ci.com/g/delboy1978uk/bonemvc/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/delboy1978uk/bonemvc/?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/delboy1978uk/bonemvc/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/delboy1978uk/bonemvc/?branch=master)\u003cbr /\u003e\nBe ye wantin a PHP framework peppered with local pirate lingo?\u003cbr /\u003e\nIt be the most bare bones framework in the seven seas!\u003cbr /\u003e\nhttp://bonemvc.delboysplace.co.uk\n\n## features\n- PSR-7 http messaging \n- PSR-11 dependency injection container configuration\n- PSR-15 middleware routing\n\n\nBone now be on v3.x! The entire deign o' th' ship has been streamlined and be far more manoeuvrable!\nWe be usin' a PSR-11 dependency injection container, coupled with a PSR-15 middleware router, in a modular manner! \nJump on board! \n\n## installation\nFirst make sure you have Composer! Then install Bone.\n```\ncomposer create-project delboy1978uk/bonemvc your/path/here\n```\nor if you haven't installed composer globally ...\n```\nphp composer.phar create-project delboy1978uk/bonemvc your/path/here \n```\nSee below for information on how to get a complete dev server using Docker\n\n## config\nYou can drop in any number of .php files into the config/ folder. Make sure they return an array with the config . You \ncan override configuration based on environment var APPLICATION_ENV, so for instance if the environment was production \nit would load the additional config the production subdirectory.\n\nThere are several config files by default:\n```\ndb.php \ni18n.php \nlogs.php \nmail.php \nroutes.php \ntemplates.php\n```\nIn your config files, you can add anything you want. It gets stored in the Bone\\Mvc\\Registry.\n#### db\nSet your default db credentials in the main config/db.php, and any environment specific configs in a subdirectory\n```php\n    'db' =\u003e array(\n            'host' =\u003e '127.0.0.1',\n            'database' =\u003e 'bone',\n            'user' =\u003e 'leChuck',\n            'pass' =\u003e 'bigWh00p',\n    ),\n```\nThen in yer controller, ye can get a PDO connection by saying:\n```php\n$this-\u003egetDbAdapter();\n```\n#### internationalisation\nBone supports translation into different locales. Translation files (gettext `.po` and `.mo`) should be placed in \n`data/translations`, under a subdirectory of the locale, eg `data/translations/en_GB/en_GB.po`. You can set the default \nlocale and an array of supported locales.\n```php\n\u003c?php \n\n    use Zend\\I18n\\Translator\\Loader\\Gettext;\n\n    return [ \n        'i18n' =\u003e [ \n            'translations_dir' =\u003e 'data/translations', \n            'type' =\u003e Gettext::class, \n            'default_locale' =\u003e 'en_PI', \n            'supported_locales' =\u003e ['en_PI', 'en_GB', 'nl_BE', 'fr_BE'], \n        ], \n    ];\n```\nTo use the translator, you can simply call:To use the translator, you can simply call:\n```php\n\u003c?php\n// from a controller: \n$this-\u003egetTranslator()-\u003etranslate('placeholder.string'); \n// to set locale\n$this-\u003egetTranslator()-\u003esetLocale($locale);\n// from a view file:\n$this-\u003et('placeholder');\n```\n#### logs\nBone uses monolog/monolog, and logs can be found in data/logs.Currently we only support writing to files, but you can \nadd as many channels as you like:\n```php\n\u003c?php \nreturn [ \n    'log' =\u003e [ \n        'channels' =\u003e [ \n            'default' =\u003e 'data/logs/default_log', \n        ], \n    ], \n];\n```\nTo use the logger in a controller:\n```php\n$this-\u003egetLog()-\u003edebug($message) // or error(), etc, see PSR-3\n```\n#### mail\nBone uses Zend Mail. To configure the mail client, just drop in your config (see zend mail docs)\n```php\n\u003c?php \nreturn [ \n    'mail' =\u003e [ \n        'name' =\u003e '127.0.0.1', \n        'host' =\u003e 'localhost', \n        'port' =\u003e 25, \n     // 'connection_class' =\u003e 'login', // plain, login, crammd5\n     // 'connection_config' =\u003e [\n     //     'username' =\u003e 'user',\n     //     'password' =\u003e 'pass',\n     //  ],\n    ], \n];\n```\nIf you are using the Docker Box provided by bone, you also have the awesome MailHog at your disposal. Browse to \nawesome.scot:8025 and you'll see a catch all email inbox, so you never need to worry about development emails reaching the real world.\n\n## modules and packages\nModules can be created in your `src/` folder. The default module is `Bone\\App\\AppPackage`.\nModules are enabled by adding them in `config/packages.php`. Vendor packages can also be installed via composer and enabled\nin the same way.\n\n### the module package class\nA module at the very least will implement `Barnacle\\RegistrationInterface`, and if it is an MVC module containing routes \nthen it should also implement `Bone\\Router\\RouterConfigInterface`. There are four methods in all to implement:\n- `hasEntityPath(): bool`, if your module uses doctrine entities return true (requires `delboy1978uk/bone-doctrine` package)\n- `getEntityPath(): string`, if you return true, this is the folder your entity class resides.\n- `addToContainer(Container $c)`, described below\n- `addRoutes(Container $c, Router $router): Router`, described below\n#### addToContainer(Container $c)\nYou can create factories for your classes and otherwise initialise anythiung required elsewhere in your app.\nAs an example, a Controller class may wish to have the view Engine injected in, so in the method you would add the following:\n```php\n$c[MyController::class] = $c-\u003efactory(function (Container $c) {\n    $view = $c-\u003eget(PlatesEngine::class);\n    return new MyController($view);\n});\n```\nThe dependency injection container is `delboy1978uk/barnacle`, which is essentially Pimple extended and implementing PSR-11. \n#### addRoutes(Container $c)\nBone MVC uses `league/route`, a PSR-15 middleware library. Routes are added in your package like so:\n```php\n    /**\n     * @param Container $c\n     * @param Router $router\n     * @return Router\n     */\n    public function addRoutes(Container $c, Router $router): Router\n    {\n        $router-\u003emap('GET', '/', [IndexController::class, 'indexAction']);\n        $router-\u003emap('GET', '/learn', [IndexController::class, 'learnAction']);\n\n        return $router;\n    }\n```\nSee their docs for more info on router usage\n## additional libraries\nAvast ye! We be usin' some additional libs by th' Cap'n (delboy1978uk), namely:\n```\ndelboy1978uk/cdn\ndelboy1978uk/form\ndelboy1978uk/generator\ndelboy1978uk/image \ndelboy1978uk/session\n```\nFer the CDN lib, ye can quickly echo out javascript and css using ```Del\\Cdn```, see ```App\\View\\layouts\\bonemvc.php``` fer an example.\u003cbr /\u003e\n\nSee also use ```Del\\Icon``` and ```Del\\Css```, which come as part of the cdn lib.\u003cbr /\u003e\n\nYe can create custom Bootstrap ready forms usin' ```delboy1978uk/form```, see the Github page fer details.\u003cbr /\u003e\n\nYe can quickly make a new module usin' th' generator CLI command.\n\nYe can manipulate images usin' th' gd PHP functions, with the ```Del\\Image``` class.\n\nYe can set Session variables usin' ```Del\\SessionManager```, see GitHub for info.\n\n#### get swashbucklin'! gaarrrrr!\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelboy1978uk%2Fbonemvc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdelboy1978uk%2Fbonemvc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdelboy1978uk%2Fbonemvc/lists"}