{"id":17134362,"url":"https://github.com/brianium/php-classic-blog","last_synced_at":"2025-04-13T08:55:00.293Z","repository":{"id":4173620,"uuid":"5289722","full_name":"brianium/php-classic-blog","owner":"brianium","description":"A classic blog example built in PHP using domain driven and test driven principles","archived":false,"fork":false,"pushed_at":"2012-09-26T21:04:35.000Z","size":2005,"stargazers_count":10,"open_issues_count":1,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T22:46:54.005Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brianium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-03T19:53:40.000Z","updated_at":"2017-02-17T18:10:31.000Z","dependencies_parsed_at":"2022-08-25T21:12:02.552Z","dependency_job_id":null,"html_url":"https://github.com/brianium/php-classic-blog","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fphp-classic-blog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fphp-classic-blog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fphp-classic-blog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fphp-classic-blog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianium","download_url":"https://codeload.github.com/brianium/php-classic-blog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688543,"owners_count":21145763,"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":[],"created_at":"2024-10-14T19:44:42.707Z","updated_at":"2025-04-13T08:55:00.272Z","avatar_url":"https://github.com/brianium.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"A Classic PHP Blog Built With TDD and DDD\n=========================================\n\nThe purpose of this project was to build a simple blogging tool with the principles of test driven development (TDD), and domain driven design (DDD).\n\nThis project is designed to be a good showcase of TDD and DDD. It has a comprehensive test suite, and a layered architecture that should encourage easy extension.\n\nThis project was built using PHP 5.4, and it uses composer to manage dependencies.\n\nGetting Things Running\n----------------------\n\n### Installing Software Dependencies ###\n\nThe dependencies needed for this application are listed in the composer.json file. To install them simply run the following at the command line:\n\n`php composer.phar install`\n\nPHPUnit was installed using PEAR, and it is necessary for running tests.\n\n### PHP Dependencies ###\n\nThis application relies on pdo_sqlite for the test suite, and pdo_mysql for production. These are utilized by the Doctrine2 ORM. Several tests will fail if APC is not installed, but the application can run without it. This of course means you need sqlite and mysql installed as well.\n\n\n### Running The Tests ###\n\nOnce all the dependencies are taken care of, you can run the full test suite by running the following shell script in from the bin directory\n\n`bin/runtests`\n\nThis script was built using the default Ubuntu bin/bash, and is just a helper for running all tests in the src/Test directory.\n\nIf you have guard and guard-phpunit installed, you can run the `guard` command from the terminal for live feedback during development\n\n### Running The Application ###\n\nThe application relies on mysql. The credentials used to connect are stored in src/Infrastructure/Persistence/Doctrine/doctrine.cfg.json. Keep in mind, you will need to create a database for the application to run.\n\nThis repo comes with a Doctrine console in the bin directory so you can generate the schema. Run the following command to create the schema for the app:\n\n`bin/doctrine orm:schema-tool:create`\n\nIf you need to regenerate the proxies (recommended) for the domain entities, run the following:\n\n`bin/doctrine orm:generate-proxies`\n\nThe application can be run out of the box using PHP 5.4's built in web server. Running the following command will start a web server on port 8000.\n\n`bin/runapp`\n\nApplication Architecture\n------------------------\n\nAll source for the application is contained in the src directory. The lib directory is where dependencies are installed to via composer.\n\n### Domain ###\n\nThe domain layer is the application core. The `Domain\\Entities` namespace contains the models used for this application, that is User, Post, and Comment. \n\n`Domain\\Repositories` contains the interfaces for the each entity's repository. These interfaces are realized in the Infrastructure layer.\n\nThe root `Domain` namespace contains any value objects and services that are used throughout the application.\n\n### Infrastructure ###\n\nAll repositories in this layer rely on Doctrine2, and are held within the `Infrastructure\\Persistence\\Doctrine` namespace. This layer also contains a `UnitOfWork`\n\nThe `ConfigurationFactory` can be used to tweak development and production environments for Doctrine2\n\n### Presentation ###\n\nThe presentation layer is built using the Slim framework. The framework was chosen specifically to stay away from an MVC approach. This may better illustrate using the underlying services of the `Domain` and `Infrastructure` packages.\n\nThe Twig templating engine was used to generate markup, and Twitter bootstrap was used to give some generic style and structure to the interface.\n\nFuel Validation powers the input models in this layer.\n\nSlim form based authentication is accomplished using several domain and infrastructure services via the `Presentation\\SlimAuthenticationService` service.\n\n### Test ###\n\nTests are broken into unit and integration tests. Both are constructed using PHPUnit, and were used to drive the implementations for this application.\n\nObjects used throughout different tests can be found in the `Test\\Fixtures` namespace.\n\n### bootstrap.php ###\n\nThis file loads the composer autoloader, and adds additional classes to the path. It is included in the `Presentation` and `Test` packages.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianium%2Fphp-classic-blog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianium%2Fphp-classic-blog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianium%2Fphp-classic-blog/lists"}