summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'shared/classes/gentoo_profile.php')
-rw-r--r--shared/classes/gentoo_profile.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/shared/classes/gentoo_profile.php b/shared/classes/gentoo_profile.php
index 7184aad..d7726f8 100644
--- a/shared/classes/gentoo_profile.php
+++ b/shared/classes/gentoo_profile.php
@@ -55,8 +55,8 @@ class sql_gentoo_profile extends sql_row_obj {
}
// Reads the data from the Packages file in $this->pkgdir
public function read_Packages($update_pkgs=false, $verbose=false) {
- global $conf;
- if (!is_readable($file="{$conf['pkgdir_root']}/$this->pkgdir/Packages")) {
+ global $S;
+ if (!is_readable($file="{$S['conf']['pkgdir_root']}/$this->pkgdir/Packages")) {
throw_exception("Packages file doesn't exist for pkgdir $this->pkgdir");
}
$file=fopen($file, 'r');
@@ -104,7 +104,7 @@ class sql_gentoo_profile extends sql_row_obj {
$u=$d=$t=0;
if ($update_pkgs) {
global $S;
- $r=$S['pdo']->query('SELECT * FROM `gentoo_packages` WHERE `profile`='.$this->id);
+ $r=query('SELECT * FROM `gentoo_packages` WHERE `profile`='.$this->id);
while ($pkg=$r->fetch(PDO::FETCH_ASSOC)) {
$pkg=new sql_gentoo_package($pkg);
if (isset($p[$pkg->bcat][$pkg->lcat][$pkg->name][$pkg->version])) {
@@ -152,7 +152,7 @@ class sql_gentoo_profile extends sql_row_obj {
$name=array_shift($pkgs);
$obj=new sql_gentoo_pkgset();
if ($update) {
- $r=$S['pdo']->query('SELECT * FROM `gentoo_pkgsets` WHERE `profile`='.$this->id.' AND `name`="'.$name.'" LIMIT 1');
+ $r=query('SELECT * FROM `gentoo_pkgsets` WHERE `profile`='.$this->id.' AND `name`="'.$name.'" LIMIT 1');
if ($r->rowCount())
$obj->from_array($r->fetch(PDO::FETCH_ASSOC), true);
}
@@ -169,13 +169,13 @@ class sql_gentoo_profile extends sql_row_obj {
}
}
if ($update)
- $S['pdo']->query('DELETE FROM `gentoo_pkgsets` WHERE `profile`='.$this->id.($exists?' AND `id` NOT IN ('.implode(',', $exists).')':''));
+ query('DELETE FROM `gentoo_pkgsets` WHERE `profile`='.$this->id.($exists?' AND `id` NOT IN ('.implode(',', $exists).')':''));
}
public function read_stage3($update=false) {
global $S;
if ($update) {
- $S['pdo']->query('DELETE FROM `gentoo_basepkgs` WHERE `profile`='.$this->id);
- $S['pdo']->query('DELETE FROM `gentoo_baseinit` WHERE `profile`='.$this->id);
+ query('DELETE FROM `gentoo_basepkgs` WHERE `profile`='.$this->id);
+ query('DELETE FROM `gentoo_baseinit` WHERE `profile`='.$this->id);
}
$file=realpath(CACHE.'/stage3/'.$this->stage3);
if (!is_readable($file)) return false;
@@ -198,7 +198,7 @@ class sql_gentoo_profile extends sql_row_obj {
public function &get_packages($omit_masked=false, $trim=null) {
global $S;
$skip_masked=!in_array('masked', $trim);
- $r=$S['pdo']->query('SELECT * FROM `gentoo_packages` WHERE `profile`='.$this->id);
+ $r=query('SELECT * FROM `gentoo_packages` WHERE `profile`='.$this->id);
$p=array();
while ($pkg=$r->fetch(PDO::FETCH_ASSOC)) {
$pkg=new sql_gentoo_package($pkg);