Changeset 737
- Timestamp:
- 07/23/08 10:17:04 (1 month ago)
- Location:
- phpframework/branches/dev
- Files:
-
- 6 modified
-
fusebox5.php (modified) (2 diffs)
-
fuseboxApplication.php (modified) (9 diffs)
-
fuseboxCircuit.php (modified) (5 diffs)
-
fuseboxDoFuseaction.php (modified) (1 diff)
-
fuseboxFactory.php (modified) (3 diffs)
-
fuseboxLexiconCompiler.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
phpframework/branches/dev/fusebox5.php
r733 r737 36 36 } 37 37 } 38 39 function isPHP5() { return true; } 38 40 39 41 /* FB5: allow "" default - FB41 required this variable: */ … … 163 165 /* can't be conditional: we don't know the state of the debug flag yet */ 164 166 $myFusebox->trace("Fusebox","Creating Fusebox application object"); 165 require_once( fuseboxApplication.php);167 require_once("fuseboxApplication.php"); 166 168 $_fba = new FuseboxApplication(); 167 169 $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 451 451 } 452 452 453 $circuit = substr($circuitFuseaction,0,0-strlen($fuseaction) );453 $circuit = substr($circuitFuseaction,0,0-strlen($fuseaction)-1); 454 454 455 455 /* set up myFusebox values for this request: */ … … 595 595 $result['parsedFile'] = $parsedFile; 596 596 } else { 597 $result['parsedFile'] = $ this->getCoreToAppRootPath() .$parsedFile;597 $result['parsedFile'] = $result['parsedFile'] = $this->getWebRootPathToappRoot().$parsedFile; 598 598 } 599 599 $result['lockName'] = $fullParsedFile; … … 733 733 $result['parsedFile'] = $parsedFile; 734 734 } else { 735 $result['parsedFile'] = $this->get CoreToAppRootPath() .$parsedFile;735 $result['parsedFile'] = $this->getWebRootPathToappRoot().$parsedFile; 736 736 } 737 737 $result['lockName'] = $fullParsedFile; … … 746 746 $circuit, //I am the circuit name. I am required but it's faster to specify that I am not required. 747 747 $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. 749 749 ) { 750 750 if ( isset($GLOBALS['attributes']['fusebox.debug']) && $GLOBALS['attributes']['fusebox.debug'] == 'true' ) echo '<ul><li>Starting $'.__CLASS__.'->'.__FUNCTION__.'()'; 751 751 // if ( array_key_exists('home',$GLOBALS['application']['fusebox']->circuits) ) echo "<br />".get_class($this).'.compile start: '.$GLOBALS['_fba']->circuits['home']->alias; 752 752 $c = ""; 753 if ( !array_key_exists($circuit,$ writer->fuseboxApplication->circuits) ) {753 if ( !array_key_exists($circuit,$this->circuits) ) { 754 754 if ( $this->allowImplicitCircuits ) { 755 755 /* FB55: attempt to create an implicit circuit */ … … 780 780 781 781 $c = $writer->setCircuit($circuit); 782 $ writer->fuseboxApplication->circuits[$circuit]->compile($writer,$fuseaction,$topLevel);782 $this->circuits[$circuit]->compile($writer,$fuseaction,$topLevel); 783 783 $writer->setCircuit($c); 784 784 // if ( array_key_exists('home',$GLOBALS['application']['fusebox']->circuits) ) echo "<br />".get_class($this).'.compile end: '.$GLOBALS['_fba']->circuits['home']->alias; … … 1409 1409 $trailingSlash = ( substr($resolvedPath,-1,1) == "/" ); 1410 1410 $segment = ""; 1411 $j = 1;1411 $j = 0; 1412 1412 $n = 0; 1413 1413 $pathParts = array(); 1414 1414 $delimiter = ""; 1415 if ( substr($resolvedPath,-1,1) == '/' ) { $resolvedPath = substr($resolvedPath,-1); }1416 1415 $arResolvedPath = explode('/',$resolvedPath); 1417 1416 1418 1417 /* remove pairs of directory/../ */ 1419 for ( $s = 0 ; $s < count($arResolvedPath) ; $s++) {1418 foreach ( array_keys($arResolvedPath) as $s ) { 1420 1419 $segment = $arResolvedPath[$s]; 1421 if ( $segment == "." ) {1420 if ( $segment == "." || $segment == "" ) { 1422 1421 /* just ignore this */ 1423 1422 } else if ( $segment == ".." ) { 1424 if ( $j > 1&& $pathParts[$j-1] != ".." ) {1423 if ( $j > 0 && $pathParts[$j-1] != ".." ) { 1425 1424 $j = $j - 1; 1426 1425 } else { … … 1433 1432 } 1434 1433 } 1435 1436 1434 /* rebuild the path */ 1437 1435 if ( leadingSlash ) { … … 1439 1437 } 1440 1438 $resolvedPath = ""; 1439 /* // this block of code isn't working properly 1441 1440 $n = $j - 1; 1442 1441 for ( $j = 0 ; $j < $n ; $j++ ) { … … 1444 1443 $delimiter = "/"; 1445 1444 } 1445 // using the next line instead for now 1446 */ 1447 $resolvedPath = $delimiter . implode("/",$pathParts); 1446 1448 if ( $trailingSlash ) { 1447 1449 $resolvedPath .= "/"; -
phpframework/branches/dev/fuseboxCircuit.php
r733 r737 68 68 } else { 69 69 if ( $this->relative ) { 70 $this->fullPath = $this->appPath &$this->relativePath;70 $this->fullPath = $this->appPath . $this->relativePath; 71 71 } else { 72 72 __cfthrow(array('type'=>"fusebox.badGrammar.illegalPath" … … 77 77 78 78 $this->fullPath = $this->fuseboxApplication->getCanonicalPath($this->fullPath); 79 79 80 80 /* 81 81 this was not correctly normalized prior to ticket 139 but it didn't really matter … … 445 445 )); 446 446 } 447 $attributes[ attr] = $this->fuseboxApplication->normalizePartialPath($attributes[$attr]);447 $attributes[$attr] = $this->fuseboxApplication->normalizePartialPath($attributes[$attr]); 448 448 if ( substr($attributes[$attr],0,1) == "/" ) { 449 449 /* assume mapped / root-relative path */ … … 481 481 __cfthrow(array( 'type'=>"fusebox.badGrammar.unexpectedAttributes", 482 482 'message'=>"Unexpected attributes", 483 'detail'=>"Unexpected attribute swere 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." 484 484 )); 485 485 } … … 638 638 } 639 639 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); 641 641 /* FB41 security plugin compatibility: */ 642 642 $this->fuseactions[$attribs['name']]->permissions = $permissions; -
phpframework/branches/dev/fuseboxDoFuseaction.php
r722 r737 148 148 $n = 0; 149 149 $myFB =& $writer->getMyFusebox(); 150 $app =& $ writer->fuseboxApplication;150 $app =& $this->action->getCircuit()->getApplication(); 151 151 $plugins =& $app->pluginPhases; 152 152 $c = ""; -
phpframework/branches/dev/fuseboxFactory.php
r733 r737 77 77 /* must be namespace.verb or namespace:verb */ 78 78 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); 80 80 } elseif ( in_array($verb,array("do","fuseaction")) ) { 81 81 /* built-in verbs that cannot be implemented as a lexicon */ … … 85 85 /* builtin verb implemented as a lexicon */ 86 86 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, 91 88 $attributes, $children); 92 }93 89 } 94 90 if ( isset($GLOBALS['attributes']['fusebox.debug']) && $GLOBALS['attributes']['fusebox.debug'] == 'true' ) echo '</li><li>Ending $'.__CLASS__.'->'.__FUNCTION__.'()</li></ul>'; … … 101 97 if ( !is_object($this->lexCompPool) ) { 102 98 require_once("fuseboxLexiconCompiler.php"); 103 if ( !isPHP5() ) { eval('$obj =& new FuseboxLexiconCompiler();'); } else { $obj = new FuseboxLexiconCompiler(); }99 $obj = new FuseboxLexiconCompiler(); 104 100 } else { 105 101 $obj =& $this->lexCompPool; -
phpframework/branches/dev/fuseboxLexiconCompiler.php
r726 r737 64 64 } 65 65 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 }73 66 $this->compiled = true; 74 67 }
