Changeset 142

User picture

Author: Thiago Mata

(2009/06/29 05:00) Over 2 years ago

the code instrumentation receiver it is using the new match elements created recently

Affected files

Updated components/_start.php Download diff

141142
3
3
4
Loader::requireOnce( COMPONENTS_PATH . "_start.php" );
4
Loader::requireOnce( COMPONENTS_PATH . "_start.php" );
5
Loader::requireOnce( COMPONENTS_PATH . "library/_start.php" );
5
Loader::requireOnce( COMPONENTS_PATH . "library/_start.php" );
6
Loader::requireOnce( COMPONENTS_PATH . "match/_start.php" );
6
Loader::requireOnce( COMPONENTS_PATH . "umlSequenceDiagram/_start.php" );
7
Loader::requireOnce( COMPONENTS_PATH . "umlSequenceDiagram/_start.php" );
7
//Loader::requireOnce( COMPONENTS_PATH . "backtrace/_start.php" );
8
//Loader::requireOnce( COMPONENTS_PATH . "backtrace/_start.php" );
8
Loader::requireOnce( COMPONENTS_PATH . "extendedReflection/_start.php" );
9
Loader::requireOnce( COMPONENTS_PATH . "extendedReflection/_start.php" );

Updated components/codeInstrumentation/CodeInstrumentationReceiver.class.php Download diff

141142
83
    protected $arrMessages = array();
83
    protected $arrMessages = array();
84
84
85
    /**
85
    /**
86
     * Array with the name of the classes what should NOT enter into the diagram
86
     * Gate keeper of the classes into the diagram
87
     * 
88
     * If this array is empty, no class will be ignored to the diagram
89
     * 
90
     * @var String[]
91
     */
92
    protected $arrIgnoredClasses = array();
93
    
94
    /**
95
     * Array with the name of the exclusive classes what should be into the diagram
96
     * 
97
     * If this array is empty, any class can enter into the diagram.
98
     * 
99
     * @var String[]
100
     */
101
    protected $arrExclusiveClasses = array();
102
    
103
    /**
104
     * Array with the name of the methods what should NOT enter into the diagram
105
     *
87
     *
106
     * If this array is empty, no methods will be ignored to the diagram
88
     * @var MatchGatekeeper
107
     * The value can be just the "<method name>" or "<class name>::<method name>",
108
     * in this last case just in the informed class the method it is considered
109
     *
110
     * @var String[]
111
     */
89
     */
112
    protected $arrIgnoredMethods = array();
90
    protected $objGatekeeperClasses;
113
91
114
    /**
92
    /**
115
     * Array with the Regex of the methods what should NOT enter into the diagram
93
     * Gate keeper of the methods into the diagram
116
     *
94
     *
117
     * If this array is empty, no methods will be ignored to the diagram
95
     * @var MatchGatekeeper
118
     * The value can be any regular expression what will be match with the
119
     * "<method name>" or "<class name>::<method name>",
120
     *
121
     * @var String[]
122
     */
96
     */
123
    protected $arrIgnoredMethodsRegex = array();
97
    protected $objGatekeeperMethods;
124
98
125
    /**
99
    /**
126
     * Array with the exclusive methods name what should be into the diagram
127
     *
128
     * If this array is empty, any method can enter into the diagram.
129
     * The value can be just the "<method name>" or "<class name>::<method name>",
130
     * in this last case just in the informed class the method it is considered
131
     *
132
     * @var String[]
133
     */
134
    protected $arrExclusiveMethods = array();
135
136
    /**
137
     * Array with the exclusive methods regex what should be into the diagram
138
     *
139
     * If this array is empty, any method can enter into the diagram.
140
     * The value can be any regular expression what will be match with
141
     * the "<method name>" or "<class name>::<method name>"
142
     *
143
     * @var String[]
144
     */
145
    protected $arrExclusiveMethodsRegex = array();
146
147
    /**
148
     * Object of the uml sequence diagram what will be feed into the execution
100
     * Object of the uml sequence diagram what will be feed into the execution
149
     * 
101
     * 
150
     * @var UmlSequenceDiagram
102
     * @var UmlSequenceDiagram
...
...
238
    }
190
    }
239
191
240
    /**
192
    /**
241
     * Set the array with the ignored class into the diagram
193
     * Set the gate keeper to the classes into the diagram
242
     *
243
     * @see CodeInstrumentationReceiver->arrIgnoredClasses
244
     * @see CodeInstrumentationReceiver::getIgnoredClasses()
245
     * @param String[] $arrIgnoredClasses
246
     * @return CodeInstrumentationReceiver me
247
     */
248
    public function setIgnoredClasses( array $arrIgnoredClasses )
249
    {
250
    	$this->arrIgnoredClasses = $arrIgnoredClasses;
251
    	return $this;
252
    }
253
254
    /**
255
     * get the array with the ignored class into the diagram
256
     *
257
     * @see CodeInstrumentationReceiver->arrIgnoredClasses
258
     * @see CodeInstrumentationReceiver::setIgnoredClasses( String[] )
259
     * @see CodeInstrumentationReceiver::getIgnoredClasses()
260
     * @return String[] $arrIgnoredClasses
261
     */    
262
    public function getIgnoredClasses()
263
    {
264
    	return $this->arrIgnoredClasses;
265
    }
266
    
267
    /**
268
     * Add a class name into the ignored class list
269
     * 
194
     * 
270
     * @see CodeInstrumentationReceiver->arrIgnoredClasses
195
     * @param MatchGatekeeper $objGatekeeperClasses
271
     * @see CodeInstrumentationReceiver::setIgnoredClasses( String[] )
272
     * @param string $strIgnoredClass
273
     * @return CodeInstrumentationReceiver me
274
     */
196
     */
275
    public function addIgnoredClass( $strIgnoredClass )
197
    public function setGatekeeperClasses( MatchGatekeeper $objGatekeeperClasses )
276
    {
198
    {
277
    	$this->arrIgnoredClasses[] = $strIgnoredClass;
199
        $this->objGatekeeperClasses = $objGatekeeperClasses;
278
    	return $this;
279
    }    
280
    
281
    /**
282
     * Set the array with the exclusive class into the diagram
283
     *
284
     * @see CodeInstrumentationReceiver->arrExclusiveClasses
285
     * @see CodeInstrumentationReceiver::getExclusiveClasses()
286
     * @param String[] $arrExclusiveClasses
287
     * @return CodeInstrumentationReceiver me
288
     */
289
    public function setExclusiveClasses( $arrExclusiveClasses )
290
    {
291
    	$this->arrExclusiveClasses = $arrExclusiveClasses;
292
    	return $this;
293
    }
200
    }
294
    
295
    /**
296
     * get the array with the exclusive class into the diagram
297
     *
298
     * @see CodeInstrumentationReceiver->arrExclusiveClasses
299
     * @see CodeInstrumentationReceiver::setExclusiveClasses( String[] )
300
     * @return String[] $arrExclusiveClasses
301
     */    
302
    public function getExclusiveClasses()
303
    {
304
    	return $this->arrExclusiveClasses;
305
    }
306
       
307
    /**
308
     * Add a class name into the exclusive class list
309
     * 
310
     * @see CodeInstrumentationReceiver->arrExclusiveClasses
311
     * @see CodeInstrumentationReceiver::setExclusiveClasses( String[] )
312
     * @see CodeInstrumentationReceiver::getExclusiveClasses()
313
     * @param string $strExclusiveClass
314
     * @return CodeInstrumentationReceiver me
315
     */
316
    public function addExclusiveClass( $strExclusiveClass )
317
    {
318
    	$this->arrExclusiveClasses[] = $strExclusiveClass;
319
    	return $this;
320
    }
321
    
322
    /**
323
     * Set the array with the exclusive methods into the diagram
324
     *
325
     * @see CodeInstrumentationReceiver->arrExclusiveMethods
326
     * @see CodeInstrumentationReceiver::getExclusiveMethods()
327
     * @param String[] $arrExclusiveMethods
328
     * @return CodeInstrumentationReceiver me
329
     */
330
    public function setExclusiveMethods( $arrExclusiveMethods )
331
    {
332
    	$this->arrExclusiveMethods = $arrExclusiveMethods;
333
    	return $this;
334
    }
335
201
336
    /**
202
    /**
337
     * get the array with the exclusive method into the diagram
203
     * Get the gate keeper to the classes into the diagram
338
     *
204
     *
339
     * @see CodeInstrumentationReceiver->arrExclusiveMethods
205
     * @return MatchGatekeeper
340
     * @see CodeInstrumentationReceiver::setExclusiveMethods( String[] )
341
     * @return String[] $arrExclusiveMethods
342
     */
206
     */
343
    public function getExclusiveMethods()
207
    public function getGatekeeperClasses()
344
    {
208
    {
345
    	return $this->arrExclusiveMethods;
209
        return $this->objGatekeeperClasses;
346
    }
210
    }
347
211
348
    /**
212
    /**
349
     * Add a class method into the exclusive method list
213
     * Set the gate keeper to the classes into the method
350
     *
214
     *
351
     * @see CodeInstrumentationReceiver->arrExclusiveMethods
215
     * @param MatchGatekeeper $objGatekeeperMethods
352
     * @see CodeInstrumentationReceiver::setExclusiveMethods( String[] )
353
     * @see CodeInstrumentationReceiver::getExclusiveMethod()
354
     * @param string $strExclusiveMethod
355
     * @return CodeInstrumentationReceiver me
356
     */
216
     */
357
    public function addExclusiveMethod( $strExclusiveMethod )
217
    public function setGatekeeperMethods( MatchGatekeeper $objGatekeeperMethods )
358
    {
218
    {
359
    	$this->arrExclusiveMethods[] = $strExclusiveMethod;
219
        $this->objGatekeeperMethods = $objGatekeeperMethods;
360
    	return $this;
361
    }
220
    }
362
221
363
364
    /**
222
    /**
365
     * Set the array with the regular expression of the
223
     * Get the gate keeper to the classes into the method
366
     * exclusive methods into the diagram
367
     *
224
     *
368
     * @see CodeInstrumentationReceiver->arrExclusiveMethodsRegex
225
     * @return MatchGatekeeper $objGatekeeperMethods
369
     * @see CodeInstrumentationReceiver::getExclusiveMethodsRegex()
370
     * @param String[] $arrExclusiveMethodsRegex
371
     * @return CodeInstrumentationReceiver me
372
     */
226
     */
373
    public function setExclusiveMethodsRegex( $arrExclusiveMethodsRegex )
227
    public function getGatekeeperMethods()
374
    {
228
    {
375
    	$this->arrExclusiveMethodsRegex = $arrExclusiveMethodsRegex;
229
        return $this->objGatekeeperMethods;
376
    	return $this;
377
    }
230
    }
378
231
379
    /**
232
    /**
380
     * get the array with the regular expressions of the
381
     * exclusive method into the diagram
382
     *
383
     * @see CodeInstrumentationReceiver->arrExclusiveMethodsRegex
384
     * @see CodeInstrumentationReceiver::setExclusiveMethodsRegex( String[] )
385
     * @return String[] $arrExclusiveMethodsRegex
386
     */
387
    public function getExclusiveMethodsRegex()
388
    {
389
    	return $this->arrExclusiveMethodsRegex;
390
    }
391
392
    /**
393
     * Add a regular expression into the
394
     * exclusive method regular expression list
395
     *
396
     * @see CodeInstrumentationReceiver->arrExclusiveMethodsRegex
397
     * @see CodeInstrumentationReceiver::setExclusiveMethodsRegex( String[] )
398
     * @see CodeInstrumentationReceiver::getExclusiveMethodRegex()
399
     * @param string $strExclusiveMethodRegex
400
     * @return CodeInstrumentationReceiver me
401
     */
402
    public function addExclusiveMethodRegex( $strExclusiveMethodRegex )
403
    {
404
    	$this->arrExclusiveMethodsRegex[] = $strExclusiveMethodRegex;
405
    	return $this;
406
    }
407
408
409
    /**
410
     * Set the array with the ignored methods list into the diagram
411
     *
412
     * @see CodeInstrumentationReceiver->arrIgnoredMethods
413
     * @see CodeInstrumentationReceiver::getIgnoredMethods()
414
     * @param String[] $arrIgnoredMethods
415
     * @return CodeInstrumentationReceiver me
416
     */
417
    public function setIgnoredMethods( array $arrIgnoredMethods )
418
    {
419
    	$this->arrIgnoredMethods = $arrIgnoredMethods;
420
    	return $this;
421
    }
422
423
    /**
424
     * get the array with the ignored methods into the diagram
425
     *
426
     * @see CodeInstrumentationReceiver->arrIgnoredMethods
427
     * @see CodeInstrumentationReceiver::setIgnoredMethods( String[] )
428
     * @see CodeInstrumentationReceiver::getIgnoredMethods()
429
     * @return String[] $arrIgnoredMethods
430
     */    
431
    public function getIgnoredMethods()
432
    {
433
    	return $this->arrIgnoredMethods;
434
    }
435
    
436
    /**
437
     * Add a class method into the ignored methods list
438
     * 
439
     * @see CodeInstrumentationReceiver->arrIgnoredMethods
440
     * @see CodeInstrumentationReceiver::setIgnoredMethods( String[] )
441
     * @param string $strIgnoredMethod
442
     * @return CodeInstrumentationReceiver me
443
     */
444
    public function addIgnoredMethod( $strIgnoredMethod )
445
    {
446
    	$this->arrIgnoredMethods[] = $strIgnoredMethod;
447
    	return $this;
448
    }    
449
    
450
    /**
451
     * Set the array with the ignored regular expressions
452
     * methods list into the diagram
453
     *
454
     * @see CodeInstrumentationReceiver->arrIgnoredMethodsRegex
455
     * @see CodeInstrumentationReceiver::getIgnoredMethodsRegex()
456
     * @param String[] $arrIgnoredMethodsRegex
457
     * @return CodeInstrumentationReceiver me
458
     */
459
    public function setIgnoredMethodsRegex( array $arrIgnoredMethodsRegex )
460
    {
461
    	$this->arrIgnoredMethodsRegex = $arrIgnoredMethodsRegex;
462
    	return $this;
463
    }
464
465
    /**
466
     * get the array with the ignored methods regex list of the diagram
467
     *
468
     * @see CodeInstrumentationReceiver->arrIgnoredMethodsRegex
469
     * @see CodeInstrumentationReceiver::setIgnoredMethodsRegex( String[] )
470
     * @see CodeInstrumentationReceiver::getIgnoredMethodsRegex()
471
     * @return String[] $arrIgnoredMethodsRegex
472
     */
473
    public function getIgnoredMethodsRegex()
474
    {
475
    	return $this->arrIgnoredMethodsRegex;
476
    }
477
478
    /**
479
     * Add a regex into the ignored methods regex list
480
     *
481
     * @see CodeInstrumentationReceiver->arrIgnoredMethodsRegex
482
     * @see CodeInstrumentationReceiver::setIgnoredMethodsRegex( String[] )
483
     * @param string $strIgnoredMethodRegex
484
     * @return CodeInstrumentationReceiver me
485
     */
486
    public function addIgnoredMethodRegex( $strIgnoredMethodRegex )
487
    {
488
    	$this->arrIgnoredMethodsRegex[] = $strIgnoredMethodRegex;
489
    	return $this;
490
    }
491
492
    /**
493
     * prepare the code instrumentation receiver to start to receive the informations about
233
     * prepare the code instrumentation receiver to start to receive the informations about
494
     * the execution.
234
     * the execution.
495
     * 
235
     * 
496
     * 1. create the uml sequence diagram object
236
     * @plan{
497
     * 2. create the user actor
237
     * <ol>
238
     *     <li> create the internal objects </li>
239
     *     <li> create the uml sequence diagram object </li>
240
     *     <li> create the user actor </li>
241
     * </ol>
242
     * }
498
     * 
243
     * 
499
     * @return null
244
     * @return null
500
     */
245
     */
501
    public function __construct()
246
    public function __construct()
502
    {
247
    {
503
    	// 1. create the uml sequence diagram object //
248
        // create the internal objects //
249
        $objGatekeeperClasses = new MatchGatekeeper();
250
        $this->setGatekeeperClasses( $objGatekeeperClasses );
251
252
        $objGatekeeperMethods = new MatchGatekeeper();
253
        $this->setGatekeeperMethods( $objGatekeeperMethods );
254
255
    	// create the uml sequence diagram object //
504
        $this->objUmlSequence = new UmlSequenceDiagram();
256
        $this->objUmlSequence = new UmlSequenceDiagram();
505
257
506
        // 2. create the user actor //	
258
        // create the user actor //	
507
        $objActorFrom = new UmlSequenceDiagramActor();
259
        $objActorFrom = new UmlSequenceDiagramActor();
508
        $objActorFrom->setType( 'user' );
260
        $objActorFrom->setType( 'user' );
509
        $objActorFrom->setName( "user" );
261
        $objActorFrom->setName( "user" );
...
...
531
    /**
283
    /**
532
     * Rename the method to which they are in accordance
284
     * Rename the method to which they are in accordance
533
     * with the standarts of the diagram
285
     * with the standarts of the diagram
534
     * 
286
     *
535
     * 1. if __construct replace by <<create>>
287
     * @plan{
536
     * 2. if __destruct replace by <<destroy>>
288
     * <ol>
537
     * 3. other cases should append the "()"
289
     *     <li> if __construct replace by &gt;&gt;create&lt;&lt; </li>
538
     * 
290
     *     <li> if __destruct replace by &gt;&gt;destroy&lt;&lt; </li>
291
     *     <li> other cases should append the "()" </li>
292
     * </ol>
293
     * }
294
     *
539
     * @param string $strMethod old method name
295
     * @param string $strMethod old method name
540
     * @return string new method name
296
     * @return string new method name
541
     */
297
     */
...
...
574
    }
330
    }
575
331
576
    /**
332
    /**
577
     * Return if the class should be ignored
578
     *
579
     * @param String $strClass
580
     */
581
    protected function isIgnoredClass( $strClass )
582
    {
583
    	// returns if it is into ignore list
584
        if(
585
            ( count( $this->getIgnoredClasses() ) > 0 )
586
             and
587
             ( in_array( $strClass , $this->getIgnoredClasses() ) )
588
           )
589
        {
590
            return true;
591
        }
592
593
        // returns if it is not into the exclusive class
594
        if(
595
            ( count( $this->getExclusiveClasses() ) > 0 )
596
             and
597
             ( !in_array( $strClass , $this->getExclusiveClasses() ) )
598
           )
599
        {
600
            return true;
601
        }
602
603
        return false;
604
    }
605
606
    protected function isIgnoredMethod( $strClass , $strMethod )
607
    {
608
        $strFullName = $strClass . '::' . $strMethod;
609
        
610
        // returns if it is into ignore list
611
        if(
612
            ( count( $this->getIgnoredMethods() ) > 0 )
613
             and
614
             (
615
             	( in_array( $strMethod , $this->getIgnoredMethods() ) )
616
             	||
617
             	( in_array( $strFullName , $this->getIgnoredMethods() ) )
618
             )
619
          )
620
        {
621
            return true;
622
        }
623
624
        // returns if it is not into the exclusive list
625
        if(
626
            ( count( $this->getExclusiveMethods() ) > 0 )
627
             and
628
             (
629
             	( ! in_array( $strMethod , $this->getExclusiveMethods() ) )
630
             	&&
631
             	( ! in_array( $strFullName , $this->getExclusiveMethods() ) )
632
             )
633
          )
634
        {
635
            return true;
636
        }
637
638
        // exists a ignore methods regular expression list //
639
        if( count( $this->getIgnoredMethodsRegex() ) > 0 )
640
        {
641
            foreach( $this->getIgnoredMethodsRegex() as $strRegex )
642
            {
643
                if( ereg( $strRegex , $strMethod ) || ereg( $strRegex , $strFullName ) )
644
                {
645
                    // and the method match into //
646
                    return true;
647
                }
648
            }
649
        }
650
651
        // exists a exclusive methods regular expression list //
652
        if( count( $this->getExclusiveMethodsRegex() ) > 0 )
653
        {
654
            foreach( $this->getExclusiveMethodsRegex() as $strRegex )
655
            {
656
                if( ereg( $strRegex , $strMethod ) || ereg( $strRegex , $strFullName ) )
657
                {
658
                    // and the method match into //
659
                    return false;
660
                }
661
            }
662
            // and the method not match into //
663
            return true;
664
        }
665
666
        // not reasons was founded to ignore this class //
667
        return false;
668
    }
669
670
    /**
671
     * Check if the method should be loged into the uml sequence diagram
333
     * Check if the method should be loged into the uml sequence diagram
672
     * 
334
     * 
673
     * @param String $strClass
335
     * @param String $strClass
...
...
676
     */
338
     */
677
    protected function shouldBeLog( $strClass , $strMethod )
339
    protected function shouldBeLog( $strClass , $strMethod )
678
    {
340
    {
679
    	// returns if is a ignored class
341
        if( $this->getGatekeeperClasses()->match( $strClass ) == false )
680
        if( $this->isIgnoredClass( $strClass ) )
681
        {
342
        {
682
            return false;
343
            return false;
683
        }
344
        }
684
345
685
        // returns of it is a ignored method
346
        // returns of it is a ignored method
686
        if( $this->isIgnoredMethod( $strClass , $strMethod ) )
347
        if( $this->getGatekeeperMethods()->match( $strMethod ) == false )
687
        {
348
        {
688
            return false;
349
            return false;
689
        }
350
        }
...
...
695
     * Receive a message of enter into some method and append it as a uml sequence diagram message
356
     * Receive a message of enter into some method and append it as a uml sequence diagram message
696
     * into the uml sequence diagram object, creating if necessary the uml sequence diagram actor
357
     * into the uml sequence diagram object, creating if necessary the uml sequence diagram actor
697
     * 
358
     * 
698
     * 1. get the name of method as the diagram standart
359
     * @plan{
699
     * 2. get the namespace name
360
     * <ol>
700
     * 3. get the actor what the message is bring from 
361
     *     <li> get the name of method as the diagram standart </li>
701
     * 4. get the actor what the message is bring to
362
     *     <li> get the namespace name </li>
702
     * 4.1 create the actor to if he not exists
363
     *     <li> get the actor what the message is bring from </li>
703
     * 5. create the message
364
     *     <li> get the actor what the message is bring to
704
     * 5.1 set the message attributes
365
     *          <ol>
705
     * 5.2 set the message values
366
     *              <li> create the actor to if he not exists </li>
706
     * 6. append the message 
367
     *          </ol>
368
     *     </li>
369
     *     <li> create the message
370
     *          <ol>
371
     *              <li> set the message attributes </li>
372
     *              <li> set the message values </li>
373
     *          </ol>
374
     *     </li>
375
     *     <li> append the message </li>
376
     * </ol>
377
     * }
707
     * 
378
     * 
708
     * @param string $uid
379
     * @param string $uid
709
     * @param string $strClassDefinition
380
     * @param string $strClassDefinition
...
...
713
     */
384
     */
714
    public function onEnterMethod( $uid , $strClassDefinition , $strMethod, $arrArguments )
385
    public function onEnterMethod( $uid , $strClassDefinition , $strMethod, $arrArguments )
715
    {
386
    {
716
    	// 1. get the name of method as the diagram standart //
387
    	// get the name of method as the diagram standart //
717
        $strClass 		= CorujaClassManipulation::getClassNameFromClassDefinition( $strClassDefinition );
388
        $strClass 		= CorujaClassManipulation::getClassNameFromClassDefinition( $strClassDefinition );
718
        $arrMethod      = explode( "::" , $strMethod );
389
        $arrMethod      = explode( "::" , $strMethod );
719
        $strRealMethod 	= array_pop( $arrMethod );
390
        $strRealMethod 	= array_pop( $arrMethod );
720
        $strMethod      = $this->renameMethod( $strRealMethod , $strClass);
391
        $strMethod      = $this->renameMethod( $strRealMethod , $strClass);
721
392
722
        // 2. get the namespace name //
393
        // get the namespace name //
723
        $strNamespace 	= CorujaClassManipulation::getNamespaceFromClassDefinition( $strClassDefinition );
394
        $strNamespace 	= CorujaClassManipulation::getNamespaceFromClassDefinition( $strClassDefinition );
724
395
725
        if( ! array_key_exists( $strClass, $this->arrClasses ) )
396
        if( ! array_key_exists( $strClass, $this->arrClasses ) )
...
...
738
        	return $this;
409
        	return $this;
739
        }
410
        }
740
        
411
        
741
        // 3. get the actor what the message is bring from  //
412
        // get the actor what the message is bring from  //
742
        $objActorFrom = current( $this->arrStack );
413
        $objActorFrom = current( $this->arrStack );
743
        if( $objActorFrom  === false )
414
        if( $objActorFrom  === false )
744
        {
415
        {
745
            return $this;
416
            return $this;
746
        }
417
        }
747
418
748
        // 4. get the actor what the message is bring to //
419
        // get the actor what the message is bring to //
749
        if( ! array_key_exists( $uid , $this->arrActors ) )
420
        if( ! array_key_exists( $uid , $this->arrActors ) )
750
        {
421
        {
751
        	// 4.1 create the actor to if he not exists //
422
        	// create the actor to if he not exists //
752
            $this->arrClasses[ $strClass ]++;
423
            $this->arrClasses[ $strClass ]++;
753
            $objActorTo = new UmlSequenceDiagramActor();
424
            $objActorTo = new UmlSequenceDiagramActor();
754
            $objActorTo->setType( 'system' );
425
            $objActorTo->setType( 'system' );
...
...
776
        
447
        
777
        if( !$this->getIgnoreRecursiveCalls() || ( $objActorFrom != $objActorTo ) )
448
        if( !$this->getIgnoreRecursiveCalls() || ( $objActorFrom != $objActorTo ) )
778
        {
449
        {
779
            // 5. create the message //
450
            // create the message //
780
            $objMessage = new UmlSequenceDiagramMessage();
451
            $objMessage = new UmlSequenceDiagramMessage();
781
452
782
            // 5.1 set the message attributes //
453
            // set the message attributes //
783
            $objMessage->setMethod( $strRealMethod );
454
            $objMessage->setMethod( $strRealMethod );
784
            $objMessage->setText( $strMethod );
455
            $objMessage->setText( $strMethod );
785
            $objMessage->setActorFrom( $objActorFrom );
456
            $objMessage->setActorFrom( $objActorFrom );
...
...
790
            $objReflectedMethod = $objReflectedClass->getMethod( $strRealMethod );
461
            $objReflectedMethod = $objReflectedClass->getMethod( $strRealMethod );
791
            $arrReflectedParameter = $objReflectedMethod->getParameters();
462
            $arrReflectedParameter = $objReflectedMethod->getParameters();
792
463
793
            // 5.2 set the message values //
464
            // set the message values //
794
            foreach( $arrArguments as $intPos => $mixValue )
465
            foreach( $arrArguments as $intPos => $mixValue )
795
            {
466
            {
796
                $objValue = new UmlSequenceDiagramValue();
467
                $objValue = new UmlSequenceDiagramValue();
...
...
802
            }
473
            }
803
            $objMessage->setTimeStart( microtime( true ) );
474
            $objMessage->setTimeStart( microtime( true ) );
804
475
805
            // 6. append the message  //
476
            // append the message  //
806
            $this->objUmlSequence->addMessage( $objMessage );
477
            $this->objUmlSequence->addMessage( $objMessage );
807
            $this->arrMessages[] 	= $objMessage;
478
            $this->arrMessages[] 	= $objMessage;
808
        }
479
        }
...
...
813
484
814
    /**
485
    /**
815
     * Receive the message of leave some method and append it message into the uml sequence diagram object
486
     * Receive the message of leave some method and append it message into the uml sequence diagram object
487
     *
488
     * @plan{
489
     * <ol>
490
     *     <li> get the name of method as the diagram standart </li>
491
     *     <li> get the namespace name </li>
492
     *     <li> get the actor what the message is bring from </li>
493
     *     <li> get the actor what the message is bring to </li>
494
     *     <li>
495
     *         create the message
496
     *         <ol>
497
     *             <li> set the message attributes </li>
498
     *             <li> set the message values </li>
499
     *         </ol>
500
     *     </li>
501
     *     <li> append the message </li>
502
     * </ol>
503
     * }
816
     * 
504
     * 
817
     * 1. get the name of method as the diagram standart
818
     * 2. get the namespace name
819
     * 3. get the actor what the message is bring from 
820
     * 4. get the actor what the message is bring to
821
     * 5. create the message
822
     * 5.1 set the message attributes
823
     * 5.2 set the message values
824
     * 6. append the message 
825
     * 
826
     * @param integer $uid
505
     * @param integer $uid
827
     * @param string $strClassDefinition
506
     * @param string $strClassDefinition
828
     * @param string $strMethod
507
     * @param string $strMethod
...
...
831
     */
510
     */
832
    public function onLeaveMethod( $uid , $strClassDefinition, $strMethod, $mixReturn )
511
    public function onLeaveMethod( $uid , $strClassDefinition, $strMethod, $mixReturn )
833
    {
512
    {
834
    	// 1. get the name of method as the diagram standart //
513
    	// get the name of method as the diagram standart //
835
        $strClass 		= CorujaClassManipulation::getClassNameFromClassDefinition( $strClassDefinition );
514
        $strClass 		= CorujaClassManipulation::getClassNameFromClassDefinition( $strClassDefinition );
836
        $arrMethod      = explode( "::" , $strMethod );
515
        $arrMethod      = explode( "::" , $strMethod );
837
        $strRealMethod	= array_pop( $arrMethod );
516
        $strRealMethod	= array_pop( $arrMethod );
838
        $strMethod      = $this->renameMethod( $strRealMethod , $strClass );
517
        $strMethod      = $this->renameMethod( $strRealMethod , $strClass );
839
518
840
        // 2. get the namespace name //
519
        // get the namespace name //
841
        $strNamespace 	= CorujaClassManipulation::getNamespaceFromClassDefinition( $strClassDefinition );
520
        $strNamespace 	= CorujaClassManipulation::getNamespaceFromClassDefinition( $strClassDefinition );
842
521
843
            if( ! $this->shouldBeLog( $strClass , $strRealMethod ) )
522
            if( ! $this->shouldBeLog( $strClass , $strRealMethod ) )
...
...
845
        	return $this;
524
        	return $this;
846
        }
525
        }
847
                
526
                
848
        // 3. get the actor what the message is bring from //
527
        // get the actor what the message is bring from //
849
        $objActorFrom = array_shift( $this->arrStack );
528
        $objActorFrom = array_shift( $this->arrStack );
850
        
529
        
851
        // 4. get the actor what the message is bring to //
530
        // get the actor what the message is bring to //
852
        $objActorTo = current( $this->arrStack );
531
        $objActorTo = current( $this->arrStack );
853
532
854
        $boolCreateMessage = true;
533
        $boolCreateMessage = true;
...
...
865
544
866
        if( $boolCreateMessage )
545
        if( $boolCreateMessage )
867
        {
546
        {
868
        	// 5. create the message //
547
        	// create the message //
869
            $objMessage = new UmlSequenceDiagramMessage();
548
            $objMessage = new UmlSequenceDiagramMessage();
870
            
549
            
871
            // 5.1 set the message attributes //
550
            // set the message attributes //
872
            $objMessage->setMethod( $strRealMethod );
551
            $objMessage->setMethod( $strRealMethod );
873
            $objMessage->setText( $strMethod );
552
            $objMessage->setText( $strMethod );
874
            $objMessage->setActorFrom( $objActorFrom );
553
            $objMessage->setActorFrom( $objActorFrom );
875
            $objMessage->setActorTo( $objActorTo );
554
            $objMessage->setActorTo( $objActorTo );
876
            $objMessage->setType( 'return' );
555
            $objMessage->setType( 'return' );
877
556
878
            // 5.2 set the message values //
557
            // set the message values //
879
            if( $mixReturn !== null )
558
            if( $mixReturn !== null )
880
            {
559
            {
881
                $objValue = new UmlSequenceDiagramValue();
560
                $objValue = new UmlSequenceDiagramValue();
...
...
884
                $objMessage->addValue( $objValue );
563
                $objMessage->addValue( $objValue );
885
            }
564
            }
886
565
887
            // 6. append the message  //
566
            // append the message  //
888
            $this->objUmlSequence->addMessage( $objMessage );
567
            $this->objUmlSequence->addMessage( $objMessage );
889
            $objMessage->setTimeEnd( microtime( true ) );
568
            $objMessage->setTimeEnd( microtime( true ) );
890
        }
569
        }
...
...
920
    /**
599
    /**
921
     * Clean the attributes of the uml sequence diagram existing
600
     * Clean the attributes of the uml sequence diagram existing
922
     * 
601
     * 
923
     * 1. clean actors
602
     * <ol>
924
     * 2. clean classes
603
     *     <li> clean actors </li>
925
     * 3. clean messages
604
     *     <li> clean classes </li>
926
     * 4. clean stack
605
     *     <li> clean messages </li>
927
     * 5. clean object uml sequence diagram
606
     *     <li> clean stack </li>
928
     * 6. restart the receiver
607
     *     <li> clean object uml sequence diagram </li>
608
     *     <li> restart the receiver </li>
609
     * </ol>
929
     * 
610
     * 
930
     * @return CodeInstrumentationReceiver
611
     * @return CodeInstrumentationReceiver
931
     */
612
     */
932
    public function restart()
613
    public function restart()
933
    {
614
    {
934
    	// 1. clean actors //
615
    	// clean actors //
935
        $this->arrActors = array();
616
        $this->arrActors = array();
936
        // 2. clean classes //
617
        // clean classes //
937
        $this->arrClasses = array();
618
        $this->arrClasses = array();
938
        // 3. clean messages //
619
        // clean messages //
939
        $this->arrMessages = array();
620
        $this->arrMessages = array();
940
        // 4. clean stack //
621
        // clean stack //
941
        $this->arrStack = array();
622
        $this->arrStack = array();
942
        // 5. clean object uml sequence diagram //
623
        // clean object uml sequence diagram //
943
        $this->objUmlSequence->restart();
624
        $this->objUmlSequence->restart();
944
        // 6. restart the receiver //
625
        // restart the receiver //
945
        $this->__construct();
626
        $this->__construct();
946
        return $this;
627
        return $this;
947
    }
628
    }

Updated components/codeToDiagram/CodeToDiagram.class.php Download diff

141142
249
	}
249
	}
250
250
251
	/**
251
	/**
252
	 * Set the ignored classes of the diagram
252
	 * Set the gate keeper classes
253
	 *
253
	 *
254
	 * @see CodeToDiagram::getIgnoredClasses()
254
	 * @see CodeToDiagram::getGatekeeperClasses()
255
	 * @see CodeInstrumentationReceiver::setIgnoredClasses( String[] )
255
	 * @see CodeInstrumentationReceiver::setGatekeeperClasses( MatchGatekeeper )
256
	 * @param String[] $arrIgnoredClasses
256
	 * @param MatchGatekeeper $objGatekeeperClasses
257
	 * @return CodeToDiagram me
257
	 * @return CodeToDiagram me
258
	 */
258
	 */
259
	public function setIgnoredClasses( array $arrIgnoredClasses )
259
	public function setGatekeeperClasses( MatchGatekeeper $objGatekeeperClasses )
260
	{
260
	{
261
		CodeInstrumentationReceiver::getInstance()->setIgnoredClasses( $arrIgnoredClasses );
261
        CodeInstrumentationReceiver::getInstance()->setGatekeeperClasses( $objGatekeeperClasses );
262
		return $this;
262
		return $this;
263
	 }
263
	 }
264
264
265
	 /**
265
	 /**
266
	  * Get the ignored classes of the diagram
266
	  * Get the gate keeper classes
267
	  *
267
	  *
268
	  * @see CodeToDiagram::setIgnoredClasses( String[] )
268
	  * @see CodeToDiagram::setGatekeeperClasses( MatchGatekeeper )
269
	  * @see CodeInstrumentationReceiver::getIgnoredClasses()
269
	  * @see CodeInstrumentationReceiver::setGatekeeperClasses()
270
	  * @return String[] $arrIgnoredClasses
270
	  * @return MatchGatekeeper
271
	  */
271
	  */
272
	 public function getIgnoredClasses()
272
	 public function getGatekeeperClasses()
273
	 {
273
	 {
274
		 return CodeInstrumentationReceiver::getInstance()->getIgnoredClasses();
274
		 return CodeInstrumentationReceiver::getInstance()->getGatekeeperClasses();
275
	 }
275
	 }
276
276
277
	/**
278
	 * Add some ignored classes into the ignore classes diagram list
279
	 *
280
	 * @see CodeToDiagram::setIgnoredClasses( String[] )
281
	 * @see CodeToDiagram::getIgnoredClasses()
282
	 * @see CodeInstrumentationReceiver::setIgnoredClasses( String[] )
283
	 * @see CodeInstrumentationReceiver::getIgnoredClasses()
284
	 * @param String $strIgnoredClasses
285
	 * @return CodeToDiagram me
286
	 */
287
	public function addIgnoredClass( $strIgnoredClass )
288
	{
289
		CodeInstrumentationReceiver::getInstance()->addIgnoredClass( $strIgnoredClass );
290
		return $this;
291
	 }
292
293
	/**
294
	 * Set the ignored methods of the diagram
295
	 *
296
	 * @see CodeToDiagram::getIgnoredMethods()
297
	 * @see CodeInstrumentationReceiver::setIgnoredMethods( String[] )
298
	 * @param String[] $arrIgnoredMethods
299
	 * @return CodeToDiagram me
300
	 */
301
	public function setIgnoredMethods( array $arrIgnoredMethods )
302
	{
303
		CodeInstrumentationReceiver::getInstance()->setIgnoredMethods( $arrIgnoredMethods );
304
		return $this;
305
	 }
306
307
	 /**
277
	 /**
308
	  * Get the ignored methods of the diagram
278
	  * Get the gate keeper methods
309
	  *
279
	  *
310
	  * @see CodeToDiagram::setIgnoredMethods( String[] )
280
	  * @see CodeToDiagram::setGatekeeperMethods( MatchGatekeeper )
311
	  * @see CodeInstrumentationReceiver::getIgnoredMethods()
281
	  * @see CodeInstrumentationReceiver::getGatekeeperMethods()
312
	  * @return String[] $arrIgnoredMethods
282
	  * @return MatchGatekeeper
313
	  */
283
	  */
314
	 public function getIgnoredMethods()
284
	 public function getGatekeeperMethods()
315
	 {
285
	 {
316
		 return CodeInstrumentationReceiver::getInstance()->getIgnoredMethods();
286
         return CodeInstrumentationReceiver::getInstance()->getGatekeeperMethods();
317
	 }
287
	 }
318
288
319
	/**
320
	 * Add some ignored methods into the ignore methods diagram list
321
	 *
322
	 * @see CodeToDiagram::setIgnoredMethods( String[] )
323
	 * @see CodeToDiagram::getIgnoredMethods()
324
	 * @see CodeInstrumentationReceiver::setIgnoredMethods( String[] )
325
	 * @see CodeInstrumentationReceiver::getIgnoredMethods()
326
	 * @param String $strIgnoredMethods
327
	 * @return CodeToDiagram me
328
	 */
329
	public function addIgnoredMethod( $strIgnoredMethod )
330
	{
331
		CodeInstrumentationReceiver::getInstance()->addIgnoredMethod( $strIgnoredMethod );
332
		return $this;
333
	}
334
335
	/**
336
	 * Set the ignored methods Regex of the diagram
337
	 *
338
	 * @see CodeToDiagram::getIgnoredMethodsRegex()
339
	 * @see CodeInstrumentationReceiver::setIgnoredMethodsRegex( String[] )
340
	 * @param String[] $arrIgnoredMethodsRegex
341
	 * @return CodeToDiagram me
342
	 */
343
	public function setIgnoredMethodsRegex( array $arrIgnoredMethodsRegex )
344
	{
345
		CodeInstrumentationReceiver::getInstance()->setIgnoredMethodsRegex( $arrIgnoredMethodsRegex );
346
		return $this;
347
	 }
348
349
	 /**
289
	 /**
350
	  * Get the ignored methods Regex of the diagram
290
	  * Set the gate keeper methods
351
	  *
291
	  *
352
	  * @see CodeToDiagram::setIgnoredMethodsRegex( String[] )
292
	  * @see CodeToDiagram::getGatekeeperMethods()
353
	  * @see CodeInstrumentationReceiver::getIgnoredMethodsRegex()
293
	  * @see CodeInstrumentationReceiver::setGatekeeperMethods( MatchGatekeeper )
354
	  * @return String[] $arrIgnoredMethodsRegex
294
	  * @param MatchGatekeeper $objGatekeeperMethods
295
	  * @return CodeToDiagram me
355
	  */
296
	  */
356
	 public function getIgnoredMethodsRegex()
297
	 public function setGatekeeperMethods( MatchGatekeeper $objGatekeeperMethods )
357
	 {
298
 	 {
358
		 return CodeInstrumentationReceiver::getInstance()->getIgnoredMethodsRegex();
299
        CodeInstrumentationReceiver::getInstance()->setGatekeeperMethods( $objGatekeeperMethods );
359
	 }
360
361
	/**
362
	 * Add some ignored methods Regex into the ignore methods diagram list
363
	 *
364
	 * @see CodeToDiagram::setIgnoredMethodsRegex( String[] )
365
	 * @see CodeToDiagram::getIgnoredMethodsRegex()
366
	 * @see CodeInstrumentationReceiver::setIgnoredMethodsRegex( String[] )
367
	 * @see CodeInstrumentationReceiver::getIgnoredMethodsRegex()
368
	 * @param String $strIgnoredMethodsRegex
369
	 * @return CodeToDiagram me
370
	 */
371
	public function addIgnoredMethodRegex( $strIgnoredMethodRegex )
372
	{
373
		CodeInstrumentationReceiver::getInstance()->addIgnoredMethodRegex( $strIgnoredMethodRegex );
374
		return $this;
300
		return $this;
375
	}
376
377
	 /**
378
	 * Set the exclusive classes of the diagram
379
	 *
380
	 * @see CodeToDiagram::setExclusiveClasses( String[] )
381
	 * @see CodeInstrumentationReceiver::setExclusiveClasses( String[] )
382
	 * @param String[] $arrExclusiveClasses
383
	 * @return CodeToDiagram me
384
	 */
385
	public function setExclusiveClasses( array $arrExclusiveClasses )
386
	{
387
		CodeInstrumentationReceiver::getInstance()->setExclusiveClasses( $arrExclusiveClasses );
388
		return $this;
389
	 }
301
	 }
390
302
391
	 /**
303
	 /**
392
	  * Get the exclusive classes of the diagram
393
	  *
394
	  * @see CodeToDiagram::setExclusiveClasses( String[] )
395
	  * @see CodeInstrumentationReceiver::getExclusiveClasses()
396
	  * @return String[] $arrExclusiveClasses
397
	  */
398
	 public function getExclusiveClasses()
399
	 {
400
		 return CodeInstrumentationReceiver::getInstance()->getExclusiveClasses();
401
	 }
402
403
	/**
404
	 * Add some exclusive classes into the exclusive classes diagram list
405
	 *
406
	 * @see CodeToDiagram::setExclusiveClasses( String[] )
407
	 * @see CodeToDiagram::getExclusiveClasses()
408
	 * @see CodeInstrumentationReceiver::setExclusiveClasses( String[] )
409
	 * @see CodeInstrumentationReceiver::getExclusiveClasses()
410
	 * @param String $strExclusiveClass
411
	 * @return CodeToDiagram me
412
	 */
413
	public function addExclusiveClass( $strExclusiveClass )
414
	{
415
		CodeInstrumentationReceiver::getInstance()->addExclusiveClass( $strExclusiveClass );
416
		return $this;
417
	 }
418
419
420
	 /**
421
	 * Set the exclusive methods of the diagram
422
	 *
423
	 * @see CodeToDiagram::setExclusiveMethods( String[] )
424
	 * @see CodeInstrumentationReceiver::setExclusiveMethods( String[] )
425
	 * @param String[] $arrExclusiveMethods
426
	 * @return CodeToDiagram me
427
	 */
428
	public function setExclusiveMethods( array $arrExclusiveMethods )
429
	{
430
		CodeInstrumentationReceiver::getInstance()->setExclusiveMethods( $arrExclusiveMethods );
431
		return $this;
432
	 }
433
434
	 /**
435
	  * Get the exclusive methods of the diagram
436
	  *
437
	  * @see CodeToDiagram::setExclusiveMethods( String[] )
438
	  * @see CodeInstrumentationReceiver::getExclusiveMethods()
439
	  * @return String[] $arrExclusiveMethods
440
	  */
441
	 public function getExclusiveMethods()
442
	 {
443
		 return CodeInstrumentationReceiver::getInstance()->getExclusiveMethods();
444
	 }
445
446
	/**
447
	 * Add some exclusive methods into the exclusive methods diagram list
448
	 *
449
	 * @see CodeToDiagram::setExclusiveMethods( String[] )
450
	 * @see CodeToDiagram::getExclusiveMethods()
451
	 * @see CodeInstrumentationReceiver::setExclusiveMethods( String[] )
452
	 * @see CodeInstrumentationReceiver::getExclusiveMethods()
453
	 * @param String $strExclusiveMethod
454
	 * @return CodeToDiagram me
455
	 */
456
	public function addExclusiveMethod( $strExclusiveMethod )
457
	{
458
		CodeInstrumentationReceiver::getInstance()->addExclusiveMethod( $strExclusiveMethod );
459
		return $this;
460
	 }
461
462
	 /**
463
	 * Set the exclusive methods Regex of the diagram
464
	 *
465
	 * @see CodeToDiagram::setExclusiveMethodsRegex( String[] )
466
	 * @see CodeInstrumentationReceiver::setExclusiveMethodsRegex( String[] )
467
	 * @param String[] $arrExclusiveMethodsRegex
468
	 * @return CodeToDiagram me
469
	 */
470
	public function setExclusiveMethodsRegex( array $arrExclusiveMethodsRegex )
471
	{
472
		CodeInstrumentationReceiver::getInstance()->setExclusiveMethodsRegex( $arrExclusiveMethodsRegex );
473
		return $this;
474
	 }
475
476
	 /**
477
	  * Get the exclusive methods Regex of the diagram
478
	  *
479
	  * @see CodeToDiagram::setExclusiveMethodsRegex( String[] )
480
	  * @see CodeInstrumentationReceiver::getExclusiveMethodsRegex()
481
	  * @return String[] $arrExclusiveMethodsRegex
482
	  */
483
	 public function getExclusiveMethodsRegex()
484
	 {
485
		 return CodeInstrumentationReceiver::getInstance()->getExclusiveMethodsRegex();
486
	 }
487
488
	/**
489
	 * Add some exclusive methods Regex into the exclusive methods diagram list
490
	 *
491
	 * @see CodeToDiagram::setExclusiveMethodsRegex( String[] )
492
	 * @see CodeToDiagram::getExclusiveMethodsRegex()
493
	 * @see CodeInstrumentationReceiver::setExclusiveMethodsRegex( String[] )
494
	 * @see CodeInstrumentationReceiver::getExclusiveMethodsRegex()
495
	 * @param String $strExclusiveMethodRegex
496
	 * @return CodeToDiagram me
497
	 */
498
	public function addExclusiveMethodRegex( $strExclusiveMethodRegex )
499
	{
500
		CodeInstrumentationReceiver::getInstance()->addExclusiveMethodRegex( $strExclusiveMethodRegex );
501
		return $this;
502
	 }
503
504
	 /**
505
	 * Set the output type of the diagram.;
304
	 * Set the output type of the diagram.;
506
	 *
305
	 *
507
	 * The output type it is how the class should deal with the result of the printer
306
	 * The output type it is how the class should deal with the result of the printer

Updated components/match/_start.php Download diff

141142
15
	Loader::requireOnce( "MatchName.class.php" , true );
15
	Loader::requireOnce( "MatchName.class.php" , true );
16
    Loader::requireOnce( "MatchRegularExpression.class.php" , true );
16
    Loader::requireOnce( "MatchRegularExpression.class.php" , true );
17
    Loader::requireOnce( "MatchGroup.class.php" , true );
17
    Loader::requireOnce( "MatchGroup.class.php" , true );
18
    Loader::requireOnce( "MatchGateOpener.class.php" , true );
18
    Loader::requireOnce( "MatchGatekeeper.class.php" , true );
19
}
19
}
20
else
20
else
21
{
21
{
...
...
24
    require_once( "MatchName.class.php" );
24
    require_once( "MatchName.class.php" );
25
    require_once( "MatchRegularExpression.class.php" );
25
    require_once( "MatchRegularExpression.class.php" );
26
    require_once( "MatchGroup.class.php" );
26
    require_once( "MatchGroup.class.php" );
27
    require_once( "MatchGateOpener.class.php" );
27
    require_once( "MatchGatekeeper.class.php" );
28
}
28
}
29
?>
29
?>

Updated components/match/MatchGatekeeper.class.php Download diff

141142
1
<?php
1
<?php
2
/**
2
/**
3
 * MatchGateKeeper - Gate opener make a match using white list and black list.
3
 * MatchGatekeeper - Gate opener make a match using white list and black list.
4
 * @package Match
4
 * @package Match
5
 */
5
 */
6
6
...
...
12
 * and black list, with the forbiden names.
12
 * and black list, with the forbiden names.
13
 *
13
 *
14
 * @example{
14
 * @example{
15
 *   $objMatch = new MatchGateKeeper();
15
 *   $objMatch = new MatchGatekeeper();
16
 *   $objMatch->getAllowedMatch()->addItemName( "just" );
16
 *   $objMatch->getAllowedMatch()->addItemName( "just" );
17
 *   $objMatch->getAllowedMatch()->addItemName( "us" );
17
 *   $objMatch->getAllowedMatch()->addItemName( "us" );
18
 * 	 if ( $objMatch->match( "other" ) !== false ) return false;
18
 * 	 if ( $objMatch->match( "other" ) !== false ) return false;
...
...
20
 * }
20
 * }
21
 *
21
 *
22
 * @example{
22
 * @example{
23
 *   $objMatch = new MatchGateKeeper();
23
 *   $objMatch = new MatchGatekeeper();
24
 *   $objMatch->getForbiddenMatch()->addItemRegularExpression( "^set*" );
24
 *   $objMatch->getForbiddenMatch()->addItemRegularExpression( "^set*" );
25
 *   $objMatch->getForbiddenMatch()->addItemRegularExpression( "^get*" );
25
 *   $objMatch->getForbiddenMatch()->addItemRegularExpression( "^get*" );
26
 *   $objMatch->getForbiddenMatch()->addItemName( "play" );
26
 *   $objMatch->getForbiddenMatch()->addItemName( "play" );
...
...
32
 * }
32
 * }
33
 *
33
 *
34
 */
34
 */
35
class MatchGateKeeper implements MatchInterface
35
class MatchGatekeeper implements MatchInterface
36
{
36
{
37
    /**
37
    /**
38
     * Match Group of the Forbidden List
38
     * Match Group of the Forbidden List
...
...
75
     * set the forbiden list match
75
     * set the forbiden list match
76
     *
76
     *
77
     * @param Match $objForbidenMatch
77
     * @param Match $objForbidenMatch
78
     * @return MatchGateKeeper me
78
     * @return MatchGatekeeper me
79
     */
79
     */
80
    public function setForbidenMatch( Match $objForbidenMatch )
80
    public function setForbidenMatch( Match $objForbidenMatch )
81
    {
81
    {
...
...
97
     * Set the allowed list match
97
     * Set the allowed list match
98
     *
98
     *
99
     * @param Match $objAllowedMatch
99
     * @param Match $objAllowedMatch
100
     * @return MatchGateKeeper me
100
     * @return MatchGatekeeper me
101
     */
101
     */
102
    public function setAllowedMatch( Match $objAllowedMatch )
102
    public function setAllowedMatch( Match $objAllowedMatch )
103
    {
103
    {
...
...
120
     * not be found into any list
120
     * not be found into any list
121
     *
121
     *
122
     * @param object <value> $objValue
122
     * @param object <value> $objValue
123
     * @return MatchGateKeeper
123
     * @return MatchGatekeeper
124
     */
124
     */
125
    public function setNotFoundValue( $objValue )
125
    public function setNotFoundValue( $objValue )
126
    {
126
    {
...
...
145
     * Set the value of a name into the forbidden list
145
     * Set the value of a name into the forbidden list
146
     *
146
     *
147
     * @param object <value> $objValue
147
     * @param object <value> $objValue
148
     * @return MatchGateKeeper
148
     * @return MatchGatekeeper
149
     */
149
     */
150
    public function setDeniedValue( $objValue )
150
    public function setDeniedValue( $objValue )
151
    {
151
    {

Updated examples/Fatorial/external.php Download diff

141142
5
$arrCaller = $arrBackTrace[0];
5
$arrCaller = $arrBackTrace[0];
6
$strFileCaller = $arrCaller[ 'file' ];
6
$strFileCaller = $arrCaller[ 'file' ];
7
7
8
eval( '?>' .  file_get_contents( 'http://www.thiagomata.com/codetodiagram/public/external.php' ) );
8
eval( '?>' .  file_get_contents( 'http://www.thiagomata.com/codetodiagram/svn/public/external.php' ) );
9
CodeToDiagram::getInstance()->setExternalAcess( true );
9
CodeToDiagram::getInstance()->setExternalAcess( true );
10
CodeToDiagram::getInstance()->setCallerPathByFile( $strFileCaller );
10
CodeToDiagram::getInstance()->setCallerPathByFile( $strFileCaller );
11
CodeToDiagram::init( basename( $strFileCaller ) );
11
CodeToDiagram::init( basename( $strFileCaller ) );