mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
Rename all common/framework source files to be case-sensitive
This commit is contained in:
parent
60fd7d7cf2
commit
0029d1a1ec
73 changed files with 5 additions and 5 deletions
|
|
@ -1,62 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Rhymix\Framework\Parsers;
|
||||
|
||||
/**
|
||||
* Editor component (info.xml) parser class for XE compatibility.
|
||||
*/
|
||||
class EditorComponentParser extends BaseParser
|
||||
{
|
||||
/**
|
||||
* Load an XML file.
|
||||
*
|
||||
* @param string $filename
|
||||
* @param string $component_name
|
||||
* @param string $lang
|
||||
* @return object|false
|
||||
*/
|
||||
public static function loadXML(string $filename, string $component_name, string $lang = '')
|
||||
{
|
||||
// Load the XML file.
|
||||
$xml = simplexml_load_string(file_get_contents($filename));
|
||||
if ($xml === false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the current language.
|
||||
$lang = $lang ?: (\Context::getLangType() ?: 'en');
|
||||
|
||||
// Initialize the module definition.
|
||||
$info = new \stdClass;
|
||||
$info->component_name = $component_name;
|
||||
|
||||
// Get basic information.
|
||||
$info->title = self::_getChildrenByLang($xml, 'title', $lang);
|
||||
$info->description = self::_getChildrenByLang($xml, 'description', $lang);
|
||||
$info->version = trim($xml->version);
|
||||
$info->date = date('Ymd', strtotime($xml->date . 'T12:00:00Z'));
|
||||
$info->homepage = trim($xml->homepage);
|
||||
$info->license = trim($xml->license);
|
||||
$info->license_link = trim($xml->license['link']);
|
||||
$info->author = array();
|
||||
|
||||
foreach ($xml->author as $author)
|
||||
{
|
||||
$author_info = new \stdClass;
|
||||
$author_info->name = self::_getChildrenByLang($author, 'name', $lang);
|
||||
$author_info->email_address = trim($author['email_address']);
|
||||
$author_info->homepage = trim($author['link']);
|
||||
$info->author[] = $author_info;
|
||||
}
|
||||
|
||||
// Get extra_vars.
|
||||
if ($xml->extra_vars)
|
||||
{
|
||||
$info->extra_vars = self::_getExtraVars($xml->extra_vars, $lang);
|
||||
}
|
||||
|
||||
// Return the complete result.
|
||||
return $info;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue