File Name ↓ | File Size ↓ | Date ↓ |
---|---|---|
Parent directory/ | - | - |
eSystem-0.2.tgz | 6.3 KiB | 2005-Jul-11 14:59 |
eSystem-0.3.tgz | 6.3 KiB | 2005-Sep-06 13:55 |
eSystem-0.4.tgz | 6.4 KiB | 2006-Sep-15 04:23 |
eSystem-0.5.tgz | 7.1 KiB | 2007-Feb-19 03:30 |
eSystem-0.6.tgz | 8.1 KiB | 2007-Mar-04 01:27 |
eSystem-0.7.tgz | 8.2 KiB | 2007-Mar-18 02:34 |
eSystem-0.8.tgz | 8.4 KiB | 2009-Jul-07 22:43 |
eSystem-1.0.0.tgz | 6.8 KiB | 2009-Aug-08 18:03 |
eSystem-1.0.1.tgz | 6.8 KiB | 2011-May-12 19:00 |
eSystem-1.0.2.tgz | 7.4 KiB | 2016-Jan-07 06:03 |
sha256sum | 826 B | 2016-Jan-07 06:08 |
eSystem 클리스는 php에서 제공하는 system funcion보다 확장된 기능을 제공하며, 많은 system mapping function을 제공한다.
<?php require_once ('eSystem.php'); $e = new eSystem; /* * GETOPT test */ echo "\n"; echo "-- Getopt Test -------------------------------------------\n\n"; # init getopt global variables $longopt = array ( 'longa' => 'a', 'longb' => 'b', 'longc' => 'c', 'longd' => 'd' ); while ( ($opt = $e->getopt ($argc, $argv, "abc:d")) != -1 ) : switch ($opt) : case 'a' : $a++; break; case 'b' : $b++; break; case 'c' : $c = $optarg; break; case 'd' : $d++; break; default: echo "getopt failed. option is abc:d ($opt)\n"; exit (1); endswitch; endwhile; echo "Option a => $a\n"; echo "Option b => $b\n"; echo "Option c => $c\n"; echo "Option a => $d\n"; echo "Optcno => $optcno\n"; echo "Optcmd array:\n"; print_r ($optcmd); echo "\n"; echo "-- _system test ------------------------------------------\n\n"; /* * _system test */ $v = $e->system ("ls -al", $r); echo "Last Line: $v\n"; unset ($v); /* * _exec test */ echo "\n"; echo "-- _exec test --------------------------------------------\n\n"; $v = $e->exec ("ls -al", $o, $err); print_r ($o); echo "Last Line : $v\n"; echo "ERROR CODE: $err\n"; /* * mkdirp_p test */ echo "\n"; echo "-- mkdir_p test ------------------------------------------\n\n"; $v = $e->mkdir_p ("./ppp/yyy"); echo "mkdir_p test: "; if ( $v === true ) { if ( is_dir ("./ppp/yyy") ) echo "OK"; else echo "Fail"; $v = 'true'; } else { $v = ( $v === false ) ? 'false' : $v; } echo " ==> Return Code: $v\n"; /* * unlink test */ echo "\n"; echo "-- unlink test ------------------------------------------\n\n"; touch ("unlinktest"); $v = $e->unlink ("unlinktests"); $v = ( $v === true ) ? 'true' : ($v === false) ? 'false' : $v; echo "Unlink unlinktests: $v\n"; $v = $e->unlink ("unlinktest"); $v = ( $v === true ) ? 'true' : ($v === false) ? 'false' : $v; echo "Unlink unlinktest: $v\n"; $v = $e->unlink ("ppp/yyy"); $v = ( $v === true ) ? 'true' : ($v === false) ? 'false' : $v; echo "Unlink ppp/yyy: $v\n"; /* * unlink_r test */ echo "\n"; echo "-- unlink_R test ------------------------------------------\n\n"; $v = $e->unlink_r ("ppp"); $v = ( $v === true ) ? 'true' : 'false'; echo "Remove ppp: $v\n"; /* * tree test */ echo "\n"; echo "-- tree test ----------------------------------------------\n\n"; $v = $e->tree ("."); print_r ($v); /* * find test */ echo "\n"; echo "-- find test ----------------------------------------------\n\n"; $v = $e->find ("."); #, '', false); print_r ($v); /* * color test */ echo "\n"; echo "-- color test ---------------------------------------------\n\n"; echo $e->putColor ('Color test red', 'red') . "\n"; /* * backspace test */ echo "\n"; echo "-- backspace test ---------------------------------------------\n\n"; echo "print abcdefghijklmn and backspace 3 times\n"; echo "abcdefghijklmn\n"; echo "abcdefghijklmn"; $e->backSpace (3); echo "\n"; /* * man test */ echo "\n"; echo "-- man test ---------------------------------------------------\n\n"; echo "bash man path:\n"; print_r ($e->manPath ('bash')); echo "view bash man page\n"; echo $e->man ('free', 1); ?>Installation:
이 패키지는 다른 패키지에 의존성이 있습니다. 그러므로 아래의 pear 명령을 이용하여 설치하는 것을 권장 합니다.
shell> pear channel-discover pear.oops.org shell> pear install oops/eSystem shell> pear list -a