{"id":274708,"date":"2016-02-21T21:56:02","date_gmt":"2016-02-21T18:56:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=274708"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=274708","title":{"rendered":"\u0414\u0435\u043b\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 php \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435"},"content":{"rendered":"<p>       \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0444\u043e\u0440\u0443\u043c\u043e\u0432 \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e php \u2014 \u044d\u0442\u043e \u044f\u0437\u044b\u043a \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0414\u0430, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u0430\u0439\u0442\u043e\u0432 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0434\u0430\u0436\u0435 \u0432\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u044e) \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 php, \u043d\u043e \u044d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0432\u0435\u0431\u0430.<br \/>  \u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 php, \u043d\u0430 \u043b\u044e\u0434\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0437\u043d\u0430\u044e\u0442, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u0433\u0443\u0440\u0443-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0438\u0441\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 php.<a name=\"habracut\"><\/a><br \/>  \u0427\u0442\u043e \u0431\u044b \u0432 unix \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c php \u0441\u043a\u0440\u0438\u043f\u0442, \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439  <\/p>\n<pre><code class=\"bash\">php app.php [param] [param] <\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u043a\u0430\u043a\u0438\u0435 \u043b\u0438\u0431\u043e \u0434\u0430\u043d\u043d\u044b\u0435. \u041e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435   <\/p>\n<pre><code class=\"php\">$argv <\/code><\/pre>\n<p>  \u041d\u0443\u043b\u0435\u0432\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 php \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 php \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e:  <\/p>\n<pre><code class=\"bash\">============================================== \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440: 1 \u0424\u0418\u041e:           \u0412\u0430\u0441\u044f \u0422\u0435\u043b\u0435\u0444\u043e\u043d:       8-920-000-00-00 Email:         vasya@mail.ru \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439:   \u0417\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u0438\u0437 \u0441\u0430\u0434\u0438\u043a\u0430 ============================================== ============================================== \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440: 2 \u0424\u0418\u041e:           \u041a\u043e\u043b\u044f \u0422\u0435\u043b\u0435\u0444\u043e\u043d:       234543 Email:         kolya@ya.ru \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439:   \u0417\u0430\u043c\u0435\u0442\u043a\u0430 \u043e \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0435 ============================================== <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 MySQL \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443   <\/p>\n<pre><code class=\"sql\">CREATE TABLE `contacts` (   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,   `name` text,   `email` text,   `tel` text,   `comment` text,   PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 SafeMySQL (<a href=\"https:\/\/github.com\/colshrapnel\/safemysql\/blob\/master\/safemysql.class.php\">GitHub<\/a>)<\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a  <\/p>\n<pre><code class=\"php\">    include &quot;safemysql.class.php&quot;;     \/\/ \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b     class set {         public $bdset = array(             'host' =&gt; 'localhost', \/\/ \u0425\u043e\u0441\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \t\t    'user' =&gt; 'root',       \/\/ \u041b\u043e\u0433\u0438\u043d \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0411\u0414 \t\t    'pass' =&gt; 'root',\/\/ \u041f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0411\u0414 \t\t    'db'   =&gt; 'cont',       \/\/ \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445          );         public $q = &quot;hello&quot;;     } <\/code><\/pre>\n<p>  \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0432\u043e\u0438. <\/p>\n<p>  \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438  <\/p>\n<pre><code class=\"php\">system(&quot;clear&quot;); \/\/\u041e\u0447\u0438\u0449\u0430\u0435\u043c \u044d\u043a\u0440\u0430\u043d \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0432\u043e\u0434\u043e\u043c     \/\/ \u0428\u0430\u043f\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u0442\u0430\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e contacts)     echo &quot;             _           _\\n&quot;;     echo &quot; ___ ___ ___| |_ ___ ___| |_ ___\\n&quot;;     echo &quot;|  _| . |   |  _| .'|  _|  _|_ -|\\n&quot;;     echo &quot;|___|___|_|_|_| |__,|___|_| |___|\\n&quot;;     echo &quot;\u041d\u0430\u0434\u0451\u0436\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432\u0430\u0448\u0438\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432\\n&quot;;     \/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430     switch ($argv[1]) {         case 'view':             $do = new action();             $do-&gt;view();             break;         case 'edit':             if (isset($argv[2])) {                 $do = new action();                 $do -&gt;edit($argv[2]);             }             echo &quot;\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0441\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \\n&quot;;             break;         case 'add':             $do = new action();             $do -&gt;add();             break;         case 'delete':             if (isset($argv[2])) {                 $do = new action();                 $do -&gt;delete($argv[2]);             }             echo &quot;\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0441\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \\n&quot;;             break;         case 'help':             $do = new action();             $do -&gt;help();             break;          default:             \/\/ \u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u0438\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442, \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435             echo &quot;\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0441\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \\n&quot;;             break;     }     echo &quot;\\n&quot;; \/\/ \u0414\u0435\u043b\u0430\u0435\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438, \u0447\u0442\u043e \u0431\u044b \u043e\u0442\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 action \u0438 \u0432\u0441\u0435 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<br \/>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430  <\/p>\n<pre><code class=\"php\">public function view(){             \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a             $sets = new set();             \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b             $db = new SafeMySQL($sets-&gt;bdset);             $data = $db-&gt;getAll(&quot;SELECT * FROM contacts&quot;);             foreach ($data as $key) {                 echo &quot;==============================================\\n&quot;;                 echo &quot;\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440: &quot;.$key[&quot;id&quot;].&quot;\\n&quot;;                 echo &quot;\u0424\u0418\u041e:           &quot;.$key[&quot;name&quot;].&quot;\\n&quot;;                 echo &quot;\u0422\u0435\u043b\u0435\u0444\u043e\u043d:       &quot;.$key[&quot;tel&quot;].&quot;\\n&quot;;                 echo &quot;Email:         &quot;.$key[&quot;email&quot;].&quot;\\n&quot;;                 echo &quot;\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439:   &quot;.$key[&quot;comment&quot;].&quot;\\n&quot;;                 echo &quot;==============================================\\n&quot;;             } } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f  <\/p>\n<pre><code class=\"php\">public function add() {             \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a             $sets = new set();             \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b             $db = new SafeMySQL($sets-&gt;bdset);             \/\/ \u0417\u0430\u0434\u0430\u0451\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435             echo &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043c\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n&quot;;             $addname = readline();             echo &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n&quot;;             $addtel = readline();             echo &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 email \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n&quot;;             $addemail = readline();             echo &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0443: \\n&quot;;             $addcomment = readline();              \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0431\u0430\u0437\u0443             $db-&gt;query(&quot;INSERT INTO contacts (name, tel, email, comment) VALUES (?s, ?s, ?s, ?s)&quot;, $addname, $addtel, $addemail, $addcomment);             echo &quot;\u0417\u0430\u043f\u0438\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \\n&quot;;             \/\/ \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432             $do = new action();             $do-&gt;view();         } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f  <\/p>\n<pre><code class=\"php\">public function edit($id) {             \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a             $sets = new set();             \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b             $db = new SafeMySQL($sets-&gt;bdset);             \/\/ \u0417\u0430\u0434\u0430\u0451\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435             echo &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043c\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n&quot;;             $editname = readline();             echo &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n&quot;;             $edittel = readline();             echo &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 email \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n&quot;;             $editemail = readline();             echo &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0443: \\n&quot;;             $editcomment = readline();              \/\/ \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c             $db-&gt;query(&quot;UPDATE contacts SET name = ?s, tel = ?s, email = ?s, comment = ?s WHERE id = ?i&quot;, $editname, $edittel, $editemail, $editcomment, $id);             echo &quot;\u0417\u0430\u043f\u0438\u0441\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \\n&quot;;             \/\/ \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432             $do = new action();             $do-&gt;view();         } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f  <\/p>\n<pre><code class=\"javascript\"> public function delete($id){             echo &quot;\u0412\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0430\u043a\u0442 #&quot;.$id.&quot;? (y\/n) \\n&quot;;             $del = readline();             if ($del == &quot;y&quot;) {                 \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a                 $sets = new set();                 \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b                 $db = new SafeMySQL($sets-&gt;bdset);                 \/\/ \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0442\u0430\u043a\u0442 \u0438\u0437 \u0431\u0430\u0437\u044b                 $db-&gt;query(&quot;DELETE FROM contacts WHERE id = ?i&quot;, $id);                 echo &quot;\u0417\u0430\u043f\u0438\u0441\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u0430 \\n&quot;;                 \/\/ \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432                 $do = new action();                 $do-&gt;view();             }             else echo &quot;\u041d\u0443 \u043d\u0435\u0442, \u0442\u0430\u043a \u043d\u0435\u0442. \\n&quot;;          } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u0441\u043f\u0440\u0430\u0432\u043a\u0438  <\/p>\n<pre><code class=\"php\">        public function help() {             echo &quot;==============================================\\n&quot;;             echo &quot;\u0421\u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435\\n&quot;;             echo &quot;==============================================\\n&quot;;             echo &quot;php contacts.php view - \u0432\u044b\u0432\u043e\u0434 \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432\\n&quot;;             echo &quot;php contacts.php view 3 - \u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c\\n&quot;;             echo &quot;php contacts.php add - \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430\\n&quot;;             echo &quot;php contacts.php delete 3 - \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c\\n&quot;;             echo &quot;php contacts.php help - \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u0443 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443\\n&quot;;         } <\/code><\/pre>\n<p>  \u042f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0434\u0430\u0436\u0435 \u043d\u043e\u0432\u0438\u0447\u043a\u0443 \u043a\u043e\u0434, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u041e\u041e\u041f.<br \/>  \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439, \u043d\u043e \u0435\u0441\u043b\u0438 \u043a\u043e\u043c\u0443 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u2014 \u0432\u043e\u0442  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/b><\/p>\n<div class=\"spoiler_text\">&lt;?php<br \/>   \/\/ \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432<\/p>\n<p>  \/\/ \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<br \/>   include \u00abdb.php\u00bb;<br \/>   \/\/ \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<br \/>   class set {<br \/>   public $bdset = array(<br \/>   &#8216;host&#8217; =&gt; &#8216;localhost&#8217;, \/\/ \u0425\u043e\u0441\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<br \/>   &#8216;user&#8217; =&gt; &#8216;root&#8217;, \/\/ \u041b\u043e\u0433\u0438\u043d \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0411\u0414<br \/>   &#8216;pass&#8217; =&gt; &#8216;root&#8217;,\/\/ \u041f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0411\u0414<br \/>   &#8216;db&#8217; =&gt; &#8216;cont&#8217;, \/\/ \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<br \/>   );<br \/>   public $q = \u00abhello\u00bb;<br \/>   }<br \/>   \/\/ \u041a\u043b\u0430\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439<br \/>   class action {<br \/>   \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430 (\u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432)<br \/>   public function view(){<br \/>   \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a<br \/>   $sets = new set();<br \/>   \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<br \/>   $db = new SafeMySQL($sets-&gt;bdset);<br \/>   $data = $db-&gt;getAll(\u00abSELECT * FROM contacts\u00bb);<br \/>   foreach ($data as $key) {<br \/>   echo &quot;==============================================\\n&quot;;<br \/>   echo \u00ab\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440: \u00bb.$key[\u00abid\u00bb].&quot;\\n&quot;;<br \/>   echo \u00ab\u0424\u0418\u041e: \u00bb.$key[\u00abname\u00bb].&quot;\\n&quot;;<br \/>   echo \u00ab\u0422\u0435\u043b\u0435\u0444\u043e\u043d: \u00bb.$key[\u00abtel\u00bb].&quot;\\n&quot;;<br \/>   echo \u00abEmail: \u00bb.$key[\u00abemail\u00bb].&quot;\\n&quot;;<br \/>   echo \u00ab\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439: \u00bb.$key[\u00abcomment\u00bb].&quot;\\n&quot;;<br \/>   echo &quot;==============================================\\n&quot;;<br \/>   }<br \/>   }<br \/>   \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430<br \/>   public function add() {<br \/>   \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a<br \/>   $sets = new set();<br \/>   \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<br \/>   $db = new SafeMySQL($sets-&gt;bdset);<br \/>   \/\/ \u0417\u0430\u0434\u0430\u0451\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<br \/>   echo \u00ab\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043c\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n\u00bb;<br \/>   $addname = readline();<br \/>   echo \u00ab\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n\u00bb;<br \/>   $addtel = readline();<br \/>   echo \u00ab\u0412\u0432\u0435\u0434\u0438\u0442\u0435 email \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n\u00bb;<br \/>   $addemail = readline();<br \/>   echo \u00ab\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0443: \\n\u00bb;<br \/>   $addcomment = readline();<\/p>\n<p>  \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0431\u0430\u0437\u0443<br \/>   $db-&gt;query(\u00abINSERT INTO contacts (name, tel, email, comment) VALUES (?s, ?s, ?s, ?s)\u00bb, $addname, $addtel, $addemail, $addcomment);<br \/>   echo \u00ab\u0417\u0430\u043f\u0438\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \\n\u00bb;<br \/>   \/\/ \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432<br \/>   $do = new action();<br \/>   $do-&gt;view();<br \/>   }<br \/>   \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430<br \/>   public function delete($id){<br \/>   echo \u00ab\u0412\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0430\u043a\u0442 #\u00bb.$id.&quot;? (y\/n) \\n&quot;;<br \/>   $del = readline();<br \/>   if ($del == \u00aby\u00bb) {<br \/>   \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a<br \/>   $sets = new set();<br \/>   \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<br \/>   $db = new SafeMySQL($sets-&gt;bdset);<br \/>   \/\/ \u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0442\u0430\u043a\u0442 \u0438\u0437 \u0431\u0430\u0437\u044b<br \/>   $db-&gt;query(\u00abDELETE FROM contacts WHERE id = ?i\u00bb, $id);<br \/>   echo \u00ab\u0417\u0430\u043f\u0438\u0441\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u0430 \\n\u00bb;<br \/>   \/\/ \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432<br \/>   $do = new action();<br \/>   $do-&gt;view();<br \/>   }<br \/>   else echo \u00ab\u041d\u0443 \u043d\u0435\u0442, \u0442\u0430\u043a \u043d\u0435\u0442. \\n\u00bb;<\/p>\n<p>  }<br \/>   \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430<br \/>   public function edit($id) {<br \/>   \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a<br \/>   $sets = new set();<br \/>   \/\/ \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<br \/>   $db = new SafeMySQL($sets-&gt;bdset);<br \/>   \/\/ \u0417\u0430\u0434\u0430\u0451\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<br \/>   echo \u00ab\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043c\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n\u00bb;<br \/>   $editname = readline();<br \/>   echo \u00ab\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n\u00bb;<br \/>   $edittel = readline();<br \/>   echo \u00ab\u0412\u0432\u0435\u0434\u0438\u0442\u0435 email \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430: \\n\u00bb;<br \/>   $editemail = readline();<br \/>   echo \u00ab\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0443: \\n\u00bb;<br \/>   $editcomment = readline();<\/p>\n<p>  \/\/ \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c<br \/>   $db-&gt;query(\u00abUPDATE contacts SET name = ?s, tel = ?s, email = ?s, comment = ?s WHERE id = ?i\u00bb, $editname, $edittel, $editemail, $editcomment, $id);<br \/>   echo \u00ab\u0417\u0430\u043f\u0438\u0441\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \\n\u00bb;<br \/>   \/\/ \u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432<br \/>   $do = new action();<br \/>   $do-&gt;view();<br \/>   }<br \/>   \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u0441\u043f\u0440\u0430\u0432\u043a\u0438<br \/>   public function help() {<br \/>   echo &quot;==============================================\\n&quot;;<br \/>   echo \u00ab\u0421\u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435\\n\u00bb;<br \/>   echo &quot;==============================================\\n&quot;;<br \/>   echo \u00abphp contacts.php view \u2014 \u0432\u044b\u0432\u043e\u0434 \u0432\u0441\u0435\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432\\n\u00bb;<br \/>   echo \u00abphp contacts.php view 3 \u2014 \u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c\\n\u00bb;<br \/>   echo \u00abphp contacts.php add \u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430\\n\u00bb;<br \/>   echo \u00abphp contacts.php delete 3 \u2014 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c\\n\u00bb;<br \/>   echo \u00abphp contacts.php help \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u0443 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443\\n\u00bb;<br \/>   }<\/p>\n<p>  }<\/p>\n<p>  system(\u00abclear\u00bb); \/\/\u041e\u0447\u0438\u0449\u0430\u0435\u043c \u044d\u043a\u0440\u0430\u043d \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0432\u043e\u0434\u043e\u043c<br \/>   \/\/ \u0428\u0430\u043f\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u0442\u0430\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e contacts)<br \/>   echo &quot; _ _\\n&quot;;<br \/>   echo &quot; ___ ___ ___| |_ ___ ___| |_ ___\\n&quot;;<br \/>   echo &quot;| _|. | | _| .&#8217;| _| _|_ -|\\n&quot;;<br \/>   echo &quot;|___|___|_|_|_| |__,|___|_| |___|\\n&quot;;<br \/>   echo \u00ab\u041d\u0430\u0434\u0451\u0436\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432\u0430\u0448\u0438\u0445 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432\\n\u00bb;<br \/>   \/\/ \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430<br \/>   switch ($argv[1]) {<br \/>   case &#8216;view&#8217;:<br \/>   $do = new action();<br \/>   $do-&gt;view();<br \/>   break;<br \/>   case &#8216;edit&#8217;:<br \/>   if (isset($argv[2])) {<br \/>   $do = new action();<br \/>   $do -&gt;edit($argv[2]);<br \/>   }<br \/>   echo \u00ab\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0441\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \\n\u00bb;<br \/>   break;<br \/>   case &#8216;add&#8217;:<br \/>   $do = new action();<br \/>   $do -&gt;add();<br \/>   break;<br \/>   case &#8216;delete&#8217;:<br \/>   if (isset($argv[2])) {<br \/>   $do = new action();<br \/>   $do -&gt;delete($argv[2]);<br \/>   }<br \/>   echo \u00ab\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0441\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \\n\u00bb;<br \/>   break;<br \/>   case &#8216;help&#8217;:<br \/>   $do = new action();<br \/>   $do -&gt;help();<br \/>   break;<\/p>\n<p>  default:<br \/>   \/\/ \u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u0438\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442, \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435<br \/>   echo \u00ab\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0441\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \\n\u00bb;<br \/>   break;<br \/>   }<br \/>   echo &quot;\\n&quot;;  <\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/277689\/\"> https:\/\/habrahabr.ru\/post\/277689\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0444\u043e\u0440\u0443\u043c\u043e\u0432 \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e php \u2014 \u044d\u0442\u043e \u044f\u0437\u044b\u043a \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0414\u0430, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0441\u0430\u0439\u0442\u043e\u0432 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0434\u0430\u0436\u0435 \u0432\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u044e) \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 php, \u043d\u043e \u044d\u0442\u043e\u0442 \u044f\u0437\u044b\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0432\u0435\u0431\u0430.<br \/>  \u0421\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 php, \u043d\u0430 \u043b\u044e\u0434\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0437\u043d\u0430\u044e\u0442, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u0433\u0443\u0440\u0443-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0438\u0441\u0442\u0430\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 php.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-274708","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=274708"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274708\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=274708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=274708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=274708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}