Changeset 2216:91f485a16187
- Timestamp:
- 10/02/13 17:47:15 (10 years ago)
- Branch:
- dcRepo
- Files:
-
- 6 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
admin/blog_theme.php
r2215 r2216 16 16 17 17 # -- "First time" settings setup -- 18 if ($core->blog->settings->system-> repository_theme_url === null) {18 if ($core->blog->settings->system->store_theme_url === null) { 19 19 $core->blog->settings->system->put( 20 ' repository_theme_url', 'http://update.dotaddict.org/dc2/themes.xml', 'string', 'Themes XML feed location', true, true20 'store_theme_url', 'http://update.dotaddict.org/dc2/themes.xml', 'string', 'Themes XML feed location', true, true 21 21 ); 22 22 } … … 30 30 $core->themes, 31 31 $core->blog->themes_path, 32 $core->blog->settings->system-> repository_theme_url32 $core->blog->settings->system->store_theme_url 33 33 ); 34 34 $list::$distributed_modules = array( … … 132 132 133 133 # Updated modules from repo 134 $modules = $list-> repository->get(true);134 $modules = $list->store->get(true); 135 135 if (!empty($modules)) { 136 136 echo … … 202 202 # New modules from repo 203 203 $search = $list->getSearchQuery(); 204 $modules = $search ? $list-> repository->search($search) : $list->repository->get();204 $modules = $search ? $list->store->search($search) : $list->store->get(); 205 205 206 206 if (!empty($search) || !empty($modules)) { -
admin/index.php
r2215 r2216 126 126 127 127 # Check plugins and themes update from repository 128 function dc_check_ repository_update($mod, $url, $img, $icon)129 { 130 $repo = new dc Repository($mod, $url);128 function dc_check_store_update($mod, $url, $img, $icon) 129 { 130 $repo = new dcStore($mod, $url); 131 131 $upd = $repo->get(true); 132 132 if (!empty($upd)) { … … 137 137 } 138 138 if (isset($__dashboard_icons['plugins'])) { 139 dc_check_ repository_update($core->plugins, $core->blog->settings->system->repository_plugin_url, 'plugins', $__dashboard_icons['plugins']);139 dc_check_store_update($core->plugins, $core->blog->settings->system->store_plugin_url, 'plugins', $__dashboard_icons['plugins']); 140 140 } 141 141 if (isset($__dashboard_icons['blog_theme'])) { 142 142 $themes = new dcThemes($core); 143 143 $themes->loadModules($core->blog->themes_path, null); 144 dc_check_ repository_update($themes, $core->blog->settings->system->repository_theme_url, 'blog-theme', $__dashboard_icons['blog_theme']);144 dc_check_store_update($themes, $core->blog->settings->system->store_theme_url, 'blog-theme', $__dashboard_icons['blog_theme']); 145 145 } 146 146 -
admin/plugins.php
r2215 r2216 21 21 ); 22 22 } 23 if ($core->blog->settings->system-> repository_plugin_url === null) {23 if ($core->blog->settings->system->store_plugin_url === null) { 24 24 $core->blog->settings->system->put( 25 ' repository_plugin_url', 'http://update.dotaddict.org/dc2/plugins.xml', 'string', 'Plugins XML feed location', true, true25 'store_plugin_url', 'http://update.dotaddict.org/dc2/plugins.xml', 'string', 'Plugins XML feed location', true, true 26 26 ); 27 27 } … … 31 31 $core->plugins, 32 32 DC_PLUGINS_ROOT, 33 $core->blog->settings->system-> repository_plugin_url33 $core->blog->settings->system->store_plugin_url 34 34 ); 35 35 … … 156 156 157 157 # Updated modules from repo 158 $modules = $list-> repository->get(true);158 $modules = $list->store->get(true); 159 159 if (!empty($modules)) { 160 160 echo … … 225 225 # New modules from repo 226 226 $search = $list->getSearchQuery(); 227 $modules = $search ? $list-> repository->search($search) : $list->repository->get();227 $modules = $search ? $list->store->search($search) : $list->store->get(); 228 228 229 229 if (!empty($search) || !empty($modules)) { -
admin/services.php
r2215 r2216 465 465 } 466 466 elseif ($list == 'plugin-new') { 467 $ repository = new dcRepository(467 $store = new dcStore( 468 468 $core->plugins, 469 $core->blog->settings->system-> repository_plugin_url469 $core->blog->settings->system->store_plugin_url 470 470 ); 471 $ repository->check();472 473 $modules = $ repository->get();471 $store->check(); 472 473 $modules = $store->get(); 474 474 if (empty($modules) || !isset($modules[$id])) { 475 475 throw new Exception('Unknow module ID'); -
inc/admin/lib.moduleslist.php
r2215 r2216 16 16 public $core; 17 17 public $modules; 18 public $ repository;18 public $store; 19 19 20 20 public static $allow_multi_install = false; … … 47 47 $this->core = $modules->core; 48 48 $this->modules = $modules; 49 $this-> repository = new dcRepository($modules, $xml_url);49 $this->store = new dcStore($modules, $xml_url); 50 50 51 51 $this->setPathInfo($modules_root); … … 231 231 } 232 232 233 /** @todo Use new mesasge system **/ 233 234 public function displayMessage($action) 234 235 { … … 487 488 } break; 488 489 489 # Install (from repository)490 # Install (from store) 490 491 case 'install': if ($this->path_writable) { 491 492 $submits[] = … … 493 494 } break; 494 495 495 # Update (from repository)496 # Update (from store) 496 497 case 'update': if ($this->path_writable) { 497 498 $submits[] = … … 591 592 elseif (!empty($_POST['install'])) { 592 593 593 $updated = $this-> repository->get();594 $updated = $this->store->get(); 594 595 if (!isset($updated[$id])) { 595 596 throw new Exception(__('No such module.')); … … 604 605 $this->core->callBehavior($prefix.'BeforeAdd', $module); 605 606 606 $ret_code = $this-> repository->process($module['file'], $dest);607 $ret_code = $this->store->process($module['file'], $dest); 607 608 608 609 # --BEHAVIOR-- moduleAfterAdd … … 614 615 elseif (!empty($_POST['update'])) { 615 616 616 $updated = $ repository->get();617 $updated = $store->get(); 617 618 if (!isset($updated[$id])) { 618 619 throw new Exception(__('No such module.')); … … 639 640 $this->core->callBehavior($prefix.'BeforeUpdate', $module); 640 641 641 $this-> repository->process($module['file'], $dest);642 $this->store->process($module['file'], $dest); 642 643 643 644 # --BEHAVIOR-- moduleAfterUpdate … … 666 667 $url = urldecode($_POST['pkg_url']); 667 668 $dest = $this->getPath().'/'.basename($url); 668 $this-> repository->download($url, $dest);669 $this->store->download($url, $dest); 669 670 } 670 671 … … 672 673 $this->core->callBehavior($prefix.'BeforeAdd', null); 673 674 674 $ret_code = $this-> repository->install($dest);675 $ret_code = $this->store->install($dest); 675 676 676 677 # --BEHAVIOR-- moduleAfterAdd … … 861 862 $has_parent = !empty($module['parent']); 862 863 if ($has_parent) { 863 $is_parent_present = $this-> core->themes->moduleExists($parent);864 $is_parent_present = $this->modules->moduleExists($parent); 864 865 } 865 866 -
inc/core/class.dc.store.parser.php
r2214 r2216 18 18 Provides an object to parse XML feed of modules from a repository. 19 19 */ 20 class dc RepositoryParser20 class dcStoreParser 21 21 { 22 22 /** @var object XML object of feed contents */ … … 30 30 * Constructor. 31 31 * 32 * @param string Feed content32 * @param string $data Feed content 33 33 */ 34 34 public function __construct($data) -
inc/core/class.dc.store.php
r2215 r2216 18 18 Provides an object to parse XML feed of modules from repository. 19 19 */ 20 class dc Repository20 class dcStore 21 21 { 22 22 /** @var object dcCore instance */ … … 59 59 return false; 60 60 } 61 if (($parser = dc RepositoryReader::quickParse($this->xml_url, DC_TPL_CACHE, $force)) === false) {61 if (($parser = dcStoreReader::quickParse($this->xml_url, DC_TPL_CACHE, $force)) === false) { 62 62 return false; 63 63 } … … 116 116 * 117 117 * Every time a part of query is find on module, 118 * result accuracy grow. Result is sorted by ac uracy.118 * result accuracy grow. Result is sorted by accuracy. 119 119 * 120 120 * @param string $pattern String to search … … 127 127 # Split query into small clean words 128 128 $patterns = explode(' ', $pattern); 129 array_walk($patterns, array('dc Repository','sanitize'));129 array_walk($patterns, array('dcStore','sanitize')); 130 130 131 131 # For each modules … … 134 134 # Split modules infos into small clean word 135 135 $subjects = explode(' ', $id.' '.$module['name'].' '.$module['desc']); 136 array_walk($subjects, array('dc Repository','sanitize'));136 array_walk($subjects, array('dcStore','sanitize')); 137 137 138 138 # Check contents -
inc/core/class.dc.store.reader.php
r2214 r2216 19 19 This class extends clearbricks netHttp class. 20 20 */ 21 class dc RepositoryReader extends netHttp21 class dcStoreReader extends netHttp 22 22 { 23 23 /** @var string User agent used to query repository */ … … 53 53 * 54 54 * @param string $url XML feed URL 55 * @return object dc Repositoryinstance55 * @return object dcStore instance 56 56 */ 57 57 public function parse($url) … … 66 66 } 67 67 68 return new dc RepositoryParser($this->getContent());68 return new dcStoreParser($this->getContent()); 69 69 } 70 70 … … 123 123 124 124 /** 125 * Set force query reposi ory.125 * Set force query repository. 126 126 * 127 127 * @param boolean $force True to force query … … 202 202 # Ok, parse feed 203 203 case '200': 204 if ($modules = new dc RepositoryParser($this->getContent())) {204 if ($modules = new dcStoreParser($this->getContent())) { 205 205 try { 206 206 files::makeDir(dirname($cached_file), true); -
inc/prepend.php
r2147 r2216 46 46 $__autoload['dcWorkspace'] = dirname(__FILE__).'/core/class.dc.workspace.php'; 47 47 $__autoload['dcPrefs'] = dirname(__FILE__).'/core/class.dc.prefs.php'; 48 $__autoload['dc Repository'] = dirname(__FILE__).'/core/class.dc.repository.php';49 $__autoload['dc RepositoryReader'] = dirname(__FILE__).'/core/class.dc.repository.reader.php';50 $__autoload['dc RepositoryParser'] = dirname(__FILE__).'/core/class.dc.repository.parser.php';48 $__autoload['dcStore'] = dirname(__FILE__).'/core/class.dc.store.php'; 49 $__autoload['dcStoreReader'] = dirname(__FILE__).'/core/class.dc.store.reader.php'; 50 $__autoload['dcStoreParser'] = dirname(__FILE__).'/core/class.dc.store.parser.php'; 51 51 52 52 $__autoload['rsExtPost'] = dirname(__FILE__).'/core/class.dc.rs.extensions.php';
Note: See TracChangeset
for help on using the changeset viewer.