Skip to content

Commit

Permalink
Change details in CHANGELOG.md, README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Sep 29, 2024
1 parent efcb94b commit def0d2e
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 92 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ All notable changes to `Combustor` will be documented in this file.
- Code coverage from `Scrutinizer CI` to `Codecov`

### Removed
- Options to strictly conform in coding style of `Codeigniter`:
- `--camel`
- `--keep`
- `--lowercase`
- `CONTRIBUTING.md`

## [1.2.4](https://github.com/rougin/combustor/compare/v1.2.3...v1.2.4) - 2018-04-18
Expand Down
151 changes: 60 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,62 @@ Combustor is a [Codeigniter](https://codeigniter.com/) library that generates co

## Installation

1. Download the Codeigniter framework [here](https://github.com/bcit-ci/CodeIgniter/archive/3.1.8.zip) and extract it to the web server.
2. Configure the application's database connectivity settings in `application/config/database.php`.
3. Install Combustor through the [Composer](https://getcomposer.org/) package manager:
Download the [latest Codeigniter 3 project](https://github.com/bcit-ci/CodeIgniter/archive/3.1.13.zip) and extract its contents:

``` bash
$ wget https://github.com/bcit-ci/CodeIgniter/archive/3.1.13.zip
$ unzip 3.1.13.zip -d acme
```

Then configure the project's database connectivity settings:

```
$ cd acme
$ nano application/config/database.php
```

``` php
// acme/application/config/database.php

// ...

$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '',
'password' => '',
'database' => '',
'dbdriver' => 'mysqli',

// ...
);
```

Proceed to install `Combustor` via [Composer](https://getcomposer.org/):

``` bash
$ composer require rougin/combustor --dev
```
4. Install the ORM wrappers `Wildfire` and `Doctrine ORM` or both:

Lastly, install the ORM wrappers either `Wildfire` or `Doctrine`:

``` bash
$ vendor/bin/combustor install:wildfire
$ vendor/bin/combustor install:doctrine
```

> [!NOTE]
> Using the `install:wildfire` command installs [Wildfire](https://roug.in/wildfire/) while the `install:doctrine` installs [Credo](https://roug.in/credo/).
## Reminders

Prior in executing any commands, kindly ensure that the **database table is defined properly** (foreign keys, indexes, relationships, normalizations) in order to minimize the modifications after the codes has been generated.

Also, proceed first in generating models, views, or controllers to database tables that are having **no relationship with other tables** in the database.

> [!TIP]
> `Combustor` will generate controllers, models, or views based on the specified database schema. If there's something wrong in the specified database schema, `Combustor` will generate a bad codebase.
## Commands

### `create:layout`
Expand All @@ -56,11 +100,11 @@ Creates a new HTTP controller.

#### Options

* `--camel` - uses camel case naming convention for the accessor and mutators
* `--doctrine` - generates a controller based on Doctrine
* `--keep` - keeps the name to be used
* `--lowercase` - keeps the first character of the name to lowercase
* `--wildfire` - generates a controller based from Wildfire
* `--doctrine` - generates a Doctrine-based controller
* `--wildfire` - generates a Wildfire-based controller

> [!NOTE]
> If either `Wildfire` or `Doctrine` is installed, no need to specify it as option for executing a specified command (e.g. `--wildfire`). However if both are installed, a command must have a `--wildfire` or `--doctrine` option added
#### Example

Expand All @@ -78,11 +122,8 @@ Creates a new model.

#### Options

* `--camel` - uses camel case naming convention for the accessor and mutators
* `--doctrine` - generates a controller based on Doctrine
* `--keep` - keeps the name to be used
* `--lowercase` - keeps the first character of the name to lowercase
* `--wildfire` - generates a controller based from Wildfire
* `--doctrine` - generates a Doctrine-based model
* `--wildfire` - generates a Wildfire-based model

#### Example

Expand All @@ -101,11 +142,8 @@ Creates a new view template.
#### Options

* `--bootstrap` - includes the Bootstrap tags
* `--camel` - uses camel case naming convention for the accessor and mutators
* `--doctrine` - generates a controller based on Doctrine
* `--keep` - keeps the name to be used
* `--lowercase` - keeps the first character of the name to lowercase
* `--wildfire` - generates a controller based from Wildfire
* `--doctrine` - generates Doctrine-based views
* `--wildfire` - generates Wildfire-based views

#### Example

Expand All @@ -124,87 +162,18 @@ Creates a new HTTP controller, model, and view template.
#### Options

* `--bootstrap` - includes the Bootstrap tags
* `--camel` - uses camel case naming convention for the accessor and mutators
* `--doctrine` - generates a controller based on Doctrine
* `--keep` - keeps the name to be used
* `--lowercase` - keeps the first character of the name to lowercase
* `--wildfire` - generates a controller based from Wildfire
* `--doctrine` - generates a Doctrine-based controller, model, and views
* `--wildfire` - generates a Wildfire-based controller, model, and views

#### Example

``` bash
$ vendor/bin/combustor create:scaffold users --bootstrap --wildfire
```

## Wilfire's Methods

The following methods below are available if `--wildfire` is installed:

### `delete($table, $delimiters = [])`

Deletes the specified data from storage.

#### Arguments

* `$table` - name of the database table
* `$delimiters` - delimits the list of rows to be returned

#### Example

``` php
$this->wildfire->delete('users', ['id' => 3]);
```

### `find($table, $delimiters = [])`

Finds the row from the specified ID or with the list of delimiters from the specified table.

#### Arguments

* `$table` - name of the database table
* `$delimiters` - delimits the list of rows to be returned

#### Example

``` php
$this->wildfire->delete('users', ['id' => 3]);
```

### `get_all($table, $delimiters = [])`

Returns all rows from the specified table

#### Arguments

* `$table` - name of the database table
* `$delimiters` - delimits the list of rows to be returned
* `keyword` - used for searching the data from the storage
* `per_page` - defines the number of rows per page

#### Returned methods

* `as_dropdown($description)` - returns the list of rows that can be used in `form_dropdown()`
* `description` - the field to be displayed in the result (the default value is `description`)
* `result()` - returns the list of rows from the storage in a model
* `total_rows()` - returns the total number of rows based from the result

#### Example

``` php
$delimiters = ['keyword' => 'test', 'per_page' = 3];

$result = $this->wildfire->all('users', $delimiters);

var_dump((array) $result->result());
```

**NOTE**: This method is also available if `--doctrine` is installed.

## Reminders

* If either Wildfire or Doctrine is installed, no need to specify it as option for executing a specified command (e.g. `vendor/bin/combustor create:controller --wildfire`). However if both are installed, the command to be executed must have a `--wildfire` or `--doctrine` option added.

* To learn more about Doctrine's functionalities and its concepts, the documentation page can be found [here](http://doctrine-orm.readthedocs.org/en/latest).
* To learn more about functionalities of `Doctrine` and its concepts, the documentation page can be found [here](http://doctrine-orm.readthedocs.org/en/latest).

* Before generating the models, views, and controllers, please make sure that the **database is defined properly** (foreign keys, indexes, relationships, normalizations) in order to minimize the modifications after the codes has been generated. Also, generate the models, views, and controllers first to tables that are having **no relationship with other tables** in the database.

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@
},
"suggest":
{
"rougin/codeigniter": "Codeigniter 3's Composer-based package.",
"rougin/codeigniter": "A Composer-based Codeigniter 3.",
"rougin/credo": "A Doctrine ORM wrapper for Codeigniter 3.",
"rougin/ignite": "A Composer-based Codeigniter 3 project.",
"rougin/refinery": "\"Ready-to-eat\" migrations for Codeigniter 3.",
"rougin/spark-plug": "Codeigniter 3 in a single variable.",
"rougin/wildfire": "A Query Builder wrapper for Codeigniter 3."
}
}

0 comments on commit def0d2e

Please sign in to comment.