umstellung auf shared codeigniter und postgres php8.2

This commit is contained in:
Markus
2022-09-18 14:07:38 +02:00
parent 22437db1c3
commit 8d16903e40
11628 changed files with 169929 additions and 1139112 deletions

View File

@@ -1,28 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Model;
class EntityModel extends Model
{
protected $table = 'job';
protected $returnType = '\Tests\Support\Models\SimpleEntity';
protected $useSoftDeletes = false;
protected $dateFormat = 'int';
protected $deletedField = 'deleted_at';
protected $allowedFields = [
'name',
'description',
'created_at',
];
}

View File

@@ -1,119 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Model;
class EventModel extends Model
{
protected $table = 'user';
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $dateFormat = 'datetime';
protected $allowedFields = [
'name',
'email',
'country',
'deleted_at',
];
protected $beforeInsert = ['beforeInsertMethod'];
protected $afterInsert = ['afterInsertMethod'];
protected $beforeUpdate = ['beforeUpdateMethod'];
protected $afterUpdate = ['afterUpdateMethod'];
protected $beforeDelete = ['beforeDeleteMethod'];
protected $afterDelete = ['afterDeleteMethod'];
protected $beforeFind = ['beforeFindMethod'];
protected $afterFind = ['afterFindMethod'];
// Cache of the most recent eventData from a trigger
public $eventData;
// Testing directive to set $returnData on beforeFind event
public $beforeFindReturnData = false;
// Holds stuff for testing events
protected $tokens = [];
protected function beforeInsertMethod(array $data)
{
$this->tokens[] = 'beforeInsert';
$this->eventData = $data;
return $data;
}
protected function afterInsertMethod(array $data)
{
$this->tokens[] = 'afterInsert';
$this->eventData = $data;
return $data;
}
protected function beforeUpdateMethod(array $data)
{
$this->tokens[] = 'beforeUpdate';
$this->eventData = $data;
return $data;
}
protected function afterUpdateMethod(array $data)
{
$this->tokens[] = 'afterUpdate';
$this->eventData = $data;
return $data;
}
protected function beforeDeleteMethod(array $data)
{
$this->tokens[] = 'beforeDelete';
$this->eventData = $data;
return $data;
}
protected function afterDeleteMethod(array $data)
{
$this->tokens[] = 'afterDelete';
$this->eventData = $data;
return $data;
}
protected function beforeFindMethod(array $data)
{
$this->tokens[] = 'beforeFind';
$this->eventData = $data;
if ($this->beforeFindReturnData) {
$data['data'] = 'foobar';
$data['returnData'] = true;
}
return $data;
}
protected function afterFindMethod(array $data)
{
$this->tokens[] = 'afterFind';
$this->eventData = $data;
return $data;
}
public function hasToken(string $token)
{
return in_array($token, $this->tokens, true);
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace Tests\Support\Models;
use CodeIgniter\Model;
class ExampleModel extends Model
{
protected $table = 'factories';
protected $primaryKey = 'id';
protected $returnType = 'object';
protected $useSoftDeletes = false;
protected $allowedFields = [
'name',
'uid',
'class',
'icon',
'summary',
];
protected $useTimestamps = true;
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
}

View File

@@ -1,37 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Model;
use Faker\Generator;
class FabricatorModel extends Model
{
protected $table = 'job';
protected $returnType = 'object';
protected $useSoftDeletes = true;
protected $useTimestamps = true;
protected $dateFormat = 'int';
protected $allowedFields = [
'name',
'description',
];
// Return a faked entity
public function fake(Generator &$faker)
{
return (object) [
'name' => $faker->ipv4,
'description' => $faker->words(10),
];
}
}

View File

@@ -1,28 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Model;
class JobModel extends Model
{
protected $table = 'job';
protected $returnType = 'object';
protected $useSoftDeletes = false;
protected $dateFormat = 'int';
protected $allowedFields = [
'name',
'description',
];
public $name = '';
public $description = '';
}

View File

@@ -1,27 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Model;
class SecondaryModel extends Model
{
protected $table = 'secondary';
protected $primaryKey = 'id';
protected $returnType = 'object';
protected $useSoftDeletes = false;
protected $dateFormat = 'int';
protected $allowedFields = [
'key',
'value',
];
}

View File

@@ -1,24 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Entity\Entity;
/**
* Class SimpleEntity
*
* Simple Entity-type class for testing creating and saving entities
* in the model so we can support Entity/Repository type patterns.
*/
class SimpleEntity extends Entity
{
}

View File

@@ -1,20 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Model;
class StringifyPkeyModel extends Model
{
protected $table = 'stringifypkey';
protected $returnType = 'object';
}

View File

@@ -1,31 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Model;
class UserModel extends Model
{
protected $table = 'user';
protected $allowedFields = [
'name',
'email',
'country',
'deleted_at',
];
protected $returnType = 'object';
protected $useSoftDeletes = true;
protected $dateFormat = 'datetime';
public $name = '';
public $email = '';
public $country = '';
}

View File

@@ -1,28 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Model;
class UserObjModel extends Model
{
protected $table = 'user';
protected $allowedFields = [
'name',
'email',
'country',
'deleted_at',
];
protected $returnType = \Tests\Support\Entity\User::class;
protected $useSoftDeletes = true;
protected $dateFormat = 'datetime';
}

View File

@@ -1,36 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Model;
class ValidErrorsModel extends Model
{
protected $table = 'job';
protected $returnType = 'object';
protected $useSoftDeletes = false;
protected $dateFormat = 'int';
protected $allowedFields = [
'name',
'description',
];
protected $validationRules = [
'name' => [
'required',
'min_length[10]',
'errors' => [
'min_length' => 'Minimum Length Error',
],
],
'token' => 'in_list[{id}]',
];
}

View File

@@ -1,39 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Model;
class ValidModel extends Model
{
protected $table = 'job';
protected $returnType = 'object';
protected $useSoftDeletes = false;
protected $dateFormat = 'int';
protected $allowedFields = [
'name',
'description',
];
protected $validationRules = [
'name' => [
'required',
'min_length[3]',
],
'token' => 'permit_empty|in_list[{id}]',
];
protected $validationMessages = [
'name' => [
'required' => 'You forgot to name the baby.',
'min_length' => 'Too short, man!',
],
];
}

View File

@@ -1,25 +0,0 @@
<?php
/**
* This file is part of CodeIgniter 4 framework.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests\Support\Models;
use CodeIgniter\Model;
class WithoutAutoIncrementModel extends Model
{
protected $table = 'without_auto_increment';
protected $primaryKey = 'key';
protected $allowedFields = [
'key',
'value',
];
protected $useAutoIncrement = false;
}