This commit is contained in:
Markus
2022-04-28 09:40:10 +02:00
commit 795794f992
9586 changed files with 1146991 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
<@php
namespace {namespace};
use CodeIgniter\CLI\BaseCommand;
use CodeIgniter\CLI\CLI;
<?php if ($type === 'generator'): ?>
use CodeIgniter\CLI\GeneratorTrait;
<?php endif ?>
class {class} extends BaseCommand
{
<?php if ($type === 'generator'): ?>
use GeneratorTrait;
<?php endif ?>
/**
* The Command's Group
*
* @var string
*/
protected $group = '{group}';
/**
* The Command's Name
*
* @var string
*/
protected $name = '{command}';
/**
* The Command's Description
*
* @var string
*/
protected $description = '';
/**
* The Command's Usage
*
* @var string
*/
protected $usage = '{command} [arguments] [options]';
/**
* The Command's Arguments
*
* @var array
*/
protected $arguments = [];
/**
* The Command's Options
*
* @var array
*/
protected $options = [];
/**
* Actually execute a command.
*
* @param array $params
*/
public function run(array $params)
{
<?php if ($type === 'generator'): ?>
$this->component = 'Command';
$this->directory = 'Commands';
$this->template = 'command.tpl.php';
$this->execute($params);
<?php else: ?>
//
<?php endif ?>
}
}

View File

@@ -0,0 +1,10 @@
<@php
namespace {namespace};
use CodeIgniter\Config\BaseConfig;
class {class} extends BaseConfig
{
//
}

View File

@@ -0,0 +1,177 @@
<@php
namespace {namespace};
use {useStatement};
class {class} extends {extends}
{
<?php if ($type === 'controller'): ?>
/**
* Return an array of resource objects, themselves in array format
*
* @return mixed
*/
public function index()
{
//
}
/**
* Return the properties of a resource object
*
* @return mixed
*/
public function show($id = null)
{
//
}
/**
* Return a new resource object, with default properties
*
* @return mixed
*/
public function new()
{
//
}
/**
* Create a new resource object, from "posted" parameters
*
* @return mixed
*/
public function create()
{
//
}
/**
* Return the editable properties of a resource object
*
* @return mixed
*/
public function edit($id = null)
{
//
}
/**
* Add or update a model resource, from "posted" properties
*
* @return mixed
*/
public function update($id = null)
{
//
}
/**
* Delete the designated resource object from the model
*
* @return mixed
*/
public function delete($id = null)
{
//
}
<?php elseif ($type === 'presenter'): ?>
/**
* Present a view of resource objects
*
* @return mixed
*/
public function index()
{
//
}
/**
* Present a view to present a specific resource object
*
* @param mixed $id
*
* @return mixed
*/
public function show($id = null)
{
//
}
/**
* Present a view to present a new single resource object
*
* @return mixed
*/
public function new()
{
//
}
/**
* Process the creation/insertion of a new resource object.
* This should be a POST.
*
* @return mixed
*/
public function create()
{
//
}
/**
* Present a view to edit the properties of a specific resource object
*
* @param mixed $id
*
* @return mixed
*/
public function edit($id = null)
{
//
}
/**
* Process the updating, full or partial, of a specific resource object.
* This should be a POST.
*
* @param mixed $id
*
* @return mixed
*/
public function update($id = null)
{
//
}
/**
* Present a view to confirm the deletion of a specific resource object
*
* @param mixed $id
*
* @return mixed
*/
public function remove($id = null)
{
//
}
/**
* Process the deletion of a specific resource object
*
* @param mixed $id
*
* @return mixed
*/
public function delete($id = null)
{
//
}
<?php else: ?>
public function index()
{
//
}
<?php endif ?>
}

View File

@@ -0,0 +1,12 @@
<@php
namespace {namespace};
use CodeIgniter\Entity\Entity;
class {class} extends Entity
{
protected $datamap = [];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $casts = [];
}

View File

@@ -0,0 +1,47 @@
<@php
namespace {namespace};
use CodeIgniter\Filters\FilterInterface;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
class {class} implements FilterInterface
{
/**
* Do whatever processing this filter needs to do.
* By default it should not return anything during
* normal execution. However, when an abnormal state
* is found, it should return an instance of
* CodeIgniter\HTTP\Response. If it does, script
* execution will end and that Response will be
* sent back to the client, allowing for error pages,
* redirects, etc.
*
* @param RequestInterface $request
* @param array|null $arguments
*
* @return mixed
*/
public function before(RequestInterface $request, $arguments = null)
{
//
}
/**
* Allows After filters to inspect and modify the response
* object as needed. This method does not allow any way
* to stop execution of other after filters, short of
* throwing an Exception or Error.
*
* @param RequestInterface $request
* @param ResponseInterface $response
* @param array|null $arguments
*
* @return mixed
*/
public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
{
//
}
}

View File

@@ -0,0 +1,50 @@
<@php
namespace {namespace};
use CodeIgniter\Database\Migration;
class {class} extends Migration
{
<?php if ($session): ?>
protected $DBGroup = '<?= $DBGroup ?>';
public function up()
{
$this->forge->addField([
'id' => ['type' => 'VARCHAR', 'constraint' => 128, 'null' => false],
<?php if ($DBDriver === 'MySQLi'): ?>
'ip_address' => ['type' => 'VARCHAR', 'constraint' => 45, 'null' => false],
'timestamp timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL',
'data' => ['type' => 'BLOB', 'null' => false],
<?php elseif ($DBDriver === 'Postgre'): ?>
'ip_address inet NOT NULL',
'timestamp timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL',
"data bytea DEFAULT '' NOT NULL",
<?php endif; ?>
]);
<?php if ($matchIP) : ?>
$this->forge->addKey(['id', 'ip_address'], true);
<?php else: ?>
$this->forge->addKey('id', true);
<?php endif ?>
$this->forge->addKey('timestamp');
$this->forge->createTable('<?= $table ?>', true);
}
public function down()
{
$this->forge->dropTable('<?= $table ?>', true);
}
<?php else: ?>
public function up()
{
//
}
public function down()
{
//
}
<?php endif ?>
}

View File

@@ -0,0 +1,42 @@
<@php
namespace {namespace};
use CodeIgniter\Model;
class {class} extends Model
{
protected $DBGroup = '{dbGroup}';
protected $table = '{table}';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $insertID = 0;
protected $returnType = {return};
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [];
// Dates
protected $useTimestamps = false;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
}

View File

@@ -0,0 +1,13 @@
<@php
namespace {namespace};
use CodeIgniter\Database\Seeder;
class {class} extends Seeder
{
public function run()
{
//
}
}

View File

@@ -0,0 +1,11 @@
<@php
namespace {namespace};
class {class}
{
// public function custom_rule(): bool
// {
// return true;
// }
}