class Weight extends Product
{
function buy()
{
return $this; // возвращаем объект, методы которого сможем использовать дальше
}
function weight($amout)
{
parent::$profit += parent::getPrice() * $amout;
echo "Весовой товар куплен. <br> Доход с продаж весовых товаров " . parent::$profit . "<br>";
}
}
$productWeight::buy()->weight(5.5);
async function postData(url = '', data = {}) {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
});
return await response.json();
}
postData('/handler.php', { number: 42 })
.then((data) => {
console.log(data.number);
});
$number = (int)$_POST['number'];
$number += 1;
echo json_encode(['number' => $number]);
return [
'host' => 'localhost';
'port' => 3306;
'user' => 'root';
'password' => 'ПАРОЛЬ';
'db' => 'БАЗА';
'authme_table' => 'users';
];
class Config {
public $host;
public $user;
// ...
public function __construct(array $conf){
$this->host = $conf['host'];
$this->user = $conf['user'];
// ...
}
}
class AuthController {
protected $config;
public function __construct(Config $config){
$this->config = $config
}
}
$conf = include "/engine/data/dbconfig.php";
$config = new Config($conf);
$constroller = new AuthController($config);
name="files[]"
tg://
, скайп – skype://
.execprogam://
, ассоциируете его со своей самописной программой или скриптом и делаете на web-странице ссылки вида execprogram://calc.exe
//Перенос файлов PHP
function php() {
return src(path.src.php)
// .pipe(webphtml()) Вот эту хрень выбросите
.pipe(dest(path.build.php))
.pipe(browsersync.stream())
}