root/components/codeToDiagram/CodeToDiagram.class.php

8691
360
    	return $this->strPublicPath;	
360
    	return $this->strPublicPath;	
361
    }
361
    }
362
    
362
    
363
    /**
364
     * Check if a address is relative
365
     *
366
     * @assert( "c:\www\temp.php" ) == false
367
     * @assert( "d:/www/temp.php" ) == false
368
     * @assert( "temp.php" ) == true
369
     * @assert( "./temp.php" ) == true
370
     * @assert( "/www/something.php" ) == false
371
     * @assert( "./www/something.php" ) == true
372
     * @assert( ".\www\something.php" ) == true
373
     * @assert( "..\www\something.php" ) == true
374
     * @assert( "..\www\something.php" ) == true
375
     *
376
     */
377
    public function isRelativePath( $strFile )
378
    {
379
        $strFile = str_replace( "\\", "/", $strFile);
380
        if(
381
            ( strpos( $strFile, "./") === 0 )
382
            or
383
            ( strpos( $strFile, "../") === 0 )
384
         )
385
        {
386
            return true;
387
        }
388
        elseif( strpos( $strFile, "/") === false )
389
        {
390
            return true;
391
        }
392
        else
393
        {
394
            return false;
395
        }
396
   }
397
398
   /**
363
   /**
399
    * Start the log of the execution and restart if already have
364
    * Start the log of the execution and restart if already have
400
    *
365
    *
...
...
574
     * @return CodeToDiagram
539
     * @return CodeToDiagram
575
     */
540
     */
576
    public function CodeToDiagramRequireOnce( $strFileFrom, $strFile )
541
    public function CodeToDiagramRequireOnce( $strFileFrom, $strFile )
577
    {
542
    {        
578
        $arrCodeToDiagramBackTrace = debug_backtrace();
543
        $arrCodeToDiagramBackTrace = debug_backtrace();
579
544
580
        if( !$this->hasFile( $strFileFrom , $strFile ) )
545
        if( !$this->hasFile( $strFileFrom , $strFile ) )
...
...
844
        }
809
        }
845
        $this->addFile( $strFileFrom, $strFile );
810
        $this->addFile( $strFileFrom, $strFile );
846
811
847
        if( $this->isRelativePath( $strFile ) )
812
        if( CorujaFileManipulation::isRelativePath( $strFile ) )
848
        {
813
        {
849
            $strFullFile = $this->fixFileName( $strFileFrom, $strFile );
814
            $strFullFile = $this->fixFileName( $strFileFrom, $strFile );
850
        }
815
        }
...
...
864
        
829
        
865
        return $this;
830
        return $this;
866
    }
831
    }
867
}
832
833
    /**
834
     * Set the caller path receiving the caller file
835
     *
836
     * @param string $strCallerFile
837
     */
838
    public function setCallerPathByFile( $strCallerFile )
839
    {
840
        $this->setCallerPath( CorujaFileManipulation::getPathOfFile( $strCallerFile ) );
841
    }
842
}
843
844
?>