示例#1
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     // make sure ZOO exist
     jimport('joomla.filesystem.file');
     if (!JFile::exists(JPATH_ADMINISTRATOR . '/components/com_zoo/config.php') || !JComponentHelper::getComponent('com_zoo', true)->enabled) {
         return;
     }
     // load zoo
     require_once JPATH_ADMINISTRATOR . '/components/com_zoo/config.php';
     $this->app = App::getInstance('zoo');
     // Load from cache
     require_once JPATH_ADMINISTRATOR . '/components/com_zlmanager/helpers/cparams.php';
     require_once JPATH_ADMINISTRATOR . '/components/com_zlmanager/helpers/download.php';
     $username = ZLManagerHelperCparams::getParam('username', '');
     $password = ZLManagerHelperCparams::getParam('password', '');
     $key = md5($username . ':' . $password);
     $cache = $this->getCache($key);
     if (!$cache || !($json = $cache->get('json'))) {
         $url = 'https://www.zoolanders.com/index.php?option=com_zoo&controller=zooextensions&task=getList&format=raw&username='******'&password='******'/tmp/zlmanager.json';
         ZLManagerDownloadHelper::download($url, $file);
         $json = JFile::read($file);
         JFile::delete($file);
         if ($cache) {
             $cache->set('json', $json)->save();
         }
     }
     $this->_json = json_decode($json);
     $this->setState('limit', 50);
 }
 public function __construct($config = array())
 {
     parent::__construct($config);
     // This fixes an issue where sometimes no profiles are shown
     $this->setState('configuration', '');
     $this->setState('filter', '');
 }
示例#3
0
    public function __construct($config = array())
    {
        parent::__construct($config);
        $schemata['#__ak_profiles'] = <<<ENDSQL
CREATE TABLE IF NOT EXISTS `#__ak_profiles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(255) NOT NULL,
  `configuration` longtext,
  `filters` longtext,
  PRIMARY KEY  (`id`)
) DEFAULT CHARACTER SET utf8;
ENDSQL;
        $schemata['default_profile'] = <<<ENDSQL
INSERT IGNORE INTO `#__ak_profiles` (`id`,`description`, `configuration`, `filters`) VALUES (1,'Default Backup Profile','','');
ENDSQL;
        $schemata['#__ak_stats'] = <<<ENDSQL
CREATE TABLE IF NOT EXISTS `#__ak_stats` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `description` varchar(255) NOT NULL,
  `comment` longtext,
  `backupstart` timestamp NOT NULL default '0000-00-00 00:00:00',
  `backupend` timestamp NOT NULL default '0000-00-00 00:00:00',
  `status` enum('run','fail','complete') NOT NULL default 'run',
  `origin` VARCHAR(30) NOT NULL DEFAULT 'backend',
  `type` VARCHAR(30) NOT NULL DEFAULT 'full',
  `profile_id` bigint(20) NOT NULL default '1',
  `archivename` longtext,
  `absolute_path` longtext,
  `multipart` INT NOT NULL DEFAULT 0,
  `tag` VARCHAR(255) NULL,
  `filesexist` TINYINT(3) NOT NULL DEFAULT '1',
  `remote_filename` varchar(1000) DEFAULT NULL,
  `total_size` bigint(20) NOT NULL DEFAULT '0',
  INDEX `idx_fullstatus`(`filesexist`, `status`),
  INDEX `idx_stale`(`status`, `origin`),
  PRIMARY KEY  (`id`)
) DEFAULT CHARACTER SET utf8;
ENDSQL;
        $schemata['#__ak_storage'] = <<<ENDSQL
CREATE TABLE IF NOT EXISTS `#__ak_storage` (
\t`tag` VARCHAR(255) NOT NULL,
\t`lastupdate` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
\t`data` LONGTEXT,
\tPRIMARY KEY (`tag`)
) DEFAULT CHARACTER SET utf8;
ENDSQL;
    }
 /**
  * Constructor.
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     // Get the pagination request variables
     $app = JFactory::getApplication();
     if (!$app instanceof JApplication) {
         $limit = 0;
         $limitstart = 0;
     } else {
         $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'));
         $limitstart = $app->getUserStateFromRequest('com_akeebaprofileslimitstart', 'limitstart', 0);
     }
     // Set the page pagination variables
     $this->setState('limit', $limit);
     $this->setState('limitstart', $limitstart);
     $this->table = 'stat';
 }
示例#5
0
 /**
  * Constructor.
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     // Get the pagination request variables (we only have them if we're not in CLI
     if (JFactory::$application) {
         $app = JFactory::getApplication();
     } else {
         $app = new stdClass();
     }
     if (!($app instanceof JApplication || $app instanceof JApplicationAdministrator)) {
         $limit = 0;
         $limitstart = 0;
     } else {
         $limit = $app->getUserStateFromRequest('global.list.limit', 'limit', $app->getCfg('list_limit'));
         $limitstart = $app->getUserStateFromRequest('com_akeebaprofileslimitstart', 'limitstart', 0);
     }
     // Set the page pagination variables
     $this->setState('limit', $limit);
     $this->setState('limitstart', $limitstart);
     $this->table = 'stat';
 }
示例#6
0
 /**
  * Public constructor. Initialises the protected members as well. Useful $config keys:
  * update_component		The component name, e.g. com_foobar
  * update_version		The default version if the manifest cache is unreadable
  * update_site			The URL to the component's update XML stream
  * update_extraquery	The extra query to append to (commercial) components' download URLs
  * update_sitename		The update site's name (description)
  *
  * @param array $config
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     // Get an instance of the updater class
     $this->updater = JUpdater::getInstance();
     // Get the component name
     if (isset($config['update_component'])) {
         $this->component = $config['update_component'];
     } else {
         $this->component = $this->input->getCmd('option', '');
     }
     // Get the component version
     if (isset($config['update_version'])) {
         $this->version = $config['update_version'];
     }
     // Get the update site
     if (isset($config['update_site'])) {
         $this->updateSite = $config['update_site'];
     }
     // Get the extra query
     if (isset($config['update_extraquery'])) {
         $this->extraQuery = $config['update_extraquery'];
     }
     // Get the extra query
     if (isset($config['update_sitename'])) {
         $this->updateSiteName = $config['update_sitename'];
     }
     // Find the extension ID
     $db = $this->getDbo();
     $query = $db->getQuery(true)->select('*')->from($db->qn('#__extensions'))->where($db->qn('type') . ' = ' . $db->q('component'))->where($db->qn('element') . ' = ' . $db->q($this->component));
     $db->setQuery($query);
     $extension = $db->loadObject();
     if (is_object($extension)) {
         $this->extension_id = $extension->extension_id;
         $data = json_decode($extension->manifest_cache, true);
         if (isset($data['version'])) {
             $this->version = $data['version'];
         }
     }
 }
 public function __construct($options = array())
 {
     JLoader::import('joomla.filesystem.file');
     parent::__construct($options);
 }
 /**
  * Public constructor. Initialises the protected members as well. Useful $config keys:
  * update_component		The component name, e.g. com_foobar
  * update_version		The default version if the manifest cache is unreadable
  * update_site			The URL to the component's update XML stream
  * update_extraquery	The extra query to append to (commercial) components' download URLs
  * update_sitename		The update site's name (description)
  *
  * @param array $config
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     // Get an instance of the updater class
     $this->updater = JUpdater::getInstance();
     // Get the component name
     if (isset($config['update_component'])) {
         $this->component = $config['update_component'];
     } else {
         $this->component = $this->input->getCmd('option', '');
     }
     // Get the component description
     if (isset($config['update_component_description'])) {
         $this->component = $config['update_component_description'];
     } else {
         // Try to auto-translate (hopefully you've loaded the language files)
         $key = strtoupper($this->component);
         $description = JText::_($key);
     }
     // Get the component version
     if (isset($config['update_version'])) {
         $this->version = $config['update_version'];
     }
     // Get the common key
     if (isset($config['common_key'])) {
         $this->commonKey = $config['common_key'];
     } else {
         // Convert com_foobar, pkg_foobar etc to "foobar"
         $this->commonKey = substr($this->component, 4);
     }
     // Get the update site
     if (isset($config['update_site'])) {
         $this->updateSite = $config['update_site'];
     }
     // Get the extra query
     if (isset($config['update_extraquery'])) {
         $this->extraQuery = $config['update_extraquery'];
     }
     // Get the update site's name
     if (isset($config['update_sitename'])) {
         $this->updateSiteName = $config['update_sitename'];
     }
     // Find the extension ID
     $db = FOFPlatform::getInstance()->getDbo();
     $query = $db->getQuery(true)->select('*')->from($db->qn('#__extensions'))->where($db->qn('type') . ' = ' . $db->q('component'))->where($db->qn('element') . ' = ' . $db->q($this->component));
     $db->setQuery($query);
     $extension = $db->loadObject();
     if (is_object($extension)) {
         $this->extension_id = $extension->extension_id;
         $data = json_decode($extension->manifest_cache, true);
         if (isset($data['version'])) {
             $this->version = $data['version'];
         }
     }
 }
示例#9
0
 /**
  * Public class constructor
  *
  * @param   type  $config  The configuration array
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->table = 'team';
 }
示例#10
0
 public function __construct($config = array())
 {
     parent::__construct($config);
 }
示例#11
0
 /**
  * Public class constructor
  *
  * @param   type  $config  The configuration array
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->table = 'individual';
 }