external.php
Go to the documentation of this file.00001 <?php
00016 error_reporting( E_ALL | E_NOTICE | E_PARSE );
00017 ini_set( 'display_errors', 'On' );
00018
00019 if( !isset( $strPublicPath ) )
00020 {
00021 #1. Define the public path
00022 $strPublicPath = str_replace( "\\" , "/" , str_replace( basename( __FILE__ ) , "" , __FILE__ ) );
00023
00024 #2. Load the components of the code to diagram
00025 require_once( $strPublicPath . "../components/library/CorujaFileManipulation.class.php" );
00026 require_once( $strPublicPath . "../components/loader/_start.php" );
00027
00028 Loader::getInstance()->setExternal( true );
00029 Loader::requireOnce( $strPublicPath . '../components/_start.php' );
00030
00031 #3. redefine the error handler function to the code to diagram
00032
00033 function error_handler($code, $message, $file, $line)
00034 {
00035 if (0 == error_reporting())
00036 {
00037 return;
00038 }
00039
00040 throw new CodeToDiagramException($message, 0, $code, $file, $line);
00041 }
00042
00043 #4. get the caller path
00044 $arrDebugBackTrace = debug_backtrace();
00045
00046 $strPublicPath = "http://" . $_SERVER[ "HTTP_HOST" ] . $_SERVER[ "REQUEST_URI" ];
00047 $strPublicPath = str_replace( "\\" , "/" , $strPublicPath );
00048 $strPublicPath = str_replace( basename( __FILE__ ) , "" , $strPublicPath );
00049
00050 #7. init the code to diagram
00051 print ( Loader::getInstance()->getClassContent() );
00052 print "
00053 <?php
00054 CodeToDiagram::getInstance()->setPublicPath( '$strPublicPath' );
00055 ?>";
00056 }
00057 ?>