PHPackages                             phwoolcon/bootstrap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. phwoolcon/bootstrap

ActiveProject[Framework](/categories/framework)

phwoolcon/bootstrap
===================

Phalcon + Swoole Framework Bootstrap

v1.0.0(8y ago)2951117Apache-2.0PHPPHP &gt;=5.5.0

Since Dec 15Pushed 6y ago3 watchersCompare

[ Source](https://github.com/phwoolcon/bootstrap)[ Packagist](https://packagist.org/packages/phwoolcon/bootstrap)[ RSS](/packages/phwoolcon-bootstrap/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Phwoolcon Bootstrap
===================

[](#phwoolcon-bootstrap)

Phalcon + Swoole

[Demo](https://phwoolcon.org/)

---

The Bootstrap provides directory structure for running Phwoolcon.

The purpose of this project is to create a high performance web application,
which can run in traditional php-fpm mode and service mode.

In service mode, you gain extreme speed for your application,
by reducing lot of unnecessary and repetitive computing.

If you have bugs in service mode, you can easily turn off the service mode,
you lose some speed (but still fast) to gain more stability, fix bugs and apply service mode again.

1. System Requirements
======================

[](#1-system-requirements)

- Linux or MacOS (Windows is neither recommended nor tested,
    but you can install Linux on Windows by VirtualBox or other virtual machines)
- Nginx (Latest version recommended)
- PHP version &gt;= 5.5 (7.1 is recommended, year 2017)
- PHP components: fpm, gd, cli, curl, dev, json, mbstring, pdo-mysql, redis, xml, zip
- MySQL server (or MariaDB / Percona / TiDB)
- Phalcon (Latest version recommended)
- Swoole (Latest version recommended)
- Composer (Latest version recommended)

2. Usage
========

[](#2-usage)

2.1. Create Working Directory
-----------------------------

[](#21-create-working-directory)

```
git clone git@github.com:phwoolcon/bootstrap.git my-project-name
cd my-project-name
```

2.2. Import Packages
--------------------

[](#22-import-packages)

Please **DO NOT** edit `composer.json` directly, that will break framework update.

Use `bin/import-package` to create `composer.local-*.json` instead,
`composer.local-*.json` is isolated from the framework itself.

For example:

- To import a public composer package:

```
bin/import-package some/public-package
```

- To import a private composer package:

```
bin/import-package git@git.example.com:my/private-project.git
```

Please see [Composer Merge Plugin (by Wikimedia)](https://github.com/wikimedia/composer-merge-plugin/blob/master/README.md#plugin-configuration) to learn more about `composer.local-*.json`.

Demo: [Phwoolcon Demo](https://github.com/phwoolcon/demo#7-install-phwoolcondemo).

2.3. Organize Your Project Codes
--------------------------------

[](#23-organize-your-project-codes)

All project codes will be organized as composer packages.

**NEVER** put your codes into the `app/` directory, that make it complicated to implement modularization.

### 2.3.1 Create a Phwoolcon Package

[](#231-create-a-phwoolcon-package)

Run:

```
bin/cli package:create
```

This tool will ask you to input some basic information, for example:

```
----------------------------------------------------------------------
Please, provide the following information:
----------------------------------------------------------------------
Your name: Christopher CHEN
Your Github username ( in https://github.com/username): Fishdrowned
Your email address: fishdrowned@gmail.com
Your website [https://github.com/Fishdrowned]:
Package vendor ( in https://github.com/vendor/package) [Fishdrowned]: phwoolcon
Package name ( in https://github.com/vendor/package): theme-mdl
Package very short description: The Material Design Lite Theme for Phwoolcon
PSR-4 namespace (usually, Vendor\Package) [Phwoolcon\ThemeMdl]:

----------------------------------------------------------------------
Please, check that everything is correct:
----------------------------------------------------------------------
Your name: Christopher CHEN
Your Github username: Fishdrowned
Your email address: fishdrowned@gmail.com
Your website: https://github.com/phwoolcon
Package vendor: phwoolcon
Package name: theme-mdl
Package very short description: The Material Design Lite
PSR-4 namespace: Phwoolcon\ThemeMdl

Modify files with these values? [y/N/q] y

Done.
Now you should remove the file 'prefill.php'.

----------------------------------------------------------------------
Please, provide the following information:
----------------------------------------------------------------------
Git repository (The git repository of the package) [git@github.com:phwoolcon/theme-mdl.git]:
Choose license (1 - APACHE 2.0, 2 - MIT, 3 - Proprietary) [1]:

```

Then the package is there under the `vendor` directory, with git initialized,
remote repository added, it is all ready for you to commit and push the files.

```
git commit -m "Initial commit"
git push
```

Now you have a private composer repository, your first `Phwoolcon package`.

If you want to share it to others, you can publish it on [GitHub](https://github.com) and [Packagist](https://packagist.org).

### 2.3.2. Import Your Package

[](#232-import-your-package)

Now you can import your newly created package.

See [2.2. Import Packages](#s2.2)

### 2.3.3. Update Codes

[](#233-update-codes)

```
bin/update
```

This script will do:

- `git pull` to update the framework (`phwoolcon/bootstrap`) itself;
- `composer update` to update all composer packages, including your project;
- `bin/cli migrate:up` to run DB migration scripts;
- `bin/dump-autoload` to update composer autoload, apply latest
    assets, configs, locales, generate model traits and IDE helper.

2.4. Phwoolcon Configuration
----------------------------

[](#24-phwoolcon-configuration)

Project configuration files are symlinked from packages into `app/config` directory.

please **DO NOT** edit them directly.

### 2.4.1. Apply Environment Configuration

[](#241-apply-environment-configuration)

Adding new copies into `app/config/{$environment}/` to override default values.

`{$environment}` is the runtime environment name, by default `production`.

You can change this name by setting `$_SERVER['PHWOOLCON_ENV']`.

### 2.4.2. Add Custom Configuration Files

[](#242-add-custom-configuration-files)

Return to your project package (i.e. `vendor/my/project`),
you may add new configuration files under `phwoolcon-package/config/`.

Then run `bin/dump-autoload` to symlink it to `app/config`.

Get the config values in your codes, for example:

Config file `phwoolcon-package/config/key.php`

```
