예제 #1
0
		public static function install() {
			try {
				self::uninstall();
				Symphony::Database()->query("CREATE TABLE IF NOT EXISTS `tbl_cdi_log` (
					  `date` DATETIME NOT NULL,
					  `order` int(4),
					  `author` VARCHAR(255) NOT NULL,
					  `url` VARCHAR(255) NOT NULL,
					  `query_hash` VARCHAR(255) NOT NULL)");
				if (!file_exists(CDIROOT)) { mkdir(CDIROOT); }
				
				Symphony::Configuration()->set('api_key', CdiUtil::generateKey(), 'cdi');
				return true;
			} catch(Exception $e) {
				Administration::instance()->Page->pageAlert(_('An error occurred while installing CDI: ') . $e->getMessage());
				Symphony::Log()->pushToLog('[CDI] ' . $e->getMessage(), E_ERROR, true);
				return false;
			}
		}