Changeset 737

Show
Ignore:
Timestamp:
07/23/08 10:17:04 (1 month ago)
Author:
starkraving2002
Message:

code debugging

Location:
phpframework/branches/dev
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • phpframework/branches/dev/fusebox5.php

    r733 r737  
    3636        } 
    3737} 
     38 
     39function isPHP5() { return true; } 
    3840 
    3941/* FB5: allow "" default - FB41 required this variable: */ 
     
    163165                        /* can't be conditional: we don't know the state of the debug flag yet */ 
    164166                        $myFusebox->trace("Fusebox","Creating Fusebox application object"); 
    165                         require_once(fuseboxApplication.php); 
     167                        require_once("fuseboxApplication.php"); 
    166168                        $_fba = new FuseboxApplication(); 
    167169                        $application["FUSEBOX_APPLICATION_KEY"] = $_fba->init($FUSEBOX_APPLICATION_KEY,$FUSEBOX_APPLICATION_PATH,$FUSEBOX_APPLICATION_NAME,$myFusebox,$FUSEBOX_CALLER_PATH,$FUSEBOX_PARAMETERS); 
  • phpframework/branches/dev/fuseboxApplication.php

    r733 r737  
    451451                } 
    452452                 
    453                 $circuit = substr($circuitFuseaction,0,0-strlen($fuseaction)); 
     453                $circuit = substr($circuitFuseaction,0,0-strlen($fuseaction)-1); 
    454454 
    455455                /* set up myFusebox values for this request: */ 
     
    595595                        $result['parsedFile'] = $parsedFile; 
    596596                } else { 
    597                         $result['parsedFile'] = $this->getCoreToAppRootPath() . $parsedFile; 
     597                        $result['parsedFile'] = $result['parsedFile'] = $this->getWebRootPathToappRoot().$parsedFile; 
    598598                } 
    599599                $result['lockName'] = $fullParsedFile; 
     
    733733                        $result['parsedFile'] = $parsedFile; 
    734734                } else { 
    735                         $result['parsedFile'] = $this->getCoreToAppRootPath() . $parsedFile; 
     735                        $result['parsedFile'] = $this->getWebRootPathToappRoot().$parsedFile; 
    736736                } 
    737737                $result['lockName'] = $fullParsedFile; 
     
    746746                        $circuit, //I am the circuit name. I am required but it's faster to specify that I am not required. 
    747747                        $fuseaction, //I am the fuseaction name, within the specified circuit. 
    748                         $topLevel //I specify whether or not this is a top-level (public) request. 
     748                        $topLevel = false //I specify whether or not this is a top-level (public) request. 
    749749                ) { 
    750750                if ( isset($GLOBALS['attributes']['fusebox.debug']) && $GLOBALS['attributes']['fusebox.debug'] == 'true' ) echo '<ul><li>Starting $'.__CLASS__.'->'.__FUNCTION__.'()'; 
    751751                // if ( array_key_exists('home',$GLOBALS['application']['fusebox']->circuits) ) echo "<br />".get_class($this).'.compile start: '.$GLOBALS['_fba']->circuits['home']->alias; 
    752752                $c = ""; 
    753                 if ( !array_key_exists($circuit,$writer->fuseboxApplication->circuits) ) { 
     753                if ( !array_key_exists($circuit,$this->circuits) ) { 
    754754                        if ( $this->allowImplicitCircuits ) { 
    755755                                /* FB55: attempt to create an implicit circuit */ 
     
    780780         
    781781                $c = $writer->setCircuit($circuit); 
    782                 $writer->fuseboxApplication->circuits[$circuit]->compile($writer,$fuseaction,$topLevel); 
     782                $this->circuits[$circuit]->compile($writer,$fuseaction,$topLevel); 
    783783                $writer->setCircuit($c); 
    784784                // if ( array_key_exists('home',$GLOBALS['application']['fusebox']->circuits) ) echo "<br />".get_class($this).'.compile end: '.$GLOBALS['_fba']->circuits['home']->alias; 
     
    14091409                $trailingSlash = ( substr($resolvedPath,-1,1) == "/" ); 
    14101410                $segment = ""; 
    1411                 $j = 1; 
     1411                $j = 0; 
    14121412                $n = 0; 
    14131413                $pathParts = array(); 
    14141414                $delimiter = ""; 
    1415                 if ( substr($resolvedPath,-1,1) == '/' ) { $resolvedPath = substr($resolvedPath,-1); } 
    14161415                $arResolvedPath = explode('/',$resolvedPath); 
    14171416 
    14181417                /* remove pairs of directory/../ */              
    1419                 for ( $s = 0 ; $s < count($arResolvedPath) ; $s++ ) { 
     1418                foreach ( array_keys($arResolvedPath) as $s ) { 
    14201419                        $segment = $arResolvedPath[$s]; 
    1421                         if ( $segment == "." ) { 
     1420                        if ( $segment == "." || $segment == "" ) { 
    14221421                                /* just ignore this */ 
    14231422                        } else if ( $segment == ".." ) { 
    1424                                 if ( $j > 1 && $pathParts[$j-1] != ".." ) { 
     1423                                if ( $j > 0 && $pathParts[$j-1] != ".." ) { 
    14251424                                        $j = $j - 1; 
    14261425                                } else { 
     
    14331432                        } 
    14341433                } 
    1435                  
    14361434                /* rebuild the path */ 
    14371435                if ( leadingSlash ) { 
     
    14391437                } 
    14401438                $resolvedPath = ""; 
     1439                /* // this block of code isn't working properly 
    14411440                $n = $j - 1; 
    14421441                for ( $j = 0 ; $j < $n ; $j++ ) { 
     
    14441443                        $delimiter = "/"; 
    14451444                } 
     1445                // using the next line instead for now 
     1446                */ 
     1447                $resolvedPath = $delimiter . implode("/",$pathParts); 
    14461448                if ( $trailingSlash ) { 
    14471449                        $resolvedPath .= "/"; 
  • phpframework/branches/dev/fuseboxCircuit.php

    r733 r737  
    6868                } else { 
    6969                        if ( $this->relative ) { 
    70                                 $this->fullPath = $this->appPath & $this->relativePath; 
     70                                $this->fullPath = $this->appPath . $this->relativePath; 
    7171                        } else { 
    7272                                __cfthrow(array('type'=>"fusebox.badGrammar.illegalPath" 
     
    7777                 
    7878                $this->fullPath = $this->fuseboxApplication->getCanonicalPath($this->fullPath); 
    79  
     79                 
    8080                /* 
    8181                        this was not correctly normalized prior to ticket 139 but it didn't really matter 
     
    445445                                        )); 
    446446                                } 
    447                                 $attributes[attr] = $this->fuseboxApplication->normalizePartialPath($attributes[$attr]); 
     447                                $attributes[$attr] = $this->fuseboxApplication->normalizePartialPath($attributes[$attr]); 
    448448                                if ( substr($attributes[$attr],0,1) == "/" ) { 
    449449                                        /* assume mapped / root-relative path */ 
     
    481481                                __cfthrow(array( 'type'=>"fusebox.badGrammar.unexpectedAttributes", 
    482482                                        'message'=>"Unexpected attributes", 
    483                                         'detail'=>"Unexpected attributes were found in the 'circuit' tag of the '".$this->getAlias()."' circuit.xml file." 
     483                                        'detail'=>"Unexpected attribute '".$attr."' were found in the 'circuit' tag of the '".$this->getAlias()."' circuit.xml file." 
    484484                                )); 
    485485                        } 
     
    638638                        } 
    639639                        require_once("fuseboxAction.php"); 
    640                         if ( !isPHP5() ) { eval('$this->fuseactions[$attribs["name"]] =& new FuseboxAction($this,$attribs["name"],$access,$children[$i]["xmlChildren"],false,$customAttribs);'); } else { $this->fuseactions[$attribs['name']] = new FuseboxAction($this,$attribs['name'],$access,$children[$i]['xmlChildren'],false,$customAttribs); } 
     640                        $this->fuseactions[$attribs['name']] = new FuseboxAction($this,$attribs['name'],$access,$children[$i]['xmlChildren'],false,$customAttribs); 
    641641                        /* FB41 security plugin compatibility: */ 
    642642                        $this->fuseactions[$attribs['name']]->permissions = $permissions; 
  • phpframework/branches/dev/fuseboxDoFuseaction.php

    r722 r737  
    148148                $n = 0; 
    149149                $myFB =& $writer->getMyFusebox(); 
    150                 $app =& $writer->fuseboxApplication; 
     150                $app =& $this->action->getCircuit()->getApplication(); 
    151151                $plugins =& $app->pluginPhases; 
    152152                $c = ""; 
  • phpframework/branches/dev/fuseboxFactory.php

    r733 r737  
    7777                        /* must be namespace.verb or namespace:verb */ 
    7878                        require_once("fuseboxVerb.php"); 
    79                         if ( !isPHP5() ) { eval('$verbObject =& new FuseboxVerb($action, $verb, $attributes, $children);'); } else { $verbObject = new FuseboxVerb($action, $verb, $attributes, $children); } 
     79                        $verbObject = new FuseboxVerb($action, $verb, $attributes, $children); 
    8080                } elseif ( in_array($verb,array("do","fuseaction")) ) { 
    8181                        /* built-in verbs that cannot be implemented as a lexicon */ 
     
    8585                        /* builtin verb implemented as a lexicon */ 
    8686                        require_once("fuseboxVerb.php"); 
    87                         if ( !isPHP5() ) {  
    88                                 eval('$verbObject =& new FuseboxVerb($action, $this->fuseboxLexicon["namespace"] . ":" . $verb,$attributes, $children);');  
    89                         } else {  
    90                                 $verbObject = new FuseboxVerb($action, $this->fuseboxLexicon['namespace'] . ":" . $verb, 
     87                        $verbObject = new FuseboxVerb($action, $this->fuseboxLexicon['namespace'] . ":" . $verb, 
    9188                                                        $attributes, $children);  
    92                         } 
    9389                } 
    9490                if ( isset($GLOBALS['attributes']['fusebox.debug']) && $GLOBALS['attributes']['fusebox.debug'] == 'true' ) echo '</li><li>Ending $'.__CLASS__.'->'.__FUNCTION__.'()</li></ul>'; 
     
    10197                if ( !is_object($this->lexCompPool) ) { 
    10298                        require_once("fuseboxLexiconCompiler.php"); 
    103                         if ( !isPHP5() ) { eval('$obj =& new FuseboxLexiconCompiler();'); } else { $obj = new FuseboxLexiconCompiler(); } 
     99                        $obj = new FuseboxLexiconCompiler(); 
    104100                } else { 
    105101                        $obj =& $this->lexCompPool; 
  • phpframework/branches/dev/fuseboxLexiconCompiler.php

    r726 r737  
    6464                } 
    6565                if ( $this->fb_['verbInfo']['executionMode'] == "end" ) { 
    66                         if ( !$this->compiled && ( 
    67                                         array_key_exists('fuseactionException',$this->fb_writer->fuseboxApplication->pluginPhases) || 
    68                                         array_key_exists('processError',$this->fb_writer->fuseboxApplication->pluginPhases)  
    69                                         ) && 
    70                                         $this->fb_writer->fuseboxApplication->scriptVersion{0} != '5' ) { 
    71                                 $this->fb_writer->rawPrintln("if ( \$php_errormsg ) break;"); 
    72                         } 
    7366                        $this->compiled = true; 
    7467                }