File tree Expand file tree Collapse file tree 3 files changed +6
-16
lines changed Expand file tree Collapse file tree 3 files changed +6
-16
lines changed Original file line number Diff line number Diff line change 66PHP CLI (command-line interface) argurments parser. PHP-Argv can parse rich pattern, such as the follows
77
88## Install by composer  
9- make your composer.json file
109``` javascript 
11- {
12-     " require" :  {
13-         " samejack/php-argv" :  " dev-master" 
14-     }
15- }
16- ``` 
17- run composer command
18- ``` 
19- composer install 
10+ composer require samejack/ php- argv
2011``` 
2112
13+ 
2214## CLI Example  
2315``` 
2416$ ./example/bin-cli -h 127.0.0.1 -u=user -p passwd --debug --max-size=3 test 
3628## PHP Example  
3729``` php 
3830<?php
39- include_once (__DIR__ . '/../src/PHP/ArgvParser .php');
31+ require_once (__DIR__ . '/vendor/autoload .php');
4032
4133$argvParser = new \samejack\PHP\ArgvParser();
4234
Original file line number Diff line number Diff line change 22
33namespace  samejack \PHP ;
44
5- class  PHP_ArgvParser 
5+ class  ArgvParser 
66{
77    const  MAX_ARGV  = 1000 ;
88
Original file line number Diff line number Diff line change 22
33namespace  samejack \PHP ;
44
5- use  samejack \PHP \ArgvParser ;
6- 
75class  ArgvParserTest extends  \PHPUnit_Framework_TestCase
86{
97
108    public  function  testSingleArgument ()
119    {
12-         $ argvParsernew  PHP_ArgvParser ();
10+         $ argvParsernew  ArgvParser ();
1311
1412        $ string'--ok ' ;
1513        $ result$ argvParserparseConfigs ($ string
@@ -18,7 +16,7 @@ public function testSingleArgument()
1816
1917    public  function  testParseConfigs ()
2018    {
21-         $ argvParsernew  PHP_ArgvParser ();
19+         $ argvParsernew  ArgvParser ();
2220
2321        $ string'-h 127.0.0.1 -u=user -p passwd --debug --max-size=3 test ' ;
2422
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments