Releases: projek-xyz/slim-skeleton
Version 0.2.1 released
Update
- Update CI build configuration.
Version 0.2.0 released
New:
-
Add CLI functionalities built on top of CLImate, see: 85cdfb0.
Run
php app/console
from your terminal and you'll see something like this.$ php app/console PHP Application Skeleton for Slim v3 Microframework Usage: [command] [option] Optional Arguments: -h, --help Show help message --ansi Force ANSI output --no-ansi Disable ANSI output --env[=ENV] The environment the command should run under Available Commands: migrate Execute migration data greeting Say hello to the world
The
greeting
command is default application command that will only print Hello, world! text on your terminal, it's could be remove onapp/settings.php
and you also could add your command on$settings['commands']
.The
$settings['commands']
will only accept array of string of class name that extendsProjek\Slim\Console\Commands
class. -
Add simple Migration, see 78eb65a.
Could only be executed through CLI via
php app/console migrate
command. Seephp app/console migrate --help
for information.All migrations files are placed under
app/data
directory with 3 digits number at first followed by string filename separated by dash, e.g.:001-first-install.php
.It support
.sql
or.php
migration file. But for.sql
migration it could only be installed. The.sql
file, simply put your sql script there and that's it. The.php
file have to return anarray
withup
,down
andtable
. I've planned to make both extension have same functionality or remove the.sql
support instead.Rules:
up
(required) it use when migrate this file.down
(optional) it use to revert all changes fromup
index.table
(optional) It simply take string as table name.up
anddown
could havearray
orClosure
as value. If you useClosure
it will passProjek\Slim\Database\Blueprint
instance as parameter and bind toSlim\Pdo\Database
for conveniences.up
anddown
Closure will need to callProject\Slim\Database\Bluprint::table('table_name')
iftable
index is undefined.down
index is required whentable
index is undefined.
Examples:
// array `up` and without `down` index. use Projek\Slim\Database\Blueprint; return [ 'table' => 'dummy', 'up' => [ 'id' => ['int' => 11, 'primary', 'null' => false, 'auto_increment'], 'name' => ['varchar' => 100, 'unique', 'null' => false], 'address' => ['text', 'null' => false], ], ];
// closure `up` and without `down` index. use Projek\Slim\Database\Blueprint; return [ 'table' => 'dummy', 'up' => function (Blueprint $schema) { $schema->create([ 'id' => ['int' => 11, 'primary', 'null' => false, 'auto_increment'], 'name' => ['varchar' => 100, 'null' => false], 'address' => ['text', 'null' => false], ]); } ];
// closure `up` and `down` but without `table` index. use Projek\Slim\Database\Blueprint; return [ 'up' => function (Blueprint $schema) { $schema->table('dummy')->create([ 'id' => ['int' => 11, 'primary', 'null' => false, 'auto_increment'], 'name' => ['varchar' => 100, 'null' => false], 'address' => ['text', 'null' => false], ]); }, 'down' => function (Blueprint $schema) { $schema->table('dummy')->delete(); } ];
If you need to call
view
instance somewhere from your application, useapp()
global helper withProjek\Slim\Database\Migrator
string as parameter. e.g:app(Projek\Slim\Database\Migrator::class)
. -
Add linter for all
scss
andjs
files.Added new
gulp task
:lint:styles
andlint:scripts
which is required by default on thebuilt:scripts
andbuilt:styles
. You can found the standards undertests
directory, here the.eslint.yml](tests/.eslint.yml) and [here the
.scsslint.yml`.If you want to run all linters only, execute
gulp lint
from your terminal. -
Remove
view
from container getter.Now you can't call
view
instance from$this-view->render()
onController
class. Instead use method fromProjek\Slim\Http\Response::withView(string $viewName, array $data)
, seeHomeController
for example.If you need to call
view
instance somewhere from your application, useapp()
global helper withProjek\Slim\View
string as parameter. eg:app(Projek\Slim\View::class)
.NOTE: BREAK BC
-
Remove
assets
andvendor
directory underpublic
directory from VCS.Simply install all
node
dependencies and rungulp
from your terminal. All JS, SCSS, Images and Fonts fromassets
folder will be compiled topublic/assets
directory, then all your node dependencies defined underpackage.json
atdependencies
key will be copied topublic/vendor
directory.If you want to include them on your repo, simply remove
.gitignore
file atpublic
folder.
Updates:
- Patch testing.
- Update directory structures.
- Fix codeclimate and coveralls integrations.
- Other minor fixes
v0.1.6 Released
v0.1.6 Released
v0.1.5 Released
v0.1.4 released
v0.1.4 Released
v0.1.4 released
v0.1.3 Released
v0.1.3 released
v0.1.2 Released
v0.1.2 released
v0.1.1 Released
v0.1.1 released
Initial Release
v0.1.0 Initial release