Replace values of variables in php file with regular expression and sed in ant
von
Sven Wappler
·
<echo message="prepare localconf.php file"/>
<exec executable="sed" failonerror="true" dir="${dir_local}/typo3conf" output="${backup}_${DSTAMP}/localconf.php" os="Linux" >
<arg value="-e"/>
<arg value="s/\$typo_db_username = '.*';/\$typo_db_username = '${db_remote_user}';/g"/>
<arg value="-e"/>
<arg value="s/\$typo_db_host = '.*';/\$typo_db_host = '${db_remote_host}';/g"/>
<arg value="-e"/>
<arg value="s/\$typo_db = '.*';/\$typo_db = '${db_remote_db}';/g"/>
<arg value="-e"/>
<arg value="s/\$typo_db_password = '.*';/\$typo_db_password = '${db_remote_pass}';/g"/>
<arg value="localconf.php"/>
</exec>
Schlagwörter: AntLinuxsed
Sven Wappler
TYPO3 Experte, symfony, Magento, SEO, Frontend und Backend
Das könnte dich auch interessieren …