diff --git a/Information.txt b/Information.txt index 7c5019a..eef77cb 100644 --- a/Information.txt +++ b/Information.txt @@ -1,4 +1,4 @@ -autoincrement=id;last_id=19;table_name=user_info +autoincrement=id;last_id=24;table_name=user_info id;surname;name;patronymic;dateOfBirth;gender;countryCode;phoneNumber;email;status 3;Билай;Станислав;Романович;2002-03-11;Мужчина;+7;9493761924;stasbilay02@yandex.ru;0 4;Иванова;Мария;Сергеевна;2002-04-05;Женщина;+38;2222222222;sdguhnlnoih@gmail.com;1 @@ -17,3 +17,4 @@ id;surname;name;patronymic;dateOfBirth;gender;countryCode;phoneNumber;email;stat 17;Зайцева;Анжела;Игоревна;7777-07-07;Женщина;+7;4444444444;aksjfhfka@mail.ru;0 18;Зайцева;Анжела;Игоревна;7777-07-07;Женщина;+7;4444444444;aksjfhfka@mail.ru;1 19;Зайцева;Анжела;Игоревна;7777-07-07;Женщина;+7;4444444444;aksjfhfka@mail.ru;1 +24;ddd;Кирилл;ddd;2024-06-25;Мужчина;+7;9281234567;apuc06@mail.ru; diff --git a/Information2.txt b/Information2.txt new file mode 100644 index 0000000..8c7b833 --- /dev/null +++ b/Information2.txt @@ -0,0 +1,20 @@ +autoincrement=id;last_id=20;table_name=user_info +id;surname;name;patronymic;dateOfBirth;gender;countryCode;phoneNumber;email;status +3;Билай;Станислав;Романович;2002-03-11;Мужчина;+7;9493761924;stasbilay02@yandex.ru;0 +4;Иванова;Мария;Сергеевна;2002-04-05;Женщина;+38;2222222222;sdguhnlnoih@gmail.com;1 +5;Иванов;Иван;Иванович;2002-03-11;Мужчина;+7;1111111111;dsjgbdskgb@yandex.ru;1 +6;Плешкова;Анастасия;Денисовна;2006-11-10;Женщина;+7;3333333333;ple.anastasiya@gmail.com;0 +7;Зайцева;Анжела;Игоревна;1998-12-12;Женщина;+7;4444444444;aksjfhfka@mail.ru;0 +8;Петров;Петр;Петрович;1987-03-02;Мужчина;+7;7777777777;jksghhsdkj@gmail.com;1 +9;Зайцев;Федор;Александрович;2014-12-22;Мужчина;+7;6667774441;asert@mail.ru;1 +10;Иванов;Петр;Михайлович;2002-03-11;Мужчина;+7;1111111111;asert@mail.ru;1 +11;Иванов;Роман;Сергеевич;2002-03-11;Мужчина;+7;1111111111;ple.anastasiya@gmail.com;0 +12;Билай;Станислав;Романович;4444-04-04;Мужчина;+7;9493761924;stasbilay02@yandex.ru;0 +13;Билай;Станислав;Романович;4444-04-04;Мужчина;+7;9493761924;stasbilay02@yandex.ru;1 +14;Билай;Станислав;Романович;4444-04-04;Мужчина;+7;9493761924;stasbilay02@yandex.ru;0 +15;Билай;Станислав;Романович;4444-04-04;Мужчина;+7;9493761924;stasbilay02@yandex.ru;0 +16;Билай;Станислав;Романович;4444-04-04;Женщина;+38;9493761924;stasbilay02@yandex.ru;0 +17;Зайцева;Анжела;Игоревна;7777-07-07;Женщина;+7;4444444444;aksjfhfka@mail.ru;0 +18;Зайцева;Анжела;Игоревна;7777-07-07;Женщина;+7;4444444444;aksjfhfka@mail.ru;1 +19;Зайцева;Анжела;Игоревна;7777-07-07;Женщина;+7;4444444444;aksjfhfka@mail.ru;1 +20;ddd;Кирилл;ddd;2024-06-25;Мужчина;+7;9281234567;apuc06@mail.ru; diff --git a/info.php b/info.php index 57e0b2f..94dcbdf 100644 --- a/info.php +++ b/info.php @@ -3,15 +3,15 @@ namespace src; use src\debug\Debug; +use src\dto\InformationDTO; use src\file_db_driver\FileDatabaseDriver; -use src\Information; require_once "vendor/autoload.php"; //$fileName = "Information.txt"; //$fileModeOpen = "a"; -$fullInformation = new Information(); +$fullInformation = new InformationDTO(); $fullInformation->load($_REQUEST); $string = $fullInformation->toString(); diff --git a/search.php b/search.php index 2beb516..dfecc69 100644 --- a/search.php +++ b/search.php @@ -1,7 +1,6 @@ close(); $infArr = []; foreach ($res as $key){ - $inf = new Information(); + $inf = new InformationDTO(); $inf->load($key); $infArr[] = $inf; } diff --git a/src/Information.php b/src/dto/InformationDTO.php similarity index 93% rename from src/Information.php rename to src/dto/InformationDTO.php index 2daf333..5535c65 100644 --- a/src/Information.php +++ b/src/dto/InformationDTO.php @@ -1,8 +1,6 @@ fdd = new FileDatabaseDriver(); + $this->fdd->connect($this->file()); + } + + /** + * @return array + */ + public function fillable(): array + { + return []; + } + + /** + * @return string + */ + public function file(): string + { + return ""; + } + + public function save() + { + + } + +} \ No newline at end of file diff --git a/vendor/autoload.php b/vendor/autoload.php index b82fa34..952f0e8 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -2,6 +2,24 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + trigger_error( + $err, + E_USER_ERROR + ); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit5983c395e598dae0283c3b233c3f9cc1::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index afef3fa..a72151c 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -42,6 +42,9 @@ namespace Composer\Autoload; */ class ClassLoader { + /** @var \Closure(string):void */ + private static $includeFile; + /** @var ?string */ private $vendorDir; @@ -106,6 +109,7 @@ class ClassLoader public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } /** @@ -425,7 +429,8 @@ class ClassLoader public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } @@ -555,18 +560,26 @@ class ClassLoader return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index d50e0c9..51e734a 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -21,12 +21,14 @@ use Composer\Semver\VersionParser; * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final */ class InstalledVersions { /** * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null */ private static $installed; @@ -37,7 +39,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array}> + * @psalm-var array}> */ private static $installedByVendor = array(); @@ -96,7 +98,7 @@ class InstalledVersions { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -117,7 +119,7 @@ class InstalledVersions */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -241,7 +243,7 @@ class InstalledVersions /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { @@ -255,7 +257,7 @@ class InstalledVersions * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} */ public static function getRawData() { @@ -278,7 +280,7 @@ class InstalledVersions * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -301,7 +303,7 @@ class InstalledVersions * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data */ public static function reload($data) { @@ -311,7 +313,7 @@ class InstalledVersions /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { @@ -326,7 +328,9 @@ class InstalledVersions if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -338,12 +342,17 @@ class InstalledVersions // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE index 62ecfd8..f27399a 100644 --- a/vendor/composer/LICENSE +++ b/vendor/composer/LICENSE @@ -1,3 +1,4 @@ + Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy @@ -17,3 +18,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 5b5624c..0fb0a2c 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2,20 +2,9 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'Itguild\\Tables\\ListJsonTable' => $vendorDir . '/itguild/tables/src/ListJsonTable.php', - 'Itguild\\Tables\\Pagination' => $vendorDir . '/itguild/tables/src/Pagination.php', - 'Itguild\\Tables\\ViewJsonTable' => $vendorDir . '/itguild/tables/src/ViewJsonTable.php', - 'Itguild\\Tables\\actionBtn\\ActionBtn' => $vendorDir . '/itguild/tables/src/actionBtn/ActionBtn.php', - 'Itguild\\Tables\\actionBtn\\ToDeleteBtn' => $vendorDir . '/itguild/tables/src/actionBtn/ToDeleteBtn.php', - 'Itguild\\Tables\\actionBtn\\ToEditBtn' => $vendorDir . '/itguild/tables/src/actionBtn/ToEditBtn.php', - 'Itguild\\Tables\\actionBtn\\ToListBtn' => $vendorDir . '/itguild/tables/src/actionBtn/ToListBtn.php', - 'Itguild\\Tables\\traits\\CreateOption' => $vendorDir . '/itguild/tables/src/traits/CreateOption.php', - 'Itguild\\Tables\\traits\\CreateParams' => $vendorDir . '/itguild/tables/src/traits/CreateParams.php', - 'src\\debug\\Debug' => $baseDir . '/src/debug/Debug.php', - 'src\\file_db_driver\\FileDatabaseDriver' => $baseDir . '/src/file_db_driver/FileDatabaseDriver.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index b7fc012..15a2ff3 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 6e86e7e..f044600 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index cfeaea9..566f070 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -23,30 +23,11 @@ class ComposerAutoloaderInit5983c395e598dae0283c3b233c3f9cc1 } spl_autoload_register(array('ComposerAutoloaderInit5983c395e598dae0283c3b233c3f9cc1', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit5983c395e598dae0283c3b233c3f9cc1', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit5983c395e598dae0283c3b233c3f9cc1::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit5983c395e598dae0283c3b233c3f9cc1::getInitializer($loader)); $loader->register(true); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index c34485d..4e59e8f 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -30,17 +30,6 @@ class ComposerStaticInit5983c395e598dae0283c3b233c3f9cc1 public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'Itguild\\Tables\\ListJsonTable' => __DIR__ . '/..' . '/itguild/tables/src/ListJsonTable.php', - 'Itguild\\Tables\\Pagination' => __DIR__ . '/..' . '/itguild/tables/src/Pagination.php', - 'Itguild\\Tables\\ViewJsonTable' => __DIR__ . '/..' . '/itguild/tables/src/ViewJsonTable.php', - 'Itguild\\Tables\\actionBtn\\ActionBtn' => __DIR__ . '/..' . '/itguild/tables/src/actionBtn/ActionBtn.php', - 'Itguild\\Tables\\actionBtn\\ToDeleteBtn' => __DIR__ . '/..' . '/itguild/tables/src/actionBtn/ToDeleteBtn.php', - 'Itguild\\Tables\\actionBtn\\ToEditBtn' => __DIR__ . '/..' . '/itguild/tables/src/actionBtn/ToEditBtn.php', - 'Itguild\\Tables\\actionBtn\\ToListBtn' => __DIR__ . '/..' . '/itguild/tables/src/actionBtn/ToListBtn.php', - 'Itguild\\Tables\\traits\\CreateOption' => __DIR__ . '/..' . '/itguild/tables/src/traits/CreateOption.php', - 'Itguild\\Tables\\traits\\CreateParams' => __DIR__ . '/..' . '/itguild/tables/src/traits/CreateParams.php', - 'src\\debug\\Debug' => __DIR__ . '/../..' . '/src/debug/Debug.php', - 'src\\file_db_driver\\FileDatabaseDriver' => __DIR__ . '/../..' . '/src/file_db_driver/FileDatabaseDriver.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index babafe5..e69de29 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,35 +0,0 @@ -{ - "packages": [ - { - "name": "itguild/tables", - "version": "0.1", - "version_normalized": "0.1.0.0", - "source": { - "type": "git", - "url": "https://git.itguild.info/ItGuild/tables", - "reference": "42ab26a3db1cef8319985fc3a0f5d23d2dff4e3b" - }, - "time": "2024-05-27T09:59:44+00:00", - "type": "library", - "installation-source": "source", - "autoload": { - "psr-4": { - "Itguild\\Tables\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kavalar", - "email": "apuc06@mail.ru" - } - ], - "install-path": "../itguild/tables" - } - ], - "dev": true, - "dev-package-names": [] -} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 389c5a2..fe9ceb4 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,31 +1,31 @@ array( + 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', + 'reference' => '2714dad7cea767e4d3f2133bef559e30bb581ca5', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '5468b1d2860f8173bf9ab0050803fb54beff40ed', - 'name' => '__root__', 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', + 'reference' => '2714dad7cea767e4d3f2133bef559e30bb581ca5', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '5468b1d2860f8173bf9ab0050803fb54beff40ed', 'dev_requirement' => false, ), 'itguild/tables' => array( 'pretty_version' => '0.1', 'version' => '0.1.0.0', + 'reference' => '42ab26a3db1cef8319985fc3a0f5d23d2dff4e3b', 'type' => 'library', 'install_path' => __DIR__ . '/../itguild/tables', 'aliases' => array(), - 'reference' => '42ab26a3db1cef8319985fc3a0f5d23d2dff4e3b', 'dev_requirement' => false, ), ), diff --git a/vendor/itguild/tables b/vendor/itguild/tables deleted file mode 160000 index 42ab26a..0000000 --- a/vendor/itguild/tables +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 42ab26a3db1cef8319985fc3a0f5d23d2dff4e3b