芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/public_html/wp-content/plugins/fluentform/app/ComposerScript.php
getComposer()->getConfig()->get('vendor-dir'); $composerJson = json_decode(file_get_contents($vendorDir . '/../composer.json'), true); $namespace = $composerJson['extra']['wpfluent']['namespace']['current']; if (!$namespace) { throw new InvalidArgumentException("Namespace not set in composer.json file."); } $itr = new RecursiveIteratorIterator(new RecursiveDirectoryIterator( $vendorDir.'/wpfluent/framework/src/', RecursiveDirectoryIterator::SKIP_DOTS ), RecursiveIteratorIterator::SELF_FIRST); foreach ($itr as $file) { if ($file->isDir()) { continue; } $fileName = $file->getPathname(); $content = file_get_contents($fileName); $content = str_replace( 'WPFluent\\', $namespace . '\\Framework\\', $content ); file_put_contents($fileName, $content); } } }