mirror of
https://github.com/captn3m0/Scripts.git
synced 2024-09-27 22:22:53 +00:00
23 lines
542 B
PHP
Executable File
23 lines
542 B
PHP
Executable File
#!/usr/bin/php
|
|
<?php
|
|
$directory = '/home/nemo/.gvfs/Nemo%27s iPad/Books/Purchases/';
|
|
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));
|
|
while($it->valid()){
|
|
if (!$it->isDot()){
|
|
$filename = $it->key();
|
|
if(substr($filename,-6)=='.xhtml'){
|
|
echo $filename."\n";
|
|
$f = file($filename);
|
|
if(count($f)>10){
|
|
if(strpos($f[10],"@namespace")!==false){
|
|
$f[10]="<div>\n";
|
|
$contents = join("",$f);
|
|
file_put_contents($filename,$contents);
|
|
echo "Updated\n";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$it->next();
|
|
}
|