This class allow Leelabot to automatically update itself. If it is actived, it will check the updates on leelabot servers and update the bot if necessary.
Example #1
0
 /**
  * @expectedException \UnexpectedValueException
  * @expectedExceptionMessage Instance of layout argument updater is expected
  */
 public function testEvaluateWrongUpdaterClass()
 {
     $input = ['value' => 'some text', 'updater' => ['Magento\\Framework\\View\\Layout\\Argument\\UpdaterInterface', 'Magento\\Framework\\ObjectManagerInterface']];
     $self = $this;
     $this->_objectManager->expects($this->exactly(2))->method('get')->will($this->returnCallback(function ($className) use($self) {
         return $self->getMockForAbstractClass($className);
     }));
     $this->_model->evaluate($input);
 }
 /**
  * Tasks before insertion
  */
 protected function before()
 {
     parent::before();
     if (!in_array(self::ACCOUNTID, $this->keys())) {
         throw new \RuntimeException('Account id must be part of the internal keys.');
     }
 }
Example #3
0
 /**
  * This function returns an instance of the Updater
  * class. It is the only way to create a new Updater, as
  * it implements the Singleton interface
  *
  * @return Updater
  */
 public static function instance()
 {
     if (!self::$_instance instanceof Updater) {
         self::$_instance = new Updater();
     }
     return self::$_instance;
 }
Example #4
0
 function init()
 {
     global $_version;
     require_once CONF_PATH . 'autofill.inc.php';
     $this->init_header();
     Updater::init();
     $this->init_final();
 }
 public function create($statsType)
 {
     // prepare things unique to this statsType
     $ucStatsType = ucfirst($statsType);
     if (!isset($this->updateIfOlderThan[$ucStatsType])) {
         throw new Exception("unknown type of article stats type given: '{$statsType}'");
         exit;
     }
     $viewName = $this->viewNameBase . strtolower($statsType);
     $articleStatsClassName = $ucStatsType . "_ArticleStats";
     // get search results for statsTypes that need them
     $searchResults = $this->runSearch($ucStatsType);
     // setup the objects we need
     $db = new Db('https://' . AM_CRAWLER_USER . ':' . AM_CRAWLER_PW . '@' . AM_CRAWLER_DB_URL, AM_CRAWLER_DB_NAME);
     $urls = new Urls();
     $getter = new UrlGetter();
     $articleStats = new $articleStatsClassName($getter, $urls);
     $updater = new Updater($db, $this->log);
     // setup update options
     $updater->setViewName(array("crawl", $viewName));
     $updater->setArticleStats($articleStats);
     $updater->setSecondsBetweenUpdates($this->secondsBetweenDocUpdates[$ucStatsType]);
     $updater->setUpdateIfOlderThan($this->updateIfOlderThan[$ucStatsType]);
     $updater->setSearchResults($searchResults);
     return $updater;
 }
Example #6
0
 public function do_upgrade()
 {
     $request = $this->getRequest();
     if ($request->isPost()) {
         $updater = new Updater();
         if ($updater->updateAvailable()) {
             $image_data = $updater->downloadLatest();
             if (!$updater->validateSignature($image_data)) {
                 die('INVALID SIGNATURE');
             }
             if ($updater->performUpdate($image_data)) {
                 die('Upgrading, please wait for the device to reboot.');
             } else {
                 die('FAILED');
             }
         }
     }
 }
 public static function ApplyUpdate($File, $Last, $Hash, $Date)
 {
     $Lines = file($File, FILE_IGNORE_NEW_LINES);
     foreach ($Lines as $Line) {
         $Statement = Updater::$DBConnection->prepare($Line);
         $Statement->execute();
     }
     if ($Last == true) {
         Updater::UpdateDatabaseVersion($Hash, $Date);
     }
 }
Example #8
0
 static function showTables()
 {
     if (!self::$tables) {
         self::$tables = array();
         $tables = $db->query("SHOW TABLES;");
         // From my testing, 'FROM DB' is not needed?
         while ($table = mysql_fetch_array($tables, MYSQL_ASSOC)) {
             self::$tables[] = $table;
         }
     }
     return self::$tables;
 }
Example #9
0
 public function main($argv)
 {
     Pix_Table::$_save_memory = true;
     list(, $type, $year, $month) = $argv;
     if (!in_array($type, array('company', 'bussiness', 'company-continue', 'bussiness-continue'))) {
         return $this->wrong_argv();
     }
     if (in_array($type, array('company', 'bussiness'))) {
         $year = intval($year);
         $month = intval($month);
         if (!intval($year) or !intval($month)) {
             return $this->wrong_argv();
         }
     }
     if ('company' == $type) {
         $ids = Crawler::crawlerMonth($year, $month);
         $ids = array_unique($ids);
         file_put_contents('ids', implode("\n", $ids));
         foreach ($ids as $id) {
             $u = Updater::update($id);
             if ($u) {
                 $u->updateSearch();
             }
         }
     } elseif ('company-continue' == $type) {
         $ids = explode("\n", file_get_contents('ids'));
         $pos = array_search($year, $ids);
         var_dump($pos);
         if (false === $pos) {
             return $this->wrong_argv();
         }
         foreach (array_slice($ids, $pos - 1) as $id) {
             $u = Updater::update($id);
             if ($u) {
                 $u->updateSearch();
             }
         }
     } else {
         $ids = Crawler::crawlerBussiness($year, $month);
         $ids = array_unique($ids);
         file_put_contents('ids', implode("\n", $ids));
         foreach ($ids as $id) {
             $u = Updater::updateBussiness($id);
             if ($u) {
                 $u->updateSearch();
             }
         }
     }
 }
Example #10
0
 function init()
 {
     global $_config;
     if (!$_config) {
         require_once SYSTEM_ROOT . './config.inc.php';
     }
     $this->init_header();
     $this->init_useragent();
     CACHE::pre_fetch('setting', 'plugin', 'plugins');
     Updater::init();
     $this->init_syskey();
     $this->init_cookie();
     cloud::init();
     HOOK::INIT();
     $this->init_final();
 }
Example #11
0
 /**
  * Block a page if referer is found on list of blocked domains
  *
  * @param string $action If empty, send 403 response; if URL, redirect here; if non-empty string, print message
  */
 public static function protect($action = '')
 {
     // Try to update the list
     if (!defined('SEMALT_UNIT_TESTING')) {
         Updater::update();
     }
     // Simply stop here if referer is not on the list
     if (!self::isRefererOnBlocklist()) {
         return;
     }
     self::doBlock($action);
     // Stop execution altogether, bye bye bots
     if (!defined('SEMALT_UNIT_TESTING')) {
         exit;
     }
 }
Example #12
0
 /**
  * Fetches an update file and verifies its authenticity before returning
  * the file contents. Returns false on failure.
  */
 public static function fetch($path)
 {
     self::$error = false;
     $file_url = self::$updates . $path;
     $sha_url = self::$checksums . $path . '.sha';
     $file = fetch_url($file_url);
     if (!$file) {
         self::$error = 'Unable to fetch file.';
         return false;
     }
     $sha = fetch_url($sha_url);
     if (!$sha) {
         self::$error = 'Unable to fetch checksum file.';
         return false;
     }
     if (!self::test_checksum($file, $sha)) {
         self::$error = 'Checksum failed!';
         return false;
     }
     return $file;
 }
Example #13
0
    $sql = "ALTER TABLE `" . OW_DB_PREFIX . "googlelocation_data` ADD `entityType` ENUM( 'user', 'event' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `entityId` ";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
    $sql = "UPDATE `" . OW_DB_PREFIX . "googlelocation_data` SET `entityType` = 'user' ";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
    $sql = "ALTER TABLE `" . OW_DB_PREFIX . "googlelocation_data` DROP INDEX `entityId` ";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
    $sql = "ALTER IGNORE TABLE `" . OW_DB_PREFIX . "googlelocation_data` ADD INDEX `entityId` ( `entityId` , `entityType` ) ";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
    $sql = " DELETE FROM g `" . OW_DB_PREFIX . "googlelocation_data` g\n        LEFT JOIN `" . OW_DB_PREFIX . "base_user` u ON u.id = g.entityId\n        WHERE g.entityType = 'user' AND u.id IS NULL ";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
    $sql = " ALTER TABLE `" . OW_DB_PREFIX . "googlelocation_data` CHANGE `json` `json` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL  ";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'googlelocation');
Example #14
0
 protected function install()
 {
     $updater = new Updater();
     $updater->update();
 }
Example #15
0
                    copy($source . $file, $dest . $file);
                }
            }
        }
        closedir($dir_handle);
    } else {
        copy($source, $dest);
    }
}
$errors = array();
try {
    $sql = "ALTER TABLE  `" . OW_DB_PREFIX . "map` ADD  `id_cat` INT( 10 ) NOT NULL DEFAULT  '0' AFTER  `id_owner` ,ADD INDEX (  `id_cat` ) ";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
    $errors[] = $e;
}
try {
    $sql = "CREATE TABLE IF NOT EXISTS `" . OW_DB_PREFIX . "map_category` (\n  `id` int(10) NOT NULL auto_increment,\n  `id2` int(10) NOT NULL default '0',\n  `active` enum('0','1') collate utf8_bin NOT NULL default '1',\n  `name` varchar(100) collate utf8_bin NOT NULL,\n  `name_translate` varchar(100) collate utf8_bin NOT NULL,\n  UNIQUE KEY `id` (`id`),\n  KEY `name` (`name`),\n  KEY `id2` (`id2`),\n  KEY `active` (`active`)\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
    $errors[] = $e;
}
try {
    $sql = "INSERT INTO  `" . OW_DB_PREFIX . "map_category` (\n`id` ,\n`id2` ,\n`active` ,\n`name` ,\n`name_translate`\n)\nVALUES (\n'0',  '0',  '1',  'Default',  'cat_default'\n);";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
    $errors[] = $e;
}
if (!empty($errors)) {
    //    print_r($errors);
}
Example #16
0
 /**
  * @dataProvider versionCompatibilityTestData
  */
 public function testIsUpgradePossible($oldVersion, $newVersion, $result)
 {
     $updater = new Updater(\OC::$server->getHTTPHelper(), \OC::$server->getConfig());
     $this->assertSame($result, $updater->isUpgradePossible($oldVersion, $newVersion));
 }
Example #17
0
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy
 * of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
try {
    $sql = "SHOW COLUMNS FROM `" . OW_DB_PREFIX . "video_clip` LIKE 'plugin';";
    $cols = Updater::getDbo()->queryForList($sql);
    if (!count($cols)) {
        $sql = "ALTER TABLE `" . OW_DB_PREFIX . "video_clip` ADD `plugin` VARCHAR(255) NULL DEFAULT 'video' ; ";
        Updater::getDbo()->update($sql);
    }
} catch (Exception $e) {
}
// refresh static cache
$plugin = OW::getPluginManager()->getPlugin('spvideolite');
$staticDir = OW_DIR_STATIC_PLUGIN . $plugin->getModuleName() . DS;
$pluginStaticDir = OW_DIR_PLUGIN . $plugin->getModuleName() . DS . 'static' . DS;
if (file_exists($staticDir)) {
    UTIL_File::removeDir($staticDir);
}
mkdir($staticDir);
chmod($staticDir, 0777);
UTIL_File::copyDir($pluginStaticDir, $staticDir);
Example #18
0
        if (!$rs) {
            throw new Exception("upgrade::setTRStoFloat(): " . $this->conn->error);
        }
        $res = $rs->fetch_array(MYSQLI_ASSOC);
        if (strpos($res['data_type'], 'int') === false) {
            return 0;
        }
        // already done
        // not done: change every TRS/TRM field to float
        foreach ($cmds as $query) {
            $this->conn->query($query);
        }
        return 0;
    }
}
$upg = new Updater();
if ($upg->slaveMode() == true) {
    return;
}
// restricted mode. do not try to update database anyway
try {
    $upg->removeUpdateMark();
    $upg->updateVersionHistory();
    $upg->updatePerroGuiaClub();
    $upg->addCountries();
    $upg->addColumnUnlessExists("Mangas", "Orden_Equipos", "TEXT");
    $upg->addColumnUnlessExists("Resultados", "TIntermedio", "double", "0.0");
    $upg->addColumnUnlessExists("Resultados", "Games", "int(4)", 0);
    $upg->addColumnUnlessExists("Perros", "NombreLargo", "varchar(255)");
    $upg->addColumnUnlessExists("Perros", "Genero", "varchar(16)");
    $upg->addColumnUnlessExists("Provincias", "Pais", "varchar(2)", "ES");
Example #19
0
<?php

/**
 * This software is intended for use with Oxwall Free Community Software http://www.oxwall.org/ and is
 * licensed under The BSD license.
 * ---
 * Copyright (c) 2011, Oxwall Foundation
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
 * following conditions are met:
 *
 *  - Redistributions of source code must retain the above copyright notice, this list of conditions and
 *  the following disclaimer.
 *
 *  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
 *  the following disclaimer in the documentation and/or other materials provided with the distribution.
 *
 *  - Neither the name of the Oxwall Foundation nor the names of its contributors may be used to endorse or promote products
 *  derived from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
$updateDir = dirname(__FILE__) . DS;
Updater::getLanguageService()->importPrefixFromZip($updateDir . 'langs.zip', 'groups');
OW::getAuthorization()->addAction('groups', 'view', true);
Example #20
0
}
$config = Updater::getConfigService();
if (!$config->configExists('oaseo', 'crawler_lock')) {
    $config->addConfig('oaseo', 'crawler_lock', 0);
}
if (!$config->configExists('oaseo', 'update_info')) {
    $config->addConfig('oaseo', 'update_info', 0);
}
if (!$config->configExists('oaseo', 'update_maps')) {
    $config->addConfig('oaseo', 'update_maps', 0);
}
if (!$config->configExists('oaseo', 'sitemap_url')) {
    $config->addConfig('oaseo', 'sitemap_url', 'sitemap.xml');
}
if (!$config->configExists('oaseo', 'imagemap_url')) {
    $config->addConfig('oaseo', 'imagemap_url', 'sitemap_images.xml');
}
if (!$config->configExists('oaseo', 'update_freq')) {
    $config->addConfig('oaseo', 'update_freq', 604800);
}
if (!$config->configExists('oaseo', 'update_ts')) {
    $config->addConfig('oaseo', 'update_ts', 0);
}
if (!$config->configExists('oaseo', 'inform')) {
    $config->addConfig('oaseo', 'inform', '["google"]');
}
if (!$config->configExists('oaseo', 'sitemap_init')) {
    $config->addConfig('oaseo', 'sitemap_init', 0);
}
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'oaseo');
Example #21
0
<?php

/**
 * This software is intended for use with Oxwall Free Community Software http://www.oxwall.org/ and is
 * licensed under The BSD license.
 * ---
 * Copyright (c) 2011, Oxwall Foundation
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
 * following conditions are met:
 *
 *  - Redistributions of source code must retain the above copyright notice, this list of conditions and
 *  the following disclaimer.
 *
 *  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
 *  the following disclaimer in the documentation and/or other materials provided with the distribution.
 *
 *  - Neither the name of the Oxwall Foundation nor the names of its contributors may be used to endorse or promote products
 *  derived from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
$updateDir = dirname(__FILE__) . DS;
Updater::getLanguageService()->importPrefixFromZip($updateDir . 'langs.zip', 'virtualgifts');
Example #22
0
/**
 * This software is intended for use with Oxwall Free Community Software http://www.oxwall.org/ and is
 * licensed under The BSD license.
 * ---
 * Copyright (c) 2011, Oxwall Foundation
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
 * following conditions are met:
 *
 *  - Redistributions of source code must retain the above copyright notice, this list of conditions and
 *  the following disclaimer.
 *
 *  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
 *  the following disclaimer in the documentation and/or other materials provided with the distribution.
 *
 *  - Neither the name of the Oxwall Foundation nor the names of its contributors may be used to endorse or promote products
 *  derived from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
$langService = Updater::getLanguageService();
$keys = array('reply_to_chat_message_promoted', 'reply_to_message_promoted', 'send_chat_message_promoted', 'send_message_promoted');
foreach ($keys as $key) {
    $langService->deleteLangKey('mailbox', $key);
}
$langService->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'mailbox');
Example #23
0
$clean_url = preg_replace(array('/\\/{2,}/i', '/install$/i'), array('/', null), $clean_url);
$clean_url = rtrim($clean_url, '/\\');
define('DOMAIN', $clean_url);
$clean_path = rtrim(dirname(__FILE__), '/\\');
$clean_path = preg_replace(array('/\\/{2,}/i', '/install$/i'), array('/', null), $clean_path);
$clean_path = rtrim($clean_path, '/\\');
define('DOCROOT', $clean_path);
// Required boot components
define('VERSION', '2.6.4');
define('INSTALL', DOCROOT . '/install');
// Include autoloader:
require_once DOCROOT . '/vendor/autoload.php';
// Include the boot script:
require_once DOCROOT . '/symphony/lib/boot/bundle.php';
define('INSTALL_LOGS', MANIFEST . '/logs');
define('INSTALL_URL', URL . '/install');
// If prompt to remove, delete the entire `/install` directory
// and then redirect to Symphony
if (isset($_GET['action']) && $_GET['action'] == 'remove') {
    General::deleteDirectory(INSTALL);
    redirect(SYMPHONY_URL);
}
// If Symphony is already installed, run the updater
if (file_exists(CONFIG)) {
    // System updater
    $script = Updater::instance();
} else {
    // System installer
    $script = Installer::instance();
}
return $script->run();
Example #24
0
/**
 * EXHIBIT A. Common Public Attribution License Version 1.0
 * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”);
 * you may not use this file except in compliance with the License. You may obtain a copy of the License at
 * http://www.oxwall.org/license. The License is based on the Mozilla Public License Version 1.1
 * but Sections 14 and 15 have been added to cover use of software over a computer network and provide for
 * limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent
 * with Exhibit B. Software distributed under the License is distributed on an “AS IS” basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language
 * governing rights and limitations under the License. The Original Code is Oxwall software.
 * The Initial Developer of the Original Code is Oxwall Foundation (http://www.oxwall.org/foundation).
 * All portions of the code written by Oxwall Foundation are Copyright (c) 2011. All Rights Reserved.
 * EXHIBIT B. Attribution Information
 * Attribution Copyright Notice: Copyright 2011 Oxwall Foundation. All rights reserved.
 * Attribution Phrase (not exceeding 10 words): Powered by Oxwall community software
 * Attribution URL: http://www.oxwall.org/
 * Graphic Image as provided in the Covered Code.
 * Display of Attribution Information is required in Larger Works which are defined in the CPAL as a work
 * which combines Covered Code or portions thereof with code not governed by the terms of the CPAL.
 */
$queryList = array("ALTER TABLE `" . OW_DB_PREFIX . "base_plugin` ADD `licenseCheckTimestamp` INT UNSIGNED NULL DEFAULT NULL AFTER `licenseKey`, ADD INDEX `licenseCheckTimestamp` (`licenseCheckTimestamp`)", "ALTER TABLE `" . OW_DB_PREFIX . "base_theme` ADD `licenseCheckTimestamp` INT UNSIGNED NULL DEFAULT NULL AFTER `sidebarPosition`, ADD INDEX `licenseCheckTimestamp` (`licenseCheckTimestamp`)", "ALTER TABLE `" . OW_DB_PREFIX . "base_theme` CHANGE  `name`  `key` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL", "ALTER TABLE `" . OW_DB_PREFIX . "base_theme` DROP `isActive`");
foreach ($queryList as $query) {
    try {
        Updater::getDbo()->query($query);
    } catch (Exception $e) {
        Updater::getLogger()->addEntry(json_encode($e));
    }
}
Updater::getLanguageService()->importPrefixFromZip(dirname(__FILE__) . DS . "langs.zip", "admin");
Example #25
0
 * EXHIBIT A. Common Public Attribution License Version 1.0
 * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”);
 * you may not use this file except in compliance with the License. You may obtain a copy of the License at
 * http://www.oxwall.org/license. The License is based on the Mozilla Public License Version 1.1
 * but Sections 14 and 15 have been added to cover use of software over a computer network and provide for
 * limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent
 * with Exhibit B. Software distributed under the License is distributed on an “AS IS” basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language
 * governing rights and limitations under the License. The Original Code is Oxwall software.
 * The Initial Developer of the Original Code is Oxwall Foundation (http://www.oxwall.org/foundation).
 * All portions of the code written by Oxwall Foundation are Copyright (c) 2011. All Rights Reserved.
 * EXHIBIT B. Attribution Information
 * Attribution Copyright Notice: Copyright 2011 Oxwall Foundation. All rights reserved.
 * Attribution Phrase (not exceeding 10 words): Powered by Oxwall community software
 * Attribution URL: http://www.oxwall.org/
 * Graphic Image as provided in the Covered Code.
 * Display of Attribution Information is required in Larger Works which are defined in the CPAL as a work
 * which combines Covered Code or portions thereof with code not governed by the terms of the CPAL.
 */
UPDATE_LanguageService::getInstance()->importPrefixFromZip(dirname(__FILE__) . DS . 'langs.zip', 'mobile');
$logger = Updater::getLogger();
try {
    OW::getNavigation()->deleteMenuItem('mobile', 'mobile_pages_dashboard');
} catch (Exception $e) {
    $logger->addEntry(json_encode($e));
}
try {
    OW::getNavigation()->addMenuItem(OW_Navigation::MOBILE_TOP, 'base_member_dashboard', 'mobile', 'mobile_pages_dashboard', OW_Navigation::VISIBLE_FOR_MEMBER);
} catch (Exception $e) {
    $logger->addEntry(json_encode($e));
}
Example #26
0
    $matchSection->name = 'about_my_match';
    $matchSection->sortOrder = 1;
    $matchSection->isHidden = 0;
    BOL_QuestionSectionDao::getInstance()->save($matchSection);
}
$dbPrefix = OW_DB_PREFIX;
try {
    $sql = "UPDATE `{$dbPrefix}base_question` SET `onJoin` = '1', `required` = '1' WHERE `name` = 'match_age' OR `name`='birthdate'";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
    $sql = "UPDATE `{$dbPrefix}base_question` SET `sectionName` = 'about_my_match', `onEdit` = 0, `onJoin` = 0 WHERE `name` <> 'match_age' AND `name`<>'match_sex' AND `parent` <> '' AND `parent` IS NOT NULL";
    Updater::getDbo()->query($sql);
} catch (Exception $e) {
}
try {
    $sql = "SELECT *  FROM `{$dbPrefix}base_question_section` WHERE `sortOrder` = 0";
    $sectionData = Updater::getDbo()->queryForRow($sql);
} catch (Exception $e) {
}
try {
    $sql = "UPDATE `{$dbPrefix}base_question` SET `sectionName` = :sectionName WHERE `sectionName` = 'about_my_match' AND (`parent` = '' OR `parent` IS NULL)";
    Updater::getDbo()->query($sql, array('sectionName' => $sectionData['name']));
} catch (Exception $e) {
}
try {
    $sql = "UPDATE `{$dbPrefix}base_question_section` SET `isDeletable` = 0 WHERE `name` = 'about_my_match' ";
    Updater::getDbo()->query($sql, array('sectionName' => $sectionData['name']));
} catch (Exception $e) {
}
Example #27
0
 */
namespace OCA_Updater;

\OCP\JSON::checkAdminUser();
// Url to download package e.g. http://download.owncloud.org/releases/owncloud-4.0.5.tar.bz2
$packageUrl = 'http://owncloud.org/releases/owncloud-latest.zip';
//Package version e.g. 4.0.4
$packageVersion = '';
$updateData = \OC_Updater::check();
if (isset($updateData['version'])) {
    $packageVersion = $updateData['version'];
}
if (isset($updateData['url']) && extension_loaded('bz2')) {
    $packageUrl = $updateData['url'];
}
if (!$packageVersion) {
    \OCP\JSON::error(array('msg' => 'Version not found'));
    exit;
}
$sourcePath = Downloader::getPackage($packageUrl, $packageVersion);
if (!$sourcePath) {
    \OCP\JSON::error(array('msg' => 'Unable to fetch package'));
    exit;
}
$backupPath = Backup::createBackup();
if ($backupPath) {
    Updater::update($sourcePath, $backupPath);
    \OCP\JSON::success(array());
} else {
    \OCP\JSON::error(array('msg' => 'Failed to create backup'));
}
Example #28
0
<?php

include 'config.php';
include_once 'checkLogin.php';
include ARC_DIR . 'ARC2.php';
include CLASSES_DIR . 'Updater.php';
header("Content-type: application/json");
$testPost['jsonStr'] = '{"old":"{\\"http://code.rubrick-jetpack.org/vocab/Context1\\":{\\"http://rdfs.org/sioc/ns#name\\":[{\\"value\\":\\"Demo\\",\\"type\\":\\"literal\\"}],\\"http://code.rubrick-jetpack.org/vocab/description\\":[{\\"value\\":\\"Just a demo\\",\\"type\\":\\"literal\\"}]}}","new":"{\\"http://code.rubrick-jetpack.org/vocab/Context1\\":{\\"http://rdfs.org/sioc/ns#name\\":[{\\"value\\":\\"Demo\\",\\"type\\":\\"literal\\"}],\\"http://code.rubrick-jetpack.org/vocab/description\\":[{\\"value\\":\\"Just a demo ed\\",\\"type\\":\\"literal\\"}]}}","uri":"http://code.rubrick-jetpack.org/vocab/Context1"}';
$testPost['uri'] = 'http://testURI.org';
$store = ARC2::getStore($config);
$responseObj = new stdClass();
//$postObj = json_decode($_POST['jsonStr']);
$postObj = json_decode($_POST['jsonStr']);
$updater = new Updater($_POST['uri'], array('post' => $postObj));
//print_r($updater->postData);
$updater->buildAddGraph();
$updater->buildDeleteGraph();
$updater->finalizeGraph('add');
$updater->finalizeGraph('delete');
//echo json_encode($updater->deleteGraph->toRDFJSON(true) );
Example #29
0
 * Copyright (c) 2011, Oxwall Foundation
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
 * following conditions are met:
 *
 *  - Redistributions of source code must retain the above copyright notice, this list of conditions and
 *  the following disclaimer.
 *
 *  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
 *  the following disclaimer in the documentation and/or other materials provided with the distribution.
 *
 *  - Neither the name of the Oxwall Foundation nor the names of its contributors may be used to endorse or promote products
 *  derived from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
$exArr = array();
$moduleName = 'ajaxim';
try {
    @unlink(OW_DIR_STATIC_PLUGIN . $moduleName . DS . 'js' . DS . 'ajaxim.js');
    @copy(OW_DIR_PLUGIN . $moduleName . DS . 'static' . DS . 'js' . DS . 'ajaxim.js', OW_DIR_STATIC_PLUGIN . $moduleName . DS . 'js' . DS . 'ajaxim.js');
} catch (Exception $e) {
    $exArr[] = $e;
}
Updater::getLanguageService()->importPrefixFromZip(dirname(dirname(dirname(__FILE__))) . DS . 'langs.zip', $moduleName);
Example #30
0
 protected function RunUpdater()
 {
     $updater = new Updater();
     $updater->UpdateUrl = 'https://raw.github.com/uuf6429/httpdmon/master/build/httpdmon.php?nc=' . mt_rand();
     $updater->LocalVersion = VERSION;
     $updater->TryRunCmd = 'php -f ' . escapeshellarg(__FILE__) . ' -- ' . (IS_WINDOWS ? '/' : '-') . 'v';
     $updater->EventHandler = array($this, 'HandleUpdateScriptEvent');
     $updater->Run();
 }