public function __construct() { if (!Client::getAccess()) { throw new AdapterException("Could not access to the data service"); } else { return $this; } }
function s($s) { echo '<pre>'; print_r($s); echo '</pre>'; } Adapter::checkAdapter($userAdapter, function ($exception) { echo $exception->getExceptions("E_USER"); echo $exception->getExceptions("E_PASSWORD"); echo $exception->getExceptions("E_DATABASE"); }, function () { Client::setAccess(); $dataHandler = new Data(); $cdbs = $dataHandler->getDatabases(new FilesystemIterator("src/databases")); foreach ($cdbs as $key) { if ($cdbs->getFilename() == Client::getClient()[2] . '.cdb') { $db = $cdbs->getFilename(); } } $dataExpressions = new \Handler\DataExpression(); echo $db . '<br>'; if (preg_match_all(sprintf($dataExpressions->getIterator()["table"], "Users", "Users", "Users"), file_get_contents('./src/databases/' . $db), $matches)) { s($matches); } else { s($matches); } if (preg_match_all(sprintf($dataExpressions->getIterator()["comment"]), file_get_contents('./src/databases/' . $db), $matches)) { s($matches); } else { s($matches); }