本文整理汇总了PHP中ExtensionManager类的典型用法代码示例。如果您正苦于以下问题:PHP ExtensionManager类的具体用法?PHP ExtensionManager怎么用?PHP ExtensionManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ExtensionManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: smarty_function_loadExtension
function smarty_function_loadExtension($params, &$smarty)
{
//fetch plugin name
$extName = $params['name'];
$config =& $params['config'];
if (empty($extName)) {
return "No Extension selected";
}
$extParams = array();
if (isset($params['params'])) {
//Explode Params
$tmpParams = explode(",", $params['params']);
foreach ($tmpParams as $val) {
$para = explode("=", $val);
$extParams[trim($para[0])] = trim($para[1]);
}
}
// now we got the name and the params so lets include and pass
require_once $config->miplexDir . "ExtensionManager.class.php";
$extManager = new ExtensionManager($config);
$ext = $extManager->loadExtension($extName);
if ($ext != false) {
return $ext->main($extParams);
} else {
return "Plugin not Found";
}
}
开发者ID:BackupTheBerlios,项目名称:miplex2-svn,代码行数:27,代码来源:function.loadExtension.php
示例2: evaluateExtension
/**
* Evaluate Extension by getting the name and the params
* ###mailform(param=value, param=value)###
*
* @param String $string The content to parse
*/
function evaluateExtension($string)
{
$regex = "/###Ext:(.*)###/";
$regex2 = "/^(.*)\\((.*)\\)\$/";
preg_match($regex, $string, $matches);
if (!empty($matches[1])) {
preg_match($regex2, $matches[1], $params);
if (!empty($params[1])) {
$extName = $params[1];
$tmpParams = $params[2];
//Explode Params
$tmpParams = explode(",", $tmpParams);
foreach ($tmpParams as $val) {
$para = explode("=", $val);
$extParams[trim($para[0])] = trim($para[1]);
}
//now we got the name and the params so lets include and pass
require_once $this->config->miplexDir . "ExtensionManager.class.php";
$extManager = new ExtensionManager($this->config);
$ext = $extManager->loadExtension($extName);
if ($ext != false) {
$ret = $ext->main($extParams);
$this->ext = 1;
} else {
$ret = "Plugin not Found";
}
$string = preg_replace($regex, $ret, $string);
}
}
return $string;
}
开发者ID:BackupTheBerlios,项目名称:miplex2-svn,代码行数:37,代码来源:PageObject.class.php
示例3: update
/**
* Update function
*/
public function update()
{
// Support for the multilanguage extension by Giel Berkers:
// http://github.com/kanduvisla/multilanguage
//
// See if the multilingual extension is installed:
require_once TOOLKIT . '/class.extensionmanager.php';
$extensionManager = new ExtensionManager($this);
$status = $extensionManager->fetchStatus('multilanguage');
if ($status == EXTENSION_ENABLED) {
// Append some extra rows to the search-index table:
$languages = explode(',', file_get_contents(MANIFEST . '/multilanguage-languages'));
// Check which fields exist:
$columns = Symphony::Database()->fetch("SHOW COLUMNS FROM `tbl_search_index`");
$fields = array();
foreach ($columns as $column) {
$fields[] = $column['Field'];
}
foreach ($languages as $language) {
$field = 'data_' . $language;
if (!in_array($field, $fields)) {
Administration::instance()->Database->query("ALTER TABLE `tbl_search_index` ADD `" . $field . "` TEXT, ADD FULLTEXT (`" . $field . "`)");
}
}
}
// End Support
}
开发者ID:TwistedInteractive,项目名称:search_index,代码行数:30,代码来源:extension.driver.php
示例4: listAll
function listAll()
{
$result = array();
$people = array();
$structure = General::listStructure(TEXTFORMATTERS, '/formatter.[\\w-]+.php/', false, 'ASC', TEXTFORMATTERS);
if (is_array($structure['filelist']) && !empty($structure['filelist'])) {
foreach ($structure['filelist'] as $f) {
$f = str_replace(array('formatter.', '.php'), '', $f);
$result[$f] = $this->about($f);
}
}
$extensionManager = new ExtensionManager($this->_Parent);
$extensions = $extensionManager->listInstalledHandles();
if (is_array($extensions) && !empty($extensions)) {
foreach ($extensions as $e) {
if (!is_dir(EXTENSIONS . "/{$e}/text-formatters")) {
continue;
}
$tmp = General::listStructure(EXTENSIONS . "/{$e}/text-formatters", '/formatter.[\\w-]+.php/', false, 'ASC', EXTENSIONS . "/{$e}/text-formatters");
if (is_array($tmp['filelist']) && !empty($tmp['filelist'])) {
foreach ($tmp['filelist'] as $f) {
$f = preg_replace(array('/^formatter./i', '/.php$/i'), '', $f);
$result[$f] = $this->about($f);
}
}
}
}
ksort($result);
return $result;
}
开发者ID:bauhouse,项目名称:sym-form-builder,代码行数:30,代码来源:class.textformattermanager.php
示例5: __construct
function __construct(&$parent)
{
parent::__construct($parent);
$this->setTitle('Symphony – Member Roles');
$ExtensionManager = new ExtensionManager($parent);
$this->_driver = $ExtensionManager->create('members');
}
开发者ID:bauhouse,项目名称:sym-spectrum-members,代码行数:7,代码来源:content.roles.php
示例6: testGetException
/**
* @dataProvider getExceptionProvider
*/
function testGetException($extensions, $type, $name, $exxceptionName)
{
$this->setExpectedException($exxceptionName);
$manager = new ExtensionManager();
foreach ($extensions as $extension) {
$manager->addExtension($extension['instance'], $extension['type']);
}
$manager->getExtension($type, $name);
}
开发者ID:kriswillis,项目名称:sulu,代码行数:12,代码来源:ExtensionManagerTest.php
示例7: __construct
function __construct(&$parent)
{
parent::__construct($parent);
$this->_name = 'Member: Role';
// Set default
$this->set('show_column', 'no');
$ExtensionManager = new ExtensionManager($this->_engine);
$this->_driver = $ExtensionManager->create('members');
}
开发者ID:bauhouse,项目名称:sym-spectrum-members,代码行数:9,代码来源:field.memberrole.php
示例8: build
/**
* Mediathek and Subsection Manager cannot be used simultaneously:
* This page deactivates one of these two extensions based on the context and returns to the extension overview.
*/
public function build($context)
{
$ExtensionManager = new ExtensionManager(Administration::instance());
// Deactivate extension
if ($context[0] == 'mediathek' || $context[0] == 'subsectionmanager') {
$ExtensionManager->disable($context[0]);
}
// Return to extension overview
redirect(URL . '/symphony/system/extensions/');
}
开发者ID:pointybeard,项目名称:subsectionmanager,代码行数:14,代码来源:content.deactivate.php
示例9: listAll
function listAll()
{
$result = array();
$people = array();
$structure = General::listStructure(EVENTS, '/event.[\\w-]+.php/', false, 'ASC', EVENTS);
if (is_array($structure['filelist']) && !empty($structure['filelist'])) {
foreach ($structure['filelist'] as $f) {
$f = self::__getHandleFromFilename($f);
//preg_replace(array('/^event./i', '/.php$/i'), '', $f);
if ($about = $this->about($f)) {
$classname = $this->__getClassName($f);
$path = $this->__getDriverPath($f);
$can_parse = false;
$type = NULL;
if (is_callable(array($classname, 'allowEditorToParse'))) {
$can_parse = @call_user_func(array(&$classname, 'allowEditorToParse'));
}
if (is_callable(array($classname, 'getType'))) {
$type = @call_user_func(array(&$classname, 'getType'));
}
$about['can_parse'] = $can_parse;
$about['type'] = $type;
$result[$f] = $about;
}
}
}
//$structure = General::listStructure(EXTENSIONS, array(), false, 'ASC', EXTENSIONS);
//$extensions = $structure['dirlist'];
$extensionManager = new ExtensionManager($this->_Parent);
$extensions = $extensionManager->listInstalledHandles();
if (is_array($extensions) && !empty($extensions)) {
foreach ($extensions as $e) {
if (!is_dir(EXTENSIONS . "/{$e}/events")) {
continue;
}
$tmp = General::listStructure(EXTENSIONS . "/{$e}/events", '/event.[\\w-]+.php/', false, 'ASC', EXTENSIONS . "/{$e}/events");
if (is_array($tmp['filelist']) && !empty($tmp['filelist'])) {
foreach ($tmp['filelist'] as $f) {
$f = $f = self::__getHandleFromFilename($f);
if ($about = $this->about($f)) {
$classname = $this->__getClassName($f);
$can_parse = false;
$type = NULL;
$about['can_parse'] = $can_parse;
$about['type'] = $type;
$result[$f] = $about;
}
}
}
}
}
ksort($result);
return $result;
}
开发者ID:bauhouse,项目名称:sym-fluidgrids,代码行数:54,代码来源:class.eventmanager.php
示例10: __construct
public function __construct(\ExtensionManager $extensionManager, UserAccountModel $user)
{
foreach ($extensionManager->getExtensionsIncludingCore() as $extension) {
$extID = $extension->getId();
foreach ($extension->getUserNotificationPreferenceTypes() as $type) {
$key = str_replace(".", "_", $extID . '.' . $type);
$this->preferences[$key] = $extension->getUserNotificationPreference($type);
}
}
$this->user = $user;
}
开发者ID:radical-assembly,项目名称:OpenACalendar-Web-Core,代码行数:11,代码来源:UserEmailsForm.php
示例11: __trigger
protected function __trigger()
{
$ExtensionManager = new ExtensionManager($this->_Parent);
$driver = $ExtensionManager->create('members');
$email = $_POST['member-email-address'];
if ($members = $driver->findMemberIDFromEmail($email)) {
foreach ($members as $member_id) {
$driver->sendForgotPasswordEmail($member_id);
}
}
return new XMLElement('forgot-password', 'Email sent', array('sent' => 'true'));
}
开发者ID:bauhouse,项目名称:sym-spectrum-members,代码行数:12,代码来源:event.forgot_password.php
示例12: build
/**
* Download language file
*/
function build($context)
{
// Get context
$name = $context[2];
$lang = $context[1];
$context = $context[0];
// Get localisation strings
$data = $this->LocalisationManager->buildDictionary($context, $lang, $name);
// Load template
$path = EXTENSIONS . '/localisationmanager/lib';
if ($context == 'symphony') {
$template = file_get_contents($path . '/lang.core.tpl');
} else {
$template = file_get_contents($path . '/lang.extension.tpl');
}
// Add data
$template = str_replace('<!-- $name -->', $data['about']['name'], $template);
$template = str_replace('<!-- $author -->', $data['about']['author']['name'], $template);
$template = str_replace('<!-- $email -->', $data['about']['author']['email'], $template);
$template = str_replace('<!-- $website -->', $data['about']['author']['website'], $template);
$template = str_replace('<!-- $date -->', $data['about']['release-date'], $template);
if ($context != 'symphony') {
$ExtensionManager = new ExtensionManager($this->parent);
$extensions = $ExtensionManager->listAll();
$template = str_replace('<!-- $extension -->', $extensions[$context]['name'], $template);
}
$template = str_replace('<!-- $strings -->', $this->__layout($data['dictionary']['strings']), $template);
$template = str_replace('<!-- $obsolete -->', $this->__layout($data['dictionary']['obsolete'], 'Obsolete'), $template);
$template = str_replace('<!-- $missing -->', $this->__layout($data['dictionary']['missing'], 'Missing'), $template);
$template = str_replace('<!-- $namespaces -->', $this->__layoutNamespace($data['dictionary']['namespaces']), $template);
if ($context == 'symphony') {
$template = str_replace('<!-- $uppercase -->', $this->__transliterations($data['transliterations']['straight']['uppercase'], 5), $template);
$template = str_replace('<!-- $lowercase -->', $this->__transliterations($data['transliterations']['straight']['lowercase'], 5), $template);
$template = str_replace('<!-- $symbolic -->', $this->__transliterations($data['transliterations']['straight']['symbolic'], 3), $template);
$template = str_replace('<!-- $special -->', $this->__transliterations($data['transliterations']['straight']['special']), $template);
$template = str_replace('<!-- $otherstraight -->', $this->__transliterations($data['transliterations']['straight']['other']), $template);
$template = str_replace('<!-- $ampersands -->', $this->__transliterations($data['transliterations']['regexp']['ampersands']), $template);
$template = str_replace('<!-- $otherregexp -->', $this->__transliterations($data['transliterations']['regexp']['other']), $template);
}
// Send file
header('Content-Type: application/x-php; charset=utf-8');
header('Content-Disposition: attachment; filename="lang.' . ($lang ? $lang : 'new') . '.php"');
header("Content-Description: File Transfer");
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
echo $template;
exit;
}
开发者ID:symphonists,项目名称:localisationmanager,代码行数:51,代码来源:content.download.php
示例13: __indexPage
private function __indexPage()
{
// Create the XML for the page:
$xml = new XMLElement('data');
$sectionsNode = new XMLElement('sections');
$sm = new SectionManager($this);
$sections = $sm->fetch();
foreach ($sections as $section) {
$sectionsNode->appendChild(new XMLElement('section', $section->get('name'), array('id' => $section->get('id'))));
}
$xml->appendChild($sectionsNode);
// Check if the multilingual-field extension is installed:
if (in_array('multilingual_field', ExtensionManager::listInstalledHandles())) {
$xml->setAttribute('multilanguage', 'yes');
// Get all the multilanguage fields:
$fm = new FieldManager($this);
$fields = $fm->fetch(null, null, 'ASC', 'sortorder', 'multilingual');
$multilanguage = new XMLElement('multilanguage');
foreach ($fields as $field) {
$sectionID = $field->get('parent_section');
$section = $sm->fetch($sectionID);
$id = $field->get('id');
$label = $section->get('name') . ' : ' . $field->get('label');
$multilanguage->appendChild(new XMLElement('field', $label, array('id' => $id)));
}
$xml->appendChild($multilanguage);
}
// Generate the HTML:
$xslt = new XSLTPage();
$xslt->setXML($xml->generate());
$xslt->setXSL(EXTENSIONS . '/importcsv/content/index.xsl', true);
$this->Form->setValue($xslt->generate());
$this->Form->setAttribute('enctype', 'multipart/form-data');
}
开发者ID:michael-e,项目名称:importcsv,代码行数:34,代码来源:content.index.php
示例14: sort
public function sort(&$sort, &$order, $params)
{
if (is_null($sort)) {
$sort = 'name';
}
return ExtensionManager::fetch(array(), array(), $sort . ' ' . $order);
}
开发者ID:roshinebagha,项目名称:Symphony-Test,代码行数:7,代码来源:content.systemextensions.php
示例15: __find
function __find($type)
{
if (@is_file(TOOLKIT . "/fields/field.{$type}.php")) {
return TOOLKIT . '/fields';
} else {
$extensionManager = new ExtensionManager($this->_Parent);
$extensions = $extensionManager->listInstalledHandles();
if (is_array($extensions) && !empty($extensions)) {
foreach ($extensions as $e) {
if (@is_file(EXTENSIONS . "/{$e}/fields/field.{$type}.php")) {
return EXTENSIONS . "/{$e}/fields";
}
}
}
}
return false;
}
开发者ID:bauhouse,项目名称:sym-fluidgrids,代码行数:17,代码来源:class.fieldmanager.php
示例16: __upgradeMediathek
/**
* Upgrade Mediathek fields to make use of this extension
*/
public function __upgradeMediathek()
{
// Do not use Administration::instance() in this context, see:
// http://github.com/nilshoerrmann/subsectionmanager/issues#issue/27
$callback = $this->_Parent->getPageCallback();
// Append upgrade notice
if ($callback['driver'] == 'systemextensions') {
require_once TOOLKIT . '/class.extensionmanager.php';
$ExtensionManager = new ExtensionManager(Administration::instance());
// Check if Mediathek field is installed
$mediathek = $ExtensionManager->fetchStatus('mediathek');
if ($mediathek == EXTENSION_ENABLED) {
// Append upgrade notice to page
Administration::instance()->Page->Alert = new Alert(__('You are using Mediathek and Subsection Manager simultaneously.') . ' <a href="http://' . DOMAIN . '/symphony/extension/subsectionmanager/">' . __('Upgrade') . '?</a> <a href="http://' . DOMAIN . '/symphony/extension/subsectionmanager/deactivate/mediathek">' . __('Disable Mediathek') . '</a> <a href="http://' . DOMAIN . '/symphony/extension/subsectionmanager/deactivate/subsectionmanager">' . __('Disable Subsection Manager') . '</a>', Alert::ERROR);
}
}
}
开发者ID:pointybeard,项目名称:subsectionmanager,代码行数:20,代码来源:extension.driver.php
示例17: smarty_function_loadExtension
function smarty_function_loadExtension($params, &$smarty)
{
//fetch plugin name
$extName = $params['name'];
$config =& $params['config'];
if (empty($extName)) {
return "No Extension selected";
}
// now we got the name and the params so lets include and pass
require_once $config->miplexDir . "ExtensionManager.class.php";
$extManager = new ExtensionManager($config);
$ext = $extManager->loadExtension($extName);
if ($ext != false) {
return $ext->main($extParams);
} else {
return "Plugin not Found";
}
}
开发者ID:BackupTheBerlios,项目名称:miplex2-svn,代码行数:18,代码来源:function.loadExtension.php
示例18: processEvents
/**
* The processEvents function executes all Events attached to the resolved
* page in the correct order determined by `__findEventOrder()`. The results
* from the Events are appended to the page's XML. Events execute first,
* before Datasources.
*
* @uses FrontendProcessEvents
* @uses FrontendEventPostProcess
* @param string $events
* A string of all the Events attached to this page, comma separated.
* @param XMLElement $wrapper
* The XMLElement to append the Events results to. Event results are
* contained in a root XMLElement that is the handlised version of
* their name.
*/
private function processEvents($events, XMLElement &$wrapper)
{
/**
* Manipulate the events array and event element wrapper
* @delegate FrontendProcessEvents
* @param string $context
* '/frontend/'
* @param array $env
* @param string $events
* A string of all the Events attached to this page, comma separated.
* @param XMLElement $wrapper
* The XMLElement to append the Events results to. Event results are
* contained in a root XMLElement that is the handlised version of
* their name.
* @param array $page_data
* An associative array of page meta data
*/
$this->ExtensionManager->notifyMembers('FrontendProcessEvents', '/frontend/', array('env' => $this->_env, 'events' => &$events, 'wrapper' => &$wrapper, 'page_data' => $this->_pageData));
if (strlen(trim($events)) > 0) {
$events = preg_split('/,\\s*/i', $events, -1, PREG_SPLIT_NO_EMPTY);
$events = array_map('trim', $events);
if (!is_array($events) || empty($events)) {
return;
}
$pool = array();
foreach ($events as $handle) {
$pool[$handle] = $this->EventManager->create($handle, array('env' => $this->_env, 'param' => $this->_param));
}
uasort($pool, array($this, '__findEventOrder'));
foreach ($pool as $handle => $event) {
Frontend::instance()->Profiler->seed();
$dbstats = Symphony::Database()->getStatistics();
$queries = $dbstats['queries'];
if ($xml = $event->load()) {
if (is_object($xml)) {
$wrapper->appendChild($xml);
} else {
$wrapper->setValue($wrapper->getValue() . self::CRLF . ' ' . trim($xml));
}
}
$dbstats = Symphony::Database()->getStatistics();
$queries = $dbstats['queries'] - $queries;
Frontend::instance()->Profiler->sample($handle, PROFILE_LAP, 'Event', $queries);
}
}
/**
* Just after the page events have triggered. Provided with the XML object
* @delegate FrontendEventPostProcess
* @param string $context
* '/frontend/'
* @param XMLElement $xml
* The XMLElement to append the Events results to. Event results are
* contained in a root XMLElement that is the handlised version of
* their name.
*/
$this->ExtensionManager->notifyMembers('FrontendEventPostProcess', '/frontend/', array('xml' => &$wrapper));
}
开发者ID:scottkf,项目名称:keepflippin--on-symphony,代码行数:72,代码来源:class.frontendpage.php
示例19: load
public function load()
{
// In case of the page:
if (isset($_GET['download'])) {
header('Content-Disposition: attachment; filename=' . $_GET['download']);
}
// In case of a file:
if (isset($_GET['file'])) {
// include_once('event.force_download.config.php');
$driver = ExtensionManager::getInstance('force_download');
/* @var $driver extension_force_download */
$allowedDirs = $driver->getLocations();
$pathInfo = pathinfo($_GET['file']);
// Check to see if the directory is allowed to direct-download from:
$wildCardMatch = false;
$info = pathinfo($_GET['file']);
foreach ($allowedDirs as $allowedDir) {
if (strstr($allowedDir, '/*') !== false) {
$match = str_replace('/*', '', $allowedDir);
if (strstr($match, $info['dirname']) !== false) {
$wildCardMatch = true;
}
}
}
if (in_array($pathInfo['dirname'], $allowedDirs) || $wildCardMatch) {
// Force the download:
if (file_exists($_GET['file'])) {
// Determine the mimetype:
if (function_exists('mime_content_type')) {
$mimeType = mime_content_type($_GET['file']);
} elseif (function_exists('finfo_open')) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mimeType = finfo_file($finfo, $_GET['file']);
} else {
$mimeType = "application/force-download";
}
header('Content-Description: File Transfer');
header('Content-Type: ' . $mimeType);
header('Content-Disposition: attachment; filename=' . $pathInfo['basename']);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($_GET['file']));
ob_clean();
flush();
readfile($_GET['file']);
exit;
} else {
die('File does not exist!');
}
} else {
die('Permission denied!');
}
}
}
开发者ID:andrewminton,项目名称:force_download,代码行数:56,代码来源:event.force_download.php
示例20: __construct
public function __construct()
{
parent::__construct();
$this->_name = 'Entry URL';
$this->_driver = ExtensionManager::create('entry_url_field');
// Set defaults:
$this->set('show_column', 'no');
$this->set('new_window', 'no');
$this->set('hide', 'no');
}
开发者ID:symphonists,项目名称:entry_url_field,代码行数:10,代码来源:field.entry_url.php
注:本文中的ExtensionManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论