Most configuration can be exported with Features; path aliases seem to be an exception. So, to export a path alias, I use the following technique in mymodule.install:
<?php$text="Here is my new line.";$newline="$text\n"$filename=$_SERVER['DOCUMENT_ROOT']."/myfile.php";if(!($fp=fopen($filename,'a'))){print'Cannot open file';}else{if(fwrite($fp,"$newline")){print"line written<br />\n";}else{print"problem writing line\n";}if(fclose($fp)){print'file closed';}else{print'problem closing file';}}?>
#backupDATEVAR=`date +%Y-%m-%d--%H-%M-%S`;
mysqldump -u[username] -p[password][database_name]> backup_$DATEVAR.sql;
#restore
mysql -u[username] -p[password][database_name]< backup_$DATEVAR.sql;
## In one command, dump the remote into local ##ssh-C username@mysite.com mysqldump -u[remote user] -p[remote pass][remote db]| mysql -u[local user] -p[local pass][local db]
<?php// get the alias for any node:$path= drupal_get_path_alias("node/".$nid);// or get the alias for current page$path= drupal_get_path_alias();// get the full path$full_path=$GLOBALS['base_url'].$GLOBALS['base_path'].$path;?>
Sometimes you need to get the path to the current theme. You could use path_to_theme() but if you call it from inside a module, you will get the path to the module. Here's how I do it: