SELECT * FROM users WHERE username=:username
$user = [
'id' => 1,
'username' => 'vasya',
'password' => 'длинный хеш'
]
password_verify($old_password, $user['hash'])
$hash = password_hash($new_password, PASSWORD_DEFAULT);
UPDATE users SET password=:hash WHERE id=$user['id']
while($row = $result->fetch_array())
{
echo 'Author: ' . $row['author'] . "<br>";
echo 'Title: ' . $row['title'] . "<br>";
echo 'Category: ' . $row['category'] . "<br>";
echo 'Year: ' . $row['year'] . "<br>";
echo 'ISBN: ' . $row['isbn'] . "<br><br>";
}
foreach ($not_calculate_dpd as $not_calculate) {
if ($not_calculate['value'] == attribute($_context, 'shipping_dpd_not_calculate' ~ $not_calculate['value'])) {
echo $not_calculate['name'];
} else {
echo $not_calculate['name'];
}
}
foreach ($not_calculate_dpd as $not_calculate) {
echo $not_calculate['name'];
}
"psr-4": {
"core\\": "app/core"
}
class SoapController extends Controller
{
/** @var \Artisaninweb\SoapWrapper\SoapWrapper */
protected $soap;
/** @var \Artisaninweb\SoapWrapper\Client */
protected $client;
public function __construct(SoapWrapper $soap)
{
$this->soap = $soap;
$this->client = null;
}
public function getComputers()
{
try {
$clientId = request()->get('clientId', 0);
$orgId = request()->get('orgId', 0);
$this->initSoap();
$response = $this->client->call('GetComps', [
[
'ClientId' => $clientId,
'OrgId' => $orgId,
],
]);
$computers = json_decode($response->GetCompsResult, true);
return response()->json($computers, 200);
} catch (\Throwable $e) {
return response()->json([
'message' => $e->getMessage(),
], 500);
}
}
/**
* @throws \Exception
*/
protected function initSoap()
{
$clientName = 'some_name';
$wsdl = config('app.soap_wsdl');
if (!$wsdl) throw new \Exception('Invalid wsdl');
$version = $this->getSoapVersion();
$this->soap->add($clientName, function (SoapService $service) use ($wsdl, $version) {
$service
->wsdl($wsdl)
->options(['soap_version' => $version]);
});
$this->client = $this->soap->client($clientName, function ($client) { return $client; });
}
/**
* @return int
* @throws \Exception
*/
protected function getSoapVersion()
{
switch (config('app.soap_version')) {
case '1.1':
return SOAP_1_1;
case '1.2':
return SOAP_1_2;
default:
throw new \Exception('Invalid SOAP version');
}
}
}
use App\Models\Route;
use App\Controllers\TestController;
return [
new Route('/test/uri', TestController::class, 'testFunc')
];
new $elem->controller
, то получается new TestController
, без неймспейса.::class
содержит полное имя класса в виде строки.new \App\Controllers\TestController
return [
new Route('/test/uri', '\\App\\Controllers\\TestController', 'testFunc')
];
$b = new B;
$b->show(); // true
A::noConstraints(function() use($b) {
$b->show(); // false
});
пароль htmlspecialchars для перестраховки
минимальную фильтрацию где это необходимо
разрешить в логин и имя только a-zа-яё0-9