- function get($p,$opts)
+ function get($p,$opts=array())
{
$file = realpath($opts['file']);
if (!file_exists($file) || !is_writable($file)) {
}
$c = preg_replace("/new DataObjects_([a-z_]+)/i", "DB_DataObject::factory('\\1')", $c);
- $c = preg_replace("/DataObjects_([a-z_]+)::/i", "DB_DataObject::factory('\\1')::", $c);
+ /// this one tends t hit a few odd comment examples..
+ //$c = preg_replace("/DataObjects_([a-z_]+)::/i", "DB_DataObject::factory('\\1')->", $c);
- $c = preg_replace("/DB_DataObjects::staticGet\(\"DataObjects_([a-z_]+)\"/i", "DB_DataObject::factory('\\1')->load(", $c);
- $c = preg_replace("/DB_DataObjects::staticGet\('DataObjects_([a-z_]+)'/i", "DB_DataObject::factory('\\1')->load(", $c);
+ $c = preg_replace("/DB_DataObject::staticGet\(\"DataObjects_([a-z_]+)\"\s*,/i", "DB_DataObject::factory('\\1')->load(", $c);
+ $c = preg_replace("/DB_DataObject::staticGet\('DataObjects_([a-z_]+)'\s*,/i", "DB_DataObject::factory('\\1')->load(", $c);
+ $c = preg_replace("/DB_DataObject::factory\('([a-z_]+)'\)::/i", "DB_DataObject::factory('\\1')->", $c);
+ $c = preg_replace("/DB_DataObjects::factory/i", "DB_DataObject::factory", $c); // typo...
+
+
+
if ($old_c == $c) {
echo "$file: SKIP NO CHANGES\n";
exit;