- 2024/11/21
- Category :
[PR]
×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
ステップアップしていくブログです。
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
$ cd /usr/local/src/php-5.x.xx/ext/zip
$ sudo /usr/local/bin/phpize $ sudo ./configure --with-php-config=/usr/local/bin/php-config $ sudo make $ sudo make test $ sudo make install $ sudo vi /usr/local/lib/php.ini + extension=zip.so $ sudo service httpd restart $ php -i | grep zip Registered PHP Streams => compress.zlib, php, file, glob, data, http, ftp, zip, phar gzip compression => enabled bzip2 compression => disabled (install pecl/bz2) zip Libzip version => 0.10.1
$ composer require psy/psysh:@stable
$ ./vendor/psy/psysh/bin/psysh Psy Shell v0.8.0 (PHP 7.1.0 — cli) by Justin Hileman >>> help help Show a list of commands. Type `help [foo]` for information about [foo]. Aliases: ? ls List local, instance or class variables, methods and constants. Aliases: list, dir dump Dump an object or primitive. doc Read the documentation for an object, class, constant, method or property. Aliases: rtfm, man show Show the code for an object, class, constant, method or property. wtf Show the backtrace of the most recent exception. Aliases: last-exception, wtf? whereami Show where you are in the code. throw-up Throw an exception out of the Psy Shell. trace Show the current call stack. buffer Show (or clear) the contents of the code input buffer. Aliases: buf clear Clear the Psy Shell screen. history Show the Psy Shell history. Aliases: hist exit End the current session and return to caller. Aliases: quit, q >>>
>> $arr = [1,2,3]; => [ 1, 2, 3, ] >>> 1 + 2; => 3 >>> function square($x) { ... return $x*$x*$x; ... } => null >>> square(4); => 64
<?php class ClassA { private $member_variable = 'A'; public function getMemberVariable() { return $this->member_variable; } } class ClassB extends ClassA { private $member_variable = 'B'; public function getMemberVariable() { return $this->member_variable; } } class ClassC extends ClassA { private $member_variable = 'C'; } $a = new ClassA(); $b = new ClassB(); $c = new ClassC(); echo $a->getMemberVariable()."\n"; echo $b->getMemberVariable()."\n"; echo $c->getMemberVariable()."\n";
$ php test.php A B A
<?php class ClassA { protected $member_variable = 'A'; public function getMemberVariable() { return $this->member_variable; } } class ClassB extends ClassA { protected $member_variable = 'B'; public function getMemberVariable() { return $this->member_variable; } } class ClassC extends ClassA { protected $member_variable = 'C'; } $a = new ClassA(); $b = new ClassB(); $c = new ClassC(); echo $a->getMemberVariable()."\n"; echo $b->getMemberVariable()."\n"; echo $c->getMemberVariable()."\n";
$ php test.php A B C
$ ls . .. dst src $ ls src . .. a.txt b.txt c.txt $ ls dst . ..
$ rsync -avh src/ dst sending incremental file list ./ a.txt b.txt c.txt sent 226 bytes received 72 bytes 596.00 bytes/sec total size is 6 speedup is 0.02 $ ls dst . .. a.txt b.txt c.txt
$ rsync -avh src dst sending incremental file list src/ src/a.txt src/b.txt src/c.txt sent 240 bytes received 73 bytes 626.00 bytes/sec total size is 6 speedup is 0.02 $ ls dst . .. src $ ls dst/src/ . .. a.txt b.txt c.txt
ダウンロードサンプル
ダウンロードサンプル
ダウンロードサンプル