{"id":18802105,"url":"https://github.com/hilli/codespace-php","last_synced_at":"2025-08-25T02:18:23.964Z","repository":{"id":136454251,"uuid":"585859559","full_name":"hilli/codespace-php","owner":"hilli","description":"Template repo for a PHP Codespace/DevContainer","archived":false,"fork":false,"pushed_at":"2023-03-02T17:18:48.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-21T21:40:31.303Z","etag":null,"topics":["devcontainer","php","template"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/hilli.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-06T09:18:31.000Z","updated_at":"2023-07-14T20:10:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"58d8c418-6714-421d-bc21-b85bbde9ffb5","html_url":"https://github.com/hilli/codespace-php","commit_stats":null,"previous_names":[],"tags_count":2,"template":true,"template_full_name":null,"purl":"pkg:github/hilli/codespace-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilli%2Fcodespace-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilli%2Fcodespace-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilli%2Fcodespace-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilli%2Fcodespace-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hilli","download_url":"https://codeload.github.com/hilli/codespace-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilli%2Fcodespace-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271998717,"owners_count":24856092,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["devcontainer","php","template"],"created_at":"2024-11-07T22:26:30.516Z","updated_at":"2025-08-25T02:18:23.906Z","avatar_url":"https://github.com/hilli.png","language":"Dockerfile","readme":"# Codespace PHP\n\nThis repository is ment to help you get started with PHP development environment in GitHub Codespaces or as local [DevContainer](https://containers.dev/). The environment will provide a PHP server, a running MySQL server, a database web admin tool [adminer](https://www.adminer.org/) running and tasks, launchers and setting setup for Code. DB credentials are to be found in the .env file and also used in the sample index.php to connect to the DB as a test.\n\nPush the button below to create a new GitHub Codespace with this repository as template.\n\n[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?template_repository=hilli/codespace-php)\n\nYou can instantly start hacking on your site and view it at http://localhost:8080 after starting either the raw PHP serve mode or Apache 2, see below.\n\nYou can [manage your Codespaces](https://github.com/codespaces/) so you can stop the Codespaces when you stop your work and delete the Codespace when you have committed and pushed your code.\n\n[LiveShare extension for VSCode](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare) is also installed to make it possible for multiple users to hack on the same code at the same time.\n\n## DevContainer PHP\n\nAlternatively you can pull this code or take a release of this repo and run VSCode on top of these files to do the same locally. This requires VSCode and a local [Docker](https://www.docker.com/) installed.\n\n## Tips and Tricks\n\n### The DB: MariaDB\n\nAll possible values are configured to be `mariadb` - Hostname, username, password and the database itself.\n\n### Starting the PHP Server\n\nLaunch it with the Run \u0026 Debug (shift+cmd+D) sidebar. There you can select either `Launch My Site` or `Debug My Site`. The first skips breakpoints in the code, the second doesn't.\n\nThe PHP files are located beneath the [site](site) directory.\n\nApache 2 is also configured to point at the [site](site) directory. It can be started with `apache2-foreground` in the Code terminal or in the background with `apache2ctl start` if you don't care about logs. \n\n### Adminer\n\nShould be available at [localhost:8082](http://localhost:8082).\n\n### Database schema and data dumps\n\nThere is defined tasks for this. Press `shift+cmd+P` (Or `shift+ctrl+P` if you are on a not Mac or just the `F1` button) to get to the Command Palette. Type `\u003eTasks: Run Task` to get to `Save DB Schema` and `Save DB Data`. This will dump schema and data to the files `database/schema.sql` and `database/data_dump.sql` making the database portable. You should commit at least the `schema.sql` files to git. Your site will possible be prettier with some data as well.\n\nThe dumps are as safe as possibly; There is no inserted `DROP TABLE` statements in the schema. So run explicit `drop_tables.sql` (And keep it manually updated with new tables) to clear tables in your database first if needed.\n\n### SQLTools\n\nThe VS Code extension `SQLTools` is also installed and configured to use the build in MariaDB. There is a \"storage\" icon in the VSCode sidebar, where you can connect to the database (Just click trough the tree until there is a connection identified by a green marker in the tree and a 1 on the SQLTools icon in the sidebar). When connected you can open `.sql` files and do a `Run on Active Connection` to apply them. I.e. an easy way to import schema and data to the database.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhilli%2Fcodespace-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhilli%2Fcodespace-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhilli%2Fcodespace-php/lists"}