<commit_before><?php
    /**
     * @class  autoinstallAdminController
     * @author NHN (<EMAIL>)
     * @brief autoinstall module admin controller class
     **/

    require_once(_XE_PATH_.'modules/autoinstall/autoinstall.lib.php');

    class autoinstallAdminController extends autoinstall {

        /**
         * @brief Initialization
         **/
        function init() {
        }

        function checkFileCheckSum($file, $checksum){
            $local_checksum = md5_file(FileHandler::getRealPath($file));
            return ($local_checksum === $checksum);
        }

        function _cleanDownloaded($obj){
            FileHandler::removeDir($obj->download_path);
        }

        function procAutoinstallAdminUpdateinfo()
        {
			$this->_updateinfo();
            $this->setMessage("success_updated", 'update');
			$this->setRedirectUrl(Context::get('error_return_url'));
        }

		function _updateinfo(){
            $oModel = &getModel('autoinstall');
            $item = $oModel->getLatestPackage();
            if($item)
            {
                $params["updatedate"] = $item->updatedate;
            }

            $params["act"] = "getResourceapiUpdate";
            $body = XmlGenerater::generate($params);
            $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml");
            $xml = new XmlParser();
            $xmlDoc = $xml->parse($buff);
            $this->updateCategory($xmlDoc);
            $this->updatePackages($xmlDoc);
            $this->checkInstalled();
		}

        function checkInstalled()
        {
            executeQuery("autoinstall.deleteInstalledPackage");
            $oModel =& getModel('autoinstall');
            $packages = $oModel->getPackages();
            foreach($packages as $package)
            {
                $real_path = FileHandler::getRealPath($package->path);
                if(!file_exists($real_path)) {
                    continue;
                }

				$type = $oModel->getTypeFromPath($package->path);
				if($type == "core")
				{
                    $version = __ZBXE_VERSION__;
				}
                else
                {
					$config_file = null;
                    switch($type)
                    {
						case "m.layout":
							$type = "layout";
						case "module":
						case "addon":
						case "layout":
						case "widget":
                            $config_file = "/conf/info.xml";
                        break;
                        case "component":
                            $config_file = "/info.xml";
                        break;
						case "style":
						case "m.skin":
							$type = "skin";
						case "skin":
						case "widgetstyle":
                            $config_file = "/skin.xml";
                        break;
                        case "drcomponent":
                            $config_file = "/info.xml";
                            $type = "component";
                        break;
                    }<commit_msg>Issue 167 supporting theme in auto install module.<commit_after><?php
    /**
     * @class  autoinstallAdminController
     * @author NHN (<EMAIL>)
     * @brief autoinstall module admin controller class
     **/

    require_once(_XE_PATH_.'modules/autoinstall/autoinstall.lib.php');

    class autoinstallAdminController extends autoinstall {

        /**
         * @brief Initialization
         **/
        function init() {
        }

        function checkFileCheckSum($file, $checksum){
            $local_checksum = md5_file(FileHandler::getRealPath($file));
            return ($local_checksum === $checksum);
        }

        function _cleanDownloaded($obj){
            FileHandler::removeDir($obj->download_path);
        }

        function procAutoinstallAdminUpdateinfo()
        {
			$this->_updateinfo();
            $this->setMessage("success_updated", 'update');
			$this->setRedirectUrl(Context::get('error_return_url'));
        }

		function _updateinfo(){
            $oModel = &getModel('autoinstall');
            $item = $oModel->getLatestPackage();
            if($item)
            {
                $params["updatedate"] = $item->updatedate;
            }

            $params["act"] = "getResourceapiUpdate";
            $body = XmlGenerater::generate($params);
            $buff = FileHandler::getRemoteResource(_XE_DOWNLOAD_SERVER_, $body, 3, "POST", "application/xml");
            $xml = new XmlParser();
            $xmlDoc = $xml->parse($buff);
            $this->updateCategory($xmlDoc);
            $this->updatePackages($xmlDoc);
            $this->checkInstalled();
		}

        function checkInstalled()
        {
            executeQuery("autoinstall.deleteInstalledPackage");
            $oModel =& getModel('autoinstall');
            $packages = $oModel->getPackages();
            foreach($packages as $package)
            {
                $real_path = FileHandler::getRealPath($package->path);
                if(!file_exists($real_path)) {
                    continue;
                }

				$type = $oModel->getTypeFromPath($package->path);
				if($type == "core")
				{
                    $version = __ZBXE_VERSION__;
				}
                else
                {
					$config_file = null;
                    switch($type)
                    {
						case "m.layout":
							$type = "layout";
						case "module":
						case "addon":
						case "layout":
						case "widget":
                            $config_file = "/conf/info.xml";
                        break;
                        case "component":
                            $config_file = "/info.xml";
                        break;
						case "style":
						case "m.skin":
							$type = "skin";
						case "skin":
						case "widgetstyle":
                            $config_file = "/skin.xml";
                        break;
                        case "drcomponent":
                            $config_file = "/info.xml";
                            $type = "component";
                        break;
                        case "theme":
                            $config_file = "/conf/info.xml";
                            $type = "theme";
                        break;
                    }
{'fraction_non_alphanumeric': 0.12528035885933997, 'fraction_numerical': 0.0011214354373598205, 'mean_word_length': 1.443444227005871, 'pattern_counts': {'":': 23, '<': 7, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 21}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6266594', 'n_tokens_mistral': 1832, 'n_tokens_neox': 1564, 'n_words': 272}