Changeset 2216:91f485a16187 for inc
- Timestamp:
- 10/02/13 17:47:15 (12 years ago)
- Branch:
- dcRepo
- Location:
- inc
- Files:
-
- 2 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
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.