Exemplo n.º 1
0
<?php

ini_set('display_errors', 2);
//TODO
date_default_timezone_set('Etc/GMT+3');
//TODO
class MyClass
{
    function __autoload($class_name1)
    {
        require $class_name1 . '.php';
    }
}
$obj = new MyClass();
$obj->__autoload('INewsDB.class');
class NewsDB implements INewsDB
{
    private $mysqli;
    private $dblocation = 'localhost';
    public $news;
    public $errMsq = '';
    private $dt;
    public $category;
    public $date_start;
    public $date_end;
    public function __construct($dbname)
    {
        $this->mysqli = new mysqli($this->dblocation, 'root', '', $dbname);
        if (!$this->mysqli) {
            die('Error connection: ' . mysql_error());
        } else {
Exemplo n.º 2
0
 * Created by PhpStorm.
 * User: Yuri
 * Date: 21.11.15
 * Time: 20:46
 */
class MyClass
{
    function __autoload($class_name1, $class_name2, $class_name3)
    {
        require $class_name1 . '.php';
        require $class_name2 . '.php';
        require $class_name3 . '.php';
    }
}
$obj = new MyClass();
$obj->__autoload('lab1.8.classAbstract', 'lab1.8.classInterface', 'lab1.4');
/*abstract class AUser {

    abstract function showInfo($name, $login, $password);

}

class User extends AUser {

    function showInfo($name, $login, $password){
        echo ('Hi User! <br> Your name: '.$name.'. You login: '******'. You password: '******'.<br><br>');
    }

}

$obj = new User();