Dotclear 2.26
Loading...
Searching...
No Matches
dcStore Class Reference

Public Member Functions

 __construct (dcModules $modules, string $xml_url, bool $force=false)
 
 check (bool $force=false)
 
 getDefines (bool $update=false)
 
 get (bool $update=false)
 
 searchDefines (string $pattern)
 
 search (string $pattern)
 
 process (string $url, string $dest)
 
 download (string $url, string $dest)
 
 install (string $path)
 
 agent (string $str)
 

Data Fields

 $modules
 

Static Public Attributes

static $weighting
 

Protected Attributes

 $user_agent = 'DotClear.org RepoBrowser/0.1'
 
 $xml_url
 
 $data
 
 $defines
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( dcModules  $modules,
string  $xml_url,
bool  $force = false 
)

Constructor.

Parameters
dcModules$modulesdcModules instance
string$xml_urlXML feed URL
bool$forceForce query repository

References $modules, $xml_url, check(), and DC_VERSION.

Member Function Documentation

◆ check()

check ( bool  $force = false)

Check repository.

Parameters
bool$forceForce query repository
Returns
bool True if get feed or cache

References DC_ALLOW_REPOSITORIES, DC_STORE_NOT_UPDATE, DC_TPL_CACHE, dcStoreReader\quickParse(), and dcUtils\versionsCompare().

Referenced by __construct().

◆ getDefines()

getDefines ( bool  $update = false)

Get a list of modules.

Parameters
bool$updateTrue to get update modules, false for new ones
Returns
array List of update/new modules defines

◆ get()

get ( bool  $update = false)

Get a list of modules.

Deprecated:
since 2.26 Use self::getDefines()
Parameters
bool$updateTrue to get update modules, false for new ones
Returns
array List of update/new modules

References Deprecated\set().

◆ searchDefines()

searchDefines ( string  $pattern)

Search a module.

Search string is cleaned, split and compare to split:

  • module id and clean id,
  • module name, clean name,
  • module desccription.

Every time a part of query is find on module, result accuracy grow. Result is sorted by accuracy.

Parameters
string$patternString to search
Returns
array Match modules defines

References $defines.

Referenced by search().

◆ search()

search ( string  $pattern)

Search a module.

Deprecated:
since 2.26 Use self::searchDefines()
Parameters
string$patternString to search
Returns
array Match modules

References searchDefines(), and Deprecated\set().

◆ process()

process ( string  $url,
string  $dest 
)

Quick download and install module.

Parameters
string$urlModule package URL
string$destPath to install module
Returns
int dcModules::PACKAGE_INSTALLED (1), dcModules::PACKAGE_UPDATED (2)

References download(), and install().

◆ download()

download ( string  $url,
string  $dest 
)

Download a module.

Parameters
string$urlModule package URL
string$destPath to put module package

Referenced by process().

◆ install()

install ( string  $path)

Install a previously downloaded module.

Parameters
string$pathPath to module package
Returns
int 1 = installed, 2 = update

References dcModules\installPackage().

Referenced by process().

◆ agent()

agent ( string  $str)

User Agent String.

Parameters
string$strUser agent string

Field Documentation

◆ $modules

$modules

Referenced by __construct().

◆ $weighting

$weighting
static
Initial value:
= [
'id' => 10,
'name' => 8,
'tags' => 6,
'desc' => 4,
'author' => 2,
]

◆ $user_agent

$user_agent = 'DotClear.org RepoBrowser/0.1'
protected

◆ $xml_url

$xml_url
protected

Referenced by __construct().

◆ $data

$data
protected
Initial value:
= [
'new' => [],
'update' => [],
]

◆ $defines

$defines
protected
Initial value:
= [
'new' => [],
'update' => [],
]

Referenced by searchDefines().


The documentation for this class was generated from the following file: