Changeset 91
Author: Thiago Mata
(2009/05/01 19:50) Almost 3 years ago
begin of the change to make possible to use the code to diagram by a external link. still has a problem with the public external css link to be solved.
Author: Thiago Mata
(2009/05/01 19:50) Almost 3 years ago
begin of the change to make possible to use the code to diagram by a external link. still has a problem with the public external css link to be solved.
require_once( COMPONENTS_PATH . "_start.php" );Loader::requireOnce( COMPONENTS_PATH . "_start.php" );require_once( COMPONENTS_PATH . "library/_start.php" );Loader::requireOnce( COMPONENTS_PATH . "library/_start.php" );//require_once( COMPONENTS_PATH . "backtrace/_start.php" );//Loader::requireOnce( COMPONENTS_PATH . "backtrace/_start.php" );require_once( COMPONENTS_PATH . "extendedReflection/_start.php" );Loader::requireOnce( COMPONENTS_PATH . "extendedReflection/_start.php" );require_once( COMPONENTS_PATH . "codeReflection/_start.php" );Loader::requireOnce( COMPONENTS_PATH . "codeReflection/_start.php" );require_once( COMPONENTS_PATH . "codeInstrumentation/_start.php" );Loader::requireOnce( COMPONENTS_PATH . "codeInstrumentation/_start.php" );require_once( COMPONENTS_PATH . "xmlSequence/_start.php" );Loader::requireOnce( COMPONENTS_PATH . "xmlSequence/_start.php" );require_once( COMPONENTS_PATH . "codeToDiagram/_start.php" );Loader::requireOnce( COMPONENTS_PATH . "codeToDiagram/_start.php" );require_once( "Backtracephp" );Loader::requireOnce( "Backtracephp" , true );require_once( "BackTraceExplain.php" );Loader::requireOnce( "BackTraceExplain.php" , true );require_once( "CodeInstrumentationException.class.php" );Loader::requireOnce( "CodeInstrumentationException.class.php" , true );require_once( "CodeInstrumentationReceiver.class.php" );Loader::requireOnce( "CodeInstrumentationReceiver.class.php" , true );require_once( "CodeInstrumentationParameter.class.php" );Loader::requireOnce( "CodeInstrumentationParameter.class.php" , true );require_once( "CodeInstrumentationProperty.class.php" );Loader::requireOnce( "CodeInstrumentationProperty.class.php" , true );require_once( "CodeInstrumentationFunction.class.php" );Loader::requireOnce( "CodeInstrumentationFunction.class.php" , true );require_once( "CodeInstrumentationMethod.class.php" );Loader::requireOnce( "CodeInstrumentationMethod.class.php" , true );require_once( "CodeInstrumentationClass.class.php" );Loader::requireOnce( "CodeInstrumentationClass.class.php" , true );{{?>class CodeInstrumentationException extends Exception {}class CodeInstrumentationException extends Exception {}?>$this->objXmlSequence = null;$this->objXmlSequence->restart();require_once( "CodeReflectionException.class.php" );Loader::requireOnce( "CodeReflectionException.class.php" , true );require_once( "CodeReflectionFile.class.php" );Loader::requireOnce( "CodeReflectionFile.class.php" , true );require_once( "CodeReflectionParameter.class.php" );Loader::requireOnce( "CodeReflectionParameter.class.php" , true );require_once( "CodeReflectionProperty.class.php" );Loader::requireOnce( "CodeReflectionProperty.class.php" , true );require_once( "CodeReflectionFunction.class.php" );Loader::requireOnce( "CodeReflectionFunction.class.php" , true );require_once( "CodeReflectionMethod.class.php" );Loader::requireOnce( "CodeReflectionMethod.class.php" , true );require_once( "CodeReflectionClass.class.php" );Loader::requireOnce( "CodeReflectionClass.class.php" , true );' *{{require_once( "CodeToDiagramException.class.php" );Loader::requireOnce( "CodeToDiagramException.class.php" , true );require_once( "CodeToDiagram.class.php" );Loader::requireOnce( "CodeToDiagram.class.php" , true );/*** Check if a address is relative** @assert( "c:\www\temp.php" ) == false* @assert( "d:/www/temp.php" ) == false* @assert( "temp.php" ) == true* @assert( "./temp.php" ) == true* @assert( "/www/something.php" ) == false* @assert( "./www/something.php" ) == true* @assert( ".\www\something.php" ) == true* @assert( "..\www\something.php" ) == true* @assert( "..\www\something.php" ) == true**/public function isRelativePath( $strFile ){$strFile = str_replace( "\\", "/", $strFile);if(( strpos( $strFile, "./") === 0 )or( strpos( $strFile, "../") === 0 )){return true;}elseif( strpos( $strFile, "/") === false ){return true;}else{return false;}}{{if( $this->isRelativePath( $strFile ) )if( CorujaFileManipulation::isRelativePath( $strFile ) ){{}/*** Set the caller path receiving the caller file** @param string $strCallerFile*/public function setCallerPathByFile( $strCallerFile ){$this->setCallerPath( CorujaFileManipulation::getPathOfFile( $strCallerFile ) );}}?>{{require_once( "ExtendedReflectionParameter.class.php" );Loader::requireOnce( "ExtendedReflectionParameter.class.php" , true );require_once( "ExtendedReflectionProperty.class.php" );Loader::requireOnce( "ExtendedReflectionProperty.class.php" , true );require_once( "ExtendedReflectionFunction.class.php" );Loader::requireOnce( "ExtendedReflectionFunction.class.php" , true );require_once( "ExtendedReflectionMethod.class.php" );Loader::requireOnce( "ExtendedReflectionMethod.class.php" , true );require_once( "ExtendedReflectionClass.class.php" );Loader::requireOnce( "ExtendedReflectionClass.class.php" , true );require_once( "CorujaArrayManipulation.class.php" );if( class_exists( "Loader" ) )require_once( "CorujaClassManipulation.class.php" );{require_once( "CorujaStringManipulation.class.php" );Loader::requireOnce( "CorujaArrayManipulation.class.php" , true );?>Loader::requireOnce( "CorujaClassManipulation.class.php" , true );Loader::requireOnce( "CorujaStringManipulation.class.php" , true );Loader::requireOnce( "CorujaFileManipulation.class.php" , true );}else{require_once( "CorujaArrayManipulation.class.php" );require_once( "CorujaClassManipulation.class.php" );require_once( "CorujaStringManipulation.class.php" );require_once( "CorujaFileManipulation.class.php" );}?>{{}}?>{{{{/*** Returns a path to a folder relative from another folder. Both parameters* must be absolute.** - check for valid parameters* - in case paths are equal return './'* - explode parameters using '/'* - remove similar base folders* - make final address** @param String $strFileFrom Base from the path. This must be an absolute path.* @param String $strFileTo Destination of the path. This must be an absolute path.* @param Boolean $booValidPath Use false if you don't want to check for valid folders.* @throws InvalidArgumentException In case of invalid values** @example $path = CorujaStringManipulation::getRelativePath( "/www/folder/", "/www/another/big/" ); // "../another/big/"** @assert ( "/www/folder/", "/www/another/big/", false ) == "../another/big/"* @assert ( "", "" ) throws InvalidArgumentException* @assert ( "hello", "" ) throws InvalidArgumentException* @assert ( "", "hello" ) throws InvalidArgumentException* @assert ( "cool", "hello" ) throws InvalidArgumentException* @assert ( "/cool/", "hello" ) throws InvalidArgumentException* @assert ( "cool", "/hello/" ) throws InvalidArgumentException* @assert ( "/cool/", "/hello/", false ) == "../hello/"* @assert ( "/cool/", "/hello/", false ) == "../hello/"* @assert ( "/cool/", "/cool/", false ) == "./"* @assert ( "/cool/more/", "/other/", false ) == "../../other/"* @assert ( "/cool/", "/other/more/", false ) == "../other/more/"*/public static function getRelativePath( $strFileFrom, $strFileTo, $booValidPath = true ){// check for valid parameters$strFileFrom = str_replace( "\\" , "/" , $strFileFrom );$strFileTo = str_replace( "\\" , "/" , $strFileTo );if( $booValidPath&& ( ! is_dir( $strFileFrom ) || ! is_dir( $strFileTo ) )){throw new InvalidArgumentException("Invalid parameter: strFileFrom: ".$strFileFrom." strFileTo: ".$strFileTo);}// special case: equal pathsif( $strFileFrom == $strFileTo ){$strReturnPath = './';}else{// explode parameters using '/'$arrFileFrom = explode( '/', $strFileFrom );$arrFileTo = explode( '/', $strFileTo );// remove similar base folderswhile(current( $arrFileFrom ) == current( $arrFileTo )&& count( $arrFileFrom ) > 0){array_shift( $arrFileFrom );array_shift( $arrFileTo );}$arrReturnPath = array();// make final addressforeach( $arrFileFrom as $strFolder ){if( $strFolder != "" ) {$arrReturnPath[] = "..";}}foreach( $arrFileTo as $strFolder ){$arrReturnPath[] = $strFolder;}$strReturnPath = implode( '/', $arrReturnPath );}return $strReturnPath;}?>?>require_once( 'XmlSequenceException.class.php' );Loader::requireOnce( 'XmlSequenceException.class.php' , true );require_once( 'XmlSequenceFactoryInterface.interface.php' );Loader::requireOnce( 'XmlSequenceFactoryInterface.interface.php' , true );require_once( 'XmlSequencePrinterInterface.interface.php' );Loader::requireOnce( 'XmlSequencePrinterInterface.interface.php' , true );require_once( 'XmlSequenceFactoryXml.class.php' );Loader::requireOnce( 'XmlSequenceFactoryXml.class.php' , true );require_once( 'XmlSequencePrinterXml.class.php' );Loader::requireOnce( 'XmlSequencePrinterXml.class.php' , true );require_once( 'XmlSequencePrinterDiagram.class.php' );Loader::requireOnce( 'XmlSequencePrinterDiagram.class.php' , true );require_once( 'XmlSequenceActor.class.php' );Loader::requireOnce( 'XmlSequenceActor.class.php' , true );require_once( 'XmlSequenceMessage.class.php' );Loader::requireOnce( 'XmlSequenceMessage.class.php' , true );require_once( 'XmlSequenceValue.class.php' );Loader::requireOnce( 'XmlSequenceValue.class.php' , true );require_once( 'XmlSequence.class.php' );Loader::requireOnce( 'XmlSequence.class.php' , true );?>?>{{public function perform();{{{{$strPublicPath = CorujaStringManipulation::getRelativePath( $this->objXmlSequence->getCallerPath(), $this->objXmlSequence->getPublicPath() );$strPublicPath = CorujaFileManipulation::getRelativePath( $this->objXmlSequence->getCallerPath(), $this->objXmlSequence->getPublicPath() );{{{}?>?>require_once( $strPublicPath . '../components/_start.php' );require_once( $strPublicPath . "../components/library/_start.php" );require_once( $strPublicPath . "../components/loader/_start.php" );Loader::requireOnce( $strPublicPath . '../components/_start.php' );// exit();// require_once( $strPublicPath . '../components/_start.php' );$strPathFile = CorujaStringManipulation::getRelativePath( $strCallerPath , $strPublicPath );$strPathFile = CorujaFileManipulation::getRelativePath( $strCallerPath , $strPublicPath );