noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 01/08: Package Repository : add setContent


From: dwm
Subject: [Noalyss-commit] [noalyss] 01/08: Package Repository : add setContent
Date: Sat, 1 Jul 2023 11:09:07 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit fa7d4048f62f7ee2a606f830903c80dd22cf67d7
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Fri Jun 9 22:04:33 2023 +0200

    Package Repository : add setContent
---
 include/class/package_repository.class.php | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/include/class/package_repository.class.php 
b/include/class/package_repository.class.php
index 093ad079f..ba2becce8 100644
--- a/include/class/package_repository.class.php
+++ b/include/class/package_repository.class.php
@@ -57,7 +57,18 @@ class Package_Repository
     }
 
     /**
-     * check that NOALYSS_HOME exists and is writable
+     * @brief set content
+     * @param $content xml file to be parsed
+     * @return Package_Repository
+     */
+    public function setContent($content)
+    {
+        $this->content=simplexml_load_string($content);
+        if ( $this->content==false ) throw new Exception ("XML INVALIDE 
[$content]",EXC_INVALID);
+        return $this;
+    }
+    /**
+     * @brief check that NOALYSS_HOME exists and is writable
      */
     function can_download()
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]