$source.'/app','fortify'=>$source.'/vendor/laravel/fortify/src']as$prefix=>$directory){ foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory,FilesystemIterator::SKIP_DOTS))as$file){ if(!$file->isFile()||$file->getExtension()!=='php')continue;if($file->isLink())throw new LogicException('Linked source refused');$relative=$prefix.'/'.str_replace('\\','/',substr($file->getPathname(),strlen($directory)+1));$raw=file_get_contents($file->getPathname());$text=''; foreach(token_get_all($raw)as$token){if(!is_array($token)){$text.=$token;continue;}[$type,$value]=$token; if($prefix==='app'&&in_array($type,[T_NAME_QUALIFIED,T_NAME_FULLY_QUALIFIED],true))$value=preg_replace('/^(\\\\?)App\\\\/','$1Tempo\\Purchasing\\Embedded\\',$value); $text.=$value; } $destination=$target.'/'.$relative;if(!is_dir(dirname($destination)))mkdir(dirname($destination),0777,true);file_put_contents($destination,$text);$files[$relative]=hash('sha256',$text);$originals[$relative]=hash('sha256',$raw); } } ksort($files);ksort($originals);file_put_contents($target.'/manifest.json',json_encode(['format'=>'sgf.receipt.native-namespace.v1','files'=>$files,'originals'=>$originals,'transformation'=>'Only App-qualified PHP name tokens become Tempo\\Purchasing\\Embedded; strings and rule expressions unchanged.'],JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo count($files)." original PHP files packaged with namespace-only adaptation.\n";