This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Curl{ | |
| private $agent = 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'; | |
| private $curl; | |
| private $cookiefile; | |
| private $login=''; | |
| function __construct($login_url){ | |
| $this->curl = curl_init($login_url); | |
| curl_setopt($this->curl, CURLOPT_URL,$login_url); //указываем адрес страницы | |
| curl_setopt($this->curl, CURLOPT_USERAGENT, $this->agent); //указываем заголовок User-Agent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| include "Curl.php"; | |
| class Kinopoisk{ | |
| private $refer = 'http://www.kinopoisk.ru/'; | |
| private $loginUrl = "http://www.kinopoisk.ru/login/"; | |
| function __construct($username, $password){ | |
| $curl = new Curl($this->loginUrl); | |
| $curl->setRefer($this->refer); | |
| $formData = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
| </head><body><br> Новость:??????? ??????????? ?? ?? ?????????? ??-?? ??????????? ???????????? ??????, - ????? ? ??? ???????<br> Дата:2016-08-30 18:54:17<hr><br> Новость:?????????? ?????? ????? ???????? ???????????????? ????????? ?? ???? ??????? ???????? "???" ???????????<br> Дата:2016-08-30 18:54:17<hr><br> Статья :? ???????? ?? ??????? ????????? ????? ???????????? ??? ????????? ???? ???????, - ???????? ??????? ??????? ????????? <br> Автор :??????<hr><br> это фотоотчет???????, ??????????, ????????, ????????, ??????? ? ??????? ????????? ????????? ???? ???????? ???????????? ?????? ?? ?????????? ??????????? ? ?????????? ??? ??????<br> <img src="http://test/img/ "><hr></body></html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Class One { | |
| function foo() { | |
| echo "heelo from class One"; | |
| } | |
| function callMe() { | |
| $this->foo(); | |
| } | |
| } | |
| Class Two extends One { | |
| function foo() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| abstract class Character { | |
| protected $spells = []; | |
| abstract public function getTalants(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| abstract class Character { | |
| public $name; | |
| public $role; | |
| public $level = 1; | |
| protected $count; | |
| abstract public function updateStats(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Character | |
| { | |
| public $lvl= 1; | |
| public $character; | |
| const WARRIOR = 'warrior'; | |
| const MAGE = 'mage'; | |
| public $stats = array( | |
| self::WARRIOR => array('power' => 2 , 'intellect' => 1), | |
| self::MAGE => array('power' => 1, 'intellect' => 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| abstract class Character | |
| { | |
| public $lvl= 1; | |
| public $name; | |
| public $power; | |
| public $intellect; | |
| abstract function updateStat(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| abstract class Character | |
| { | |
| public $lvl= 1; | |
| public $name; | |
| public $power; | |
| public $intellect; | |
| abstract function updateStat(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Lesson #2 | |
| Домашнее задание: | |
| 1. Еще раз читаем доку по гиту, разбираемся с основными командами для работы с гитом. | |
| 2. На сайте гитхаба создаем новый репозиторий для дз№2 | |
| 3. Читаем об композере https://getcomposer.org/ | |
| 4. Установить себе на комп композер | |
| 5. В вашем проекте к дз№2 инициализировать композер. | |
| 6. Установить несколько пхп библиотек (минимум 2) через композер и написать небольшой скриптик, в котором вы их будете использовать. | |
| 7. В конфигурации к композеру должна быть обязательной проверка на версию пхп для подключаемых библиотек и минимум 2-х модулей к пхп |