|
1 | | -# HFX v4 |
| 1 | +# PHP framework with Phinx |
2 | 2 |
|
3 | 3 |  [](https://svgshare.com/i/ZhY.svg) |
4 | 4 |
|
|
24 | 24 | - Uses node - webpack - compilation of assets |
25 | 25 | - `public/dist` for compiled assets |
26 | 26 |
|
| 27 | +--- |
| 28 | + |
| 29 | +## Phinx |
| 30 | + |
| 31 | +- Create a migration : `vendor/bin/phinx create UsersMigration` |
| 32 | +- Add SQL to created migration |
| 33 | +- Migrate data : `vendor/bin/phinx migrate` |
| 34 | +- Create newly created seeding : `vendor/bin/phinx seed:create UserSeeder` |
| 35 | +- Seed data : `vendor/bin/phinx seed:run` |
| 36 | +- `vendor/bin/phinx migrate -t 20220820174815 & vendor/bin/phinx seed:run -s UserSeeder` - Specific migration / seeder |
| 37 | + |
| 38 | +--- |
| 39 | + |
27 | 40 | ### Routing notes |
28 | 41 |
|
29 | 42 | - Documentation on packagist & https://github.com/nikic/FastRoute |
|
78 | 91 |
|
79 | 92 | `'/[{extra}]'` : Allowing `<URL>/?fb_click=FB_ID&utm=UTM_ID>m=GTM_ID` & `<URL>/` |
80 | 93 |
|
| 94 | +--- |
| 95 | + |
81 | 96 | ### Routing Regex |
82 | 97 |
|
83 | 98 | - The rules : `'/content/{id:\d+}/{slug:[a-z]+}[/{extra}]'` |
|
93 | 108 | - - `&` *ampersand* |
94 | 109 | - Finally : `{slug:[a-zA-Z0-9-_&]+}` |
95 | 110 |
|
96 | | -## Packages (require / require-dev) |
| 111 | +--- |
| 112 | + |
| 113 | +## Packages (require / require-dev) / URLs |
97 | 114 |
|
98 | 115 | - https://packagist.org/packages/nikic/fast-route - `Routes` |
99 | 116 | - https://packagist.org/packages/symfony/http-kernel |
|
106 | 123 | - https://packagist.org/packages/filp/whoops - `Debugger` |
107 | 124 | - https://packagist.org/packages/fakerphp/faker // https://fakerphp.github.io/ - `Dummy data provider` |
108 | 125 | - https://packagist.org/packages/mnapoli/silly - `CLI` |
| 126 | +- https://book.cakephp.org/phinx/0/en/contents.html - `Phinx Documentation` |
| 127 | + |
| 128 | +--- |
109 | 129 |
|
110 | 130 | ## Development utilities |
111 | 131 |
|
112 | 132 | - https://picocss.com/ `Minimal CSS Framework for semantic HTML` |
113 | 133 | - https://picocss.com/examples/preview/ & https://github.com/picocss/examples `Pico examples` |
114 | 134 |
|
| 135 | +--- |
115 | 136 |
|
116 | 137 | ## Environment configuration |
117 | 138 |
|
|
124 | 145 | </VirtualHost> |
125 | 146 | ``` |
126 | 147 |
|
| 148 | +--- |
| 149 | + |
127 | 150 | ## Usage |
128 | 151 |
|
129 | 152 | - Set up `vhosts` |
130 | 153 | - Configure `.env` |
131 | 154 | - `composer install` |
132 | 155 | - `composer update` when modifying specific **packages** - *PS. `packages/chrome/`, `"version": "master"` in `composer.json`* |
133 | 156 | - DB tables : |
134 | | -- - `php bin/console database:users up && php bin/console database:users seed` - Create the table `hfx_users` and populate it |
135 | | -- - `php bin/console database:users down` - Drop the table `hfx_users` |
| 157 | +- - `vendor/bin/phinx migrate` - Migrate DB |
| 158 | +- - `vendor/bin/phinx seed:run` - Popupate DB |
| 159 | +- Command : `php bin/console database:users 1 / php bin/console database:users 155` - Fetching data from `users` with specified ID |
136 | 160 | - Assets `npm install` |
137 | 161 | - `npm rebuild node-sass` - Changing environment |
138 | 162 | - Compiling assets |
139 | 163 | - - `npm run js-build` : compile JS |
140 | 164 | - - `npm run css-build` : compile CSS |
141 | 165 | - - `npm run js-build-watch` : compile JS in *watch mode* |
142 | 166 |
|
143 | | -## Demo URL |
| 167 | +--- |
| 168 | + |
| 169 | +## Demo URL for testing |
| 170 | + |
144 | 171 | - - http://helifox.local/ |
145 | 172 | - - http://helifox.local/?fb_click=FB_ID&utm=UTM_ID>m=GTM_ID |
146 | 173 | - - http://helifox.local/content/5/fx/?action=cancel |
|
0 commit comments