summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dibb <beandog@gentoo.org>2009-12-15 20:44:20 +0000
committerSteve Dibb <beandog@gentoo.org>2009-12-15 20:44:20 +0000
commit09088aa9aee870ff3e9dc490683976d224a68b4b (patch)
tree99637a9cd8193a2c937a3efd0e09d6726055916a /header.php
downloadznurt-org-backend-09088aa9aee870ff3e9dc490683976d224a68b4b.tar.gz
znurt-org-backend-09088aa9aee870ff3e9dc490683976d224a68b4b.tar.bz2
znurt-org-backend-09088aa9aee870ff3e9dc490683976d224a68b4b.zip
initial commit
git-svn-id: file:///var/svn/portage@1 3218660a-b0cf-4799-a991-8ddcc5b9e0f3
Diffstat (limited to 'header.php')
-rw-r--r--header.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/header.php b/header.php
new file mode 100644
index 0000000..452147b
--- /dev/null
+++ b/header.php
@@ -0,0 +1,29 @@
+<?
+
+ ini_set('include_path', ini_get('include_path').":/home/steve/php/inc");
+
+ require_once "mdb2/charlie.portage.php";
+ require_once 'class.common.php';
+ require_once 'class.shell.php';
+
+ $c = new Common();
+
+ function importDiff($table, $arr_new, $where = "") {
+
+ global $db;
+
+ if($where)
+ $where = "WHERE $where";
+
+ $sql = "SELECT name FROM $table $where ORDER BY name;";
+ $arr_old = $db->getCol($sql);
+
+ $arr_insert = array_diff($arr_new, $arr_old);
+ $arr_delete = array_diff($arr_old, $arr_new);
+
+ $arr = array('insert' => $arr_insert, 'delete' => $arr_delete);
+
+ return($arr);
+ }
+
+?>