- Copy
env.example.txt
to.env
, and set the app.baseURL, database.* to their server-specific values. - Run
composer install --no-dev
in the project root (one directory up frompublic_html
). - Run
php spark migrate --all
to update the database with the required CodeIgniter tables.
- Run
composer install --no-dev
.
- At first I thought it would be composer update, but that can change package versions, and may lead to unexpected results.
- Better to use composer install, which uses the exact package versions in the compser.lock file.
- Run
php spark migrate --all
.
- Run
php spark migrate:status
to see which migrations have been run and their batch numbers. - Run
php spark migrate:rollback -b <batch_number>
, using the batch_number of the last batch to leave in place.
- For example, if three migrations have been run (batches 1, 2, and 3), and you want to undo batch 3, run
php spark migrate:rollback -b 2
Edit a file, create a new file, and clone from Bitbucket in under 2 minutes
When you're done, you can delete the content in this README and update the file with details for others getting started with your repository.
We recommend that you open this README in another tab as you perform the tasks below. You can watch our video for a full demo of all the steps in this tutorial. Open the video in a new tab to avoid leaving Bitbucket.
You’ll start by editing this README file to learn how to edit a file in Bitbucket.
- Click Source on the left side.
- Click the README.md link from the list of files.
- Click the Edit button.
- Delete the following text: Delete this line to make a change to the README from Bitbucket.
- After making your change, click Commit and then Commit again in the dialog. The commit page will open and you’ll see the change you just made.
- Go back to the Source page.
Next, you’ll add a new file to this repository.
- Click the New file button at the top of the Source page.
- Give the file a filename of contributors.txt.
- Enter your name in the empty file space.
- Click Commit and then Commit again in the dialog.
- Go back to the Source page.
Before you move on, go ahead and explore the repository. You've already seen the Source page, but check out the Commits, Branches, and Settings pages.
Use these steps to clone from SourceTree, our client for using the repository command-line free. Cloning allows you to work on your files locally. If you don't yet have SourceTree, download and install first. If you prefer to clone from the command line, see Clone a repository.
- You’ll see the clone button under the Source heading. Click that button.
- Now click Check out in SourceTree. You may need to create a SourceTree account or log in.
- When you see the Clone New dialog in SourceTree, update the destination path and name if you’d like to and then click Clone.
- Open the directory you just created to see your repository’s files.
Now that you're more familiar with your Bitbucket repository, go ahead and add a new file locally. You can push your change back to Bitbucket with SourceTree, or you can add, commit, and push from the command line.
File or Directory | Purpose |
---|---|
dist/ | output ready for deployment |
env.d.ts | environment constants |
index.html | template files |
node_modules/ | package management |
package-lock.json | package management |
package.json | package management |
public_src/ | template files |
src/ | source code |
tsconfig.app.json | typescript configuration |
tsconfig.json | typescript configuration |
tsconfig.node.json | typescript configuration |
vite.config.ts | vue app configuration |
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
TypeScript cannot handle type information for .vue
imports by default, so we replace the tsc
CLI with vue-tsc
for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue
types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensions
from VSCode's command palette - Find
TypeScript and JavaScript Language Features
, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Window
from the command palette.
See Vite Configuration Reference.
npm install
npm run dev
npm run build
File or Directory | Purpose |
---|---|
app/ | source code |
componsr.json | package management |
composer.lock | package management |
.env | environment constants |
env.example.txt | environment constants |
spark | automation |
vendor/ | package management |
writable/ | cache files |
CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure. More information can be found at the official site.
This repository holds a composer-installable app starter. It has been built from the development repository.
More information about the plans for version 4 can be found in CodeIgniter 4 on the forums.
The user guide corresponding to the latest version of the framework can be found here.
composer create-project codeigniter4/appstarter
then composer update
whenever
there is a new release of the framework.
When updating, check the release notes to see if there are any changes you might need to apply
to your app
folder. The affected files can be copied or merged from
vendor/codeigniter4/framework/app
.
Copy env
to .env
and tailor for your app, specifically the baseURL
and any database settings.
index.php
is no longer in the root of the project! It has been moved inside the public folder,
for better security and separation of components.
This means that you should configure your web server to "point" to your project's public folder, and not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter public/..., as the rest of your logic and the framework are exposed.
Please read the user guide for a better explanation of how CI4 works!
We use GitHub issues, in our main repository, to track BUGS and to track approved DEVELOPMENT work packages. We use our forum to provide SUPPORT and to discuss FEATURE REQUESTS.
This repository is a "distribution" one, built by our release preparation script. Problems with it can be raised on our forum, or as issues in the main repository.
PHP version 7.4 or higher is required, with the following extensions installed:
Additionally, make sure that the following extensions are enabled in your PHP: