当前位置: 首页>>代码示例>>PHP>>正文


PHP F::addClassConstructor方法代码示例

本文整理汇总了PHP中F::addClassConstructor方法的典型用法代码示例。如果您正苦于以下问题:PHP F::addClassConstructor方法的具体用法?PHP F::addClassConstructor怎么用?PHP F::addClassConstructor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在F的用法示例。


在下文中一共展示了F::addClassConstructor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

$app->registerHook('BeforePageDisplay', 'PlacesHooks', 'onBeforePageDisplay');
$app->registerHook('ArticleSaveComplete', 'PlacesHooks', 'onArticleSaveComplete');
$app->registerHook('RTEUseDefaultPlaceholder', 'PlacesHooks', 'onRTEUseDefaultPlaceholder');
$app->registerHook('OutputPageBeforeHTML', 'PlacesHooks', 'onOutputPageBeforeHTML');
$app->registerHook('PageHeaderIndexExtraButtons', 'PlacesHooks', 'onPageHeaderIndexExtraButtons');
$app->registerHook('EditPage::showEditForm:initial', 'PlacesHooks', 'onShowEditForm');
// for later
// $app->registerHook('OutputPageMakeCategoryLinks', 'PlacesHooks', 'onOutputPageMakeCategoryLinks');
/**
 * API module
 */
$wgAPIModules['places'] = 'WikiaApiPlaces';
/**
 * messages
 */
$app->registerExtensionMessageFile('Places', $dir . '/Places.i18n.php');
F::build('JSMessages')->registerPackage('Places', array('places-toolbar-button-*', 'places-editor-*', 'ok'));
F::build('JSMessages')->registerPackage('PlacesEditPageButton', array('places-toolbar-button-tooltip'));
F::build('JSMessages')->registerPackage('PlacesGeoLocationModal', array('places-geolocation-modal-*'));
/**
 * constructors
 */
F::addClassConstructor('PlacesCategoryController', array('app' => $app));
F::addClassConstructor('PlacesController', array('app' => $app));
F::addClassConstructor('PlaceStorage', array(), 'newFromId');
/*
 * user rights
 */
$wgAvailableRights[] = 'places-enable-category-geolocation';
$wgGroupPermissions['*']['places-enable-category-geolocation'] = false;
$wgGroupPermissions['sysop']['places-enable-category-geolocation'] = true;
开发者ID:schwarer2006,项目名称:wikia,代码行数:31,代码来源:Places.setup.php

示例2: testMoreLikeThis

 public function testMoreLikeThis()
 {
     $mockClient = $this->getMock('Solarium_Client', array('createMoreLikeThis', 'moreLikeThis'));
     $defaultMltMethods = array('setMltFields', 'setFields', 'addParam', 'setStart', 'setRows', 'setDocumentClass');
     $addtlMltMethods = array('setInterestingTerms', 'addFilterQuery', 'setQuery', 'addParam');
     $mockMoreLikeThis = $this->getMock('Solarium_Query_MoreLikeThis', $defaultMltMethods + $addtlMltMethods);
     $mockResponse = $this->getMock('Solarium_Client_Response', array(), array('', array()));
     $mockMltResult = $this->getMock('Solarium_Result_MoreLikeThis', array(), array($mockClient, $mockMoreLikeThis, $mockResponse));
     $wikiaSearch = F::build('WikiaSearch', array($mockClient));
     $searchConfig = F::build('WikiaSearchConfig');
     $mockResultSet = $this->getMock('stdClass', array(), array(), 'WikiaSearchResultSet');
     $method = new ReflectionMethod('WikiaSearch', 'moreLikeThis');
     $method->setAccessible(true);
     $searchConfig->setMltFields(array('title', 'html'));
     $e = null;
     try {
         $method->invoke($wikiaSearch, $searchConfig);
     } catch (Exception $e) {
     }
     $this->assertNotNull($e, 'WikiaSearch::moreLikeThis should throw an exception if a query, stream body, or stream url has not been set.');
     $mockClient->expects($this->any())->method('createMoreLikeThis')->will($this->returnValue($mockMoreLikeThis));
     foreach ($defaultMltMethods as $mltMethod) {
         $mockMoreLikeThis->expects($this->any())->method($mltMethod)->will($this->returnValue($mockMoreLikeThis));
     }
     $this->mockClass('Solarium_Query_MoreLikeThis', $mockMoreLikeThis);
     $this->mockClass('WikiaSearchResultSet', $mockResultSet);
     $this->mockClass('Solarium_Client_Response', $mockResponse);
     $this->mockClass('Solarium_Result_MoreLikeThis', $mockMltResult);
     $this->mockApp();
     F::setInstance('WikiaSearchResultSet', $mockResultSet);
     F::setInstance('Solarium_Client', $mockClient);
     F::addClassConstructor('WikiaSearch', array('client' => $mockClient));
     $wikiaSearch = F::build('WikiaSearch');
     $searchConfig->setStreamBody('foo')->setInterestingTerms('list');
     $this->assertInstanceOf('WikiaSearchResultSet', $method->invoke($wikiaSearch, $searchConfig), 'WikiaSearch::moreLikeThis should return an instance of WikiaSearchResultSet');
     $searchConfig->setStreamBody(false)->setQuery('foo')->setInterestingTerms(false);
     $this->assertInstanceOf('WikiaSearchResultSet', $method->invoke($wikiaSearch, $searchConfig), 'WikiaSearch::moreLikeThis should return an instance of WikiaSearchResultSet, even if the client throws an exception.');
     $searchConfig->setStreamUrl('http://foo.com')->setMltFilterQuery('foo:bar');
     $this->assertInstanceOf('WikiaSearchResultSet', $method->invoke($wikiaSearch, $searchConfig), 'WikiaSearch::moreLikeThis should return an instance of WikiaSearchResultSet, even if the client throws an exception.');
     // lots more to do for this one, but the dependencies are really hard.
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:41,代码来源:WikiaSearchTest.php

示例3: array

<?php

/**
 * Emails storage
 *
 * Provides storage for user emails for various engagement projects
 */
$wgExtensionCredits['specialpage'][] = array('name' => 'Emails storage', 'version' => '1.0', 'author' => 'Maciej Brencz', 'descriptionmsg' => 'emailsstorage-desc');
$dir = dirname(__FILE__);
// WikiaApp
$app = F::app();
// autoloaded classes
$app->registerClass('EmailsStorage', "{$dir}/EmailsStorage.class.php");
$app->registerClass('EmailsStorageEntry', "{$dir}/EmailsStorageEntry.class.php");
$app->registerClass('EmailsStorageSpecialController', "{$dir}/EmailsStorageSpecialController.php");
$app->registerSpecialPage('Emails', 'EmailsStorageSpecialController');
// i18n
$wgExtensionMessagesFiles['EmailsStorage'] = "{$dir}/EmailsStorage.i18n.php";
F::addClassConstructor('EmailsStorage', array('app' => $app));
// rights
$wgAvailableRights[] = 'emailsstorage';
$wgGroupPermissions['staff']['emailsstorage'] = true;
开发者ID:schwarer2006,项目名称:wikia,代码行数:22,代码来源:EmailsStorage.setup.php

示例4: array

 */
$app->registerClass('StructuredDataAPIClient', $dir . 'StructuredDataAPIClient.class.php');
$app->registerClass('StructuredData', $dir . 'StructuredData.class.php');
$app->registerClass('SDObject', $dir . 'SDObject.class.php');
$app->registerClass('SDElement', $dir . 'SDElement.class.php');
$app->registerClass('SDElementProperty', $dir . 'SDElementProperty.class.php');
$app->registerClass('SDElementRendererFactory', $dir . 'SDElementRendererFactory.class.php');
$app->registerClass('SDContext', $dir . 'SDContext.class.php');
require_once $dir . '../../../lib/HTTP/Request.php';
/**
 * hooks
 */
$app->registerHook('ParserFirstCallInit', 'StructuredData', 'onParserFirstCallInit');
/**
 * controllers
 */
$app->registerClass('StructuredDataController', $dir . 'StructuredDataController.class.php');
/**
 * special pages
 */
$app->registerSpecialPage('StructuredData', 'StructuredDataController');
$wgStructuredDataConfig = array('baseUrl' => 'http://data-stage.wikia.net/', 'apiPath' => 'api/v0.1/', 'schemaPath' => 'callofduty', 'renderersPath' => $dir . 'templates/renderers/', 'renderers' => array('schema:ImageObject' => 'ImageObject', 'xsd:anyURI' => 'anyURI', '@set' => 'container', '@list' => 'container'));
define('SD_CONTEXT_DEFAULT', 0);
define('SD_CONTEXT_SPECIAL', 1);
F::addClassConstructor('StructuredDataAPIClient', array('baseUrl' => $wgStructuredDataConfig['baseUrl'], 'apiPath' => $wgStructuredDataConfig['apiPath'], 'schemaPath' => $wgStructuredDataConfig['schemaPath']));
F::addClassConstructor('StructuredData', array('apiClient' => F::build('StructuredDataAPIClient')));
F::addClassConstructor('SDElementRendererFactory', array('config' => $wgStructuredDataConfig));
/**
 * message files
 */
//$app->registerExtensionMessageFile('StructuredData', $dir . 'StructuredData.i18n.php');
开发者ID:schwarer2006,项目名称:wikia,代码行数:31,代码来源:StructuredData.setup.php

示例5: require_once

<?php

# Alert the user that this is not a valid entry point to MediaWiki if they try to access the special pages file directly.
if (!defined('MEDIAWIKI')) {
    echo <<<EOT
To install my extension, put the following line in LocalSettings.php:
require_once( "\$IP/extensions/MyExtension/MyExtension.php" );
EOT;
    exit(1);
}
$app = F::app();
$dir = dirname(__FILE__) . '/';
/**
 * classes
 */
$app->registerClass('WikiaInternalHooks', $dir . 'WikiaInternalHooks.class.php');
/**
 * hooks
 */
$app->registerHook('AfterCheckInitialQueries', 'WikiaInternalHooks', 'onAfterCheckInitialQueries');
/**
* message files
*/
$app->registerExtensionMessageFile('WikiaInternal', $dir . 'WikiaInternal.i18n.php');
/**
 * Factory config
 */
F::addClassConstructor('WikiaInternalHooks', array('app' => $app));
开发者ID:schwarer2006,项目名称:wikia,代码行数:28,代码来源:WikiaInternal.setup.php

示例6: dirname

<?php

$app = F::app();
/**
 * classes
 */
$app->registerClass('NewWikis', dirname(__FILE__) . '/NewWikis.class.php');
$app->registerClass('NewWikisArticle', dirname(__FILE__) . '/NewWikisArticle.class.php');
$app->registerClass('NewWikisController', dirname(__FILE__) . '/NewWikisController.class.php');
$app->registerClass('ActiveNewWikisController', dirname(__FILE__) . '/ActiveNewWikisController.class.php');
/**
 * factory configuration
 */
F::addClassConstructor('NewWikis', array('app' => $app));
F::addClassConstructor('NewWikisController', array('app' => $app));
/**
 * hooks
 */
$app->registerHook('ArticleFromTitle', 'NewWikisController', 'onArticleFromTitle');
/**
 * special pages
 */
$app->registerSpecialPage('NewWikis', 'NewWikisController', 'highuse');
$app->registerSpecialPage('ActiveNewWikis', 'ActiveNewWikisController', 'highuse');
开发者ID:schwarer2006,项目名称:wikia,代码行数:24,代码来源:NewWikis.setup.php

示例7: dirname

<?php

$app = F::app();
$dir = dirname(__FILE__) . '/';
/**
 * classes
 */
$app->registerClass('SearchedKeywordsController', $dir . 'SearchedKeywordsController.class.php');
$app->registerClass('SearchedKeywords', $dir . 'SearchedKeywords.class.php');
/**
 * special pages
 */
$app->registerSpecialPage('SearchedKeywords', 'SearchedKeywordsController');
/**
 * hookds
 */
$app->registerHook('Search-beforeBackendCall', 'SearchedKeywordsController', 'onSearchBeforeBackendCall');
F::addClassConstructor('SearchedKeywords', array('app' => $app));
开发者ID:schwarer2006,项目名称:wikia,代码行数:18,代码来源:SearchedKeywords.setup.php

示例8: setupCreateNewWiki

 public static function setupCreateNewWiki()
 {
     F::addClassConstructor('CreateNewWikiModule', array(F::app()));
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:4,代码来源:CreateNewWikiController.class.php

示例9: array

 *
 * To activate this functionality, place this file in your extensions/
 * subdirectory, and add the following line to LocalSettings.php:
 *     include("$IP/extensions/wikia/ScavengerHunt/ScavengerHunt_setup.php");
 */
$wgExtensionCredits['special'][] = array('name' => 'Scavenger hunt', 'version' => '1.0', 'author' => array('[http://www.wikia.com/wiki/User:Marooned Maciej Błaszkowski (Marooned)]', 'Władysław Bodzek'), 'description-msg' => 'scavengerhunt-desc');
$dir = dirname(__FILE__);
// WikiaApp
$app = F::app();
// autoloaded classes
$app->registerClass('ScavengerHunt', "{$dir}/ScavengerHunt.class.php");
$app->registerClass('SpecialScavengerHunt', "{$dir}/SpecialScavengerHunt.php");
$app->registerClass('ScavengerHuntGame', "{$dir}/data/ScavengerHuntGame.class.php");
$app->registerClass('ScavengerHuntGames', "{$dir}/data/ScavengerHuntGames.class.php");
$app->registerClass('ScavengerHuntGameArticle', "{$dir}/data/ScavengerHuntGameArticle.class.php");
$app->registerClass('ScavengerHuntFormController', "{$dir}/ScavengerHuntFormController.class.php");
$app->registerClass('ScavengerHuntController', "{$dir}/ScavengerHuntController.class.php");
// i18n
$wgExtensionMessagesFiles['ScavengerHunt'] = "{$dir}/ScavengerHunt.i18n.php";
// special page
$wgSpecialPages['ScavengerHunt'] = 'SpecialScavengerHunt';
// hooks
$app->registerHook('MakeGlobalVariablesScript', 'ScavengerHunt', 'onMakeGlobalVariablesScript');
$app->registerHook('BeforePageDisplay', 'ScavengerHunt', 'onBeforePageDisplay');
$app->registerHook('OpenGraphMeta:beforeCustomFields', 'ScavengerHunt', 'onOpenGraphMetaBeforeCustomFields');
// constuctors
F::addClassConstructor('ScavengerHuntGames', array('app' => $app));
F::addClassConstructor('ScavengerHuntGame', array('app' => $app, 'id' => 0));
// XXX: standard MW constructors - needed to be moved to global place
F::addClassConstructor('Title', array(), 'newFromText');
开发者ID:schwarer2006,项目名称:wikia,代码行数:30,代码来源:ScavengerHunt_setup.php

示例10: dirname

<?php

$dir = dirname(__FILE__) . '/';
/* @var $app WikiaApp */
$app = F::build('App');
/**
 * classes
 */
$app->registerClass('UAD', $dir . 'UAD.class.php');
$app->registerClass('UADController', $dir . 'UADController.class.php');
F::addClassConstructor('UAD', array('app' => $app));
F::addClassConstructor('UADController', array('app' => $app, 'uad' => F::build('UAD')));
/**
 * hooks
 */
$app->registerHook('OutputPageBeforeHTML', 'UADController', 'onOutputPageBeforeHTML');
开发者ID:schwarer2006,项目名称:wikia,代码行数:16,代码来源:UAD.php

示例11: dirname

<?php

$app = F::app();
$dir = dirname(__FILE__);
$app->registerClass('ScribeEventProducer', $dir . '/ScribeEventProducer.class.php');
$app->registerClass('ScribeEventProducerController', $dir . '/ScribeEventProducerController.class.php');
$app->registerHook('ArticleSaveComplete', 'ScribeEventProducerController', 'onSaveComplete');
$app->registerHook('NewRevisionFromEditComplete', 'ScribeEventProducerController', 'onSaveRevisionComplete');
$app->registerHook('ArticleDeleteComplete', 'ScribeEventProducerController', 'onDeleteComplete');
$app->registerHook('ArticleUndelete', 'ScribeEventProducerController', 'onArticleUndelete');
$app->registerHook('TitleMoveComplete', 'ScribeEventProducerController', 'onMoveComplete');
F::addClassConstructor('ScribeEventProducer', array('app' => $app));
F::addClassConstructor('ScribeEventProducerController', array('app' => $app));
开发者ID:schwarer2006,项目名称:wikia,代码行数:13,代码来源:ScribeEventProducer.setup.php

示例12: dirname

<?php

/**
 * TwitterOnRails - Twitter Feed inside Oasis left rail module
 *
 * @author ADi
 */
$dir = dirname(__FILE__) . '/';
/* @var $app WikiaApp */
$app = F::build('App');
/**
 * classes
 */
$app->registerClass('ToRController', $dir . 'ToRController.class.php');
/**
 * Factory config
 */
F::addClassConstructor('ToRController', array('app' => $app));
/**
 * message files
 */
$app->registerExtensionMessageFile('ToR', $dir . 'ToR.i18n.php');
/**
 * hooks
 */
$app->registerHook('GetRailModuleList', 'ToRModule', 'onGetRailModuleList');
$app->registerHook('ParserFirstCallInit', 'ToRModule', 'onParserFirstCallInit');
开发者ID:schwarer2006,项目名称:wikia,代码行数:27,代码来源:ToR.setup.php

示例13: array

// some of this stuff can't be trusted evidently.
$wgSolrHost = $wgExternalSharedDB ? $wgSolrHost : 'staff-search-s1';
$wgSolrPort = $wgExternalSharedDB ? $wgSolrPort : 8983;
$wgSolrUseProxy = $wgExternalSharedDB ? !empty($wgSolrUseProxy) : false;
$wgWikiaSearchUseProxy = $wgExternalSharedDB ? $wgWikiaSearchUseProxy : false;
$solariumConfig = array('adapteroptions' => array('host' => !empty($wgSolrHost) ? $wgSolrHost : 'localhost', 'port' => !empty($wgSolrPort) ? $wgSolrPort : 8180, 'path' => '/solr/'));
//@todo configs for this?
$searchMaster = $wgExternalSharedDB ? 'search-s6' : 'staff-search-s1';
$indexerSolariumConfig = array('adapteroptions' => array('host' => $searchMaster, 'port' => 8983, 'path' => '/solr/'));
if ($wgWikiaSearchUseProxy && isset($wgSolrProxy)) {
    $solariumConfig['adapteroptions']['proxy'] = $wgSolrProxy;
    $solariumConfig['adapteroptions']['port'] = null;
}
F::addClassConstructor('Solarium_Client', array('solariumConfig' => $solariumConfig));
F::addClassConstructor('WikiaSearch', array('client' => F::build('Solarium_Client')));
F::addClassConstructor('WikiaSearchIndexer', array('client' => F::build('Solarium_Client', array('solariumConfig' => $indexerSolariumConfig))));
/**
 * message files
 */
$app->registerExtensionMessageFile('WikiaSearch', $dir . 'WikiaSearch.i18n.php');
/**
 * preference settings
 */
$app->registerHook('GetPreferences', 'WikiaSearch', 'onGetPreferences');
/*
 * hooks
 */
$app->registerHook('WikiaMobileAssetsPackages', 'WikiaSearchController', 'onWikiaMobileAssetsPackages');
if (!$wgExternalSharedDB) {
    $app->registerHook('ArticleDeleteComplete', 'WikiaSearchIndexer', 'onArticleDeleteComplete');
    $app->registerHook('ArticleSaveComplete', 'WikiaSearchIndexer', 'onArticleSaveComplete');
开发者ID:schwarer2006,项目名称:wikia,代码行数:31,代码来源:WikiaSearch.setup.php

示例14: array

$app->registerHook('ArticleSaveComplete', 'UserProfilePageController', 'onArticleSaveComplete');
$app->registerHook('GetRailModuleList', 'UserProfilePageRailHelper', 'onGetRailModuleList');
$app->registerHook('WikiaMobileAssetsPackages', 'UserProfilePageController', 'onWikiaMobileAssetsPackages');
$app->registerHook('BeforeDisplayNoArticleText', 'UserProfilePageController', 'onBeforeDisplayNoArticleText');
$app->registerHook('ArticleSaveComplete', 'Masthead', 'userMastheadInvalidateCache');
/**
 * messages
 */
$app->registerExtensionMessageFile('UserProfilePageV3', $dir . '/UserProfilePage.i18n.php');
//register messages package for JS
//$app->registerExtensionJSMessagePackage('UPP3_modals', array('user-identity-box-about-date-*'));
/**
 * DI setup
 */
F::addClassConstructor('UserProfilePage', array('app' => $app));
F::addClassConstructor('UserProfilePageController', array('app' => $app));
/**
 * extension related configuration
 */
$UPPNamespaces = array();
$UPPNamespaces[] = NS_USER;
$UPPNamespaces[] = NS_USER_TALK;
if (defined('NS_USER_WALL')) {
    $UPPNamespaces[] = NS_USER_WALL;
}
if (defined('NS_BLOG_ARTICLE')) {
    $UPPNamespaces[] = NS_BLOG_ARTICLE;
}
$app->getLocalRegistry()->set('UserProfilePageNamespaces', $UPPNamespaces);
$wgLogTypes[] = AVATAR_LOG_NAME;
$wgLogHeaders[AVATAR_LOG_NAME] = 'blog-avatar-alt';
开发者ID:schwarer2006,项目名称:wikia,代码行数:31,代码来源:UserProfilePage.setup.php

示例15: define

    $app->registerHook('BeforePageDisplay', 'RelatedVideosHookHandler', 'onBeforePageDisplay');
    define('RELATEDVIDEOS_POSITION', 'RELATEDVIDEOS_POSITION');
    $app->registerHook('LanguageGetMagic', 'RelatedVideosHookHandler', 'onLanguageGetMagic');
    $app->registerHook('InternalParseBeforeLinks', 'RelatedVideosHookHandler', 'onInternalParseBeforeLinks');
    if (!empty($wgRelatedVideosOnRail)) {
        $app->registerHook('GetRailModuleList', 'RelatedVideosHookHandler', 'onGetRailModuleList');
    } else {
        array_splice($wgHooks['OutputPageBeforeHTML'], 0, 0, 'RelatedVideosHookHandler::onOutputPageBeforeHTML');
    }
}
$app->registerHook('ArticleSaveComplete', 'RelatedVideosHookHandler', 'onArticleSaveComplete');
/**
 * messages
 */
$app->registerExtensionMessageFile('RelatedVideos', $dir . '/RelatedVideos.i18n.php');
F::addClassConstructor('RelatedVideosController', array('app' => $app));
/**
 * extension related configuration
 */
// setup "RelatedVideo" namespace
define('NS_RELATED_VIDEOS', 1100);
$wgExtensionNamespacesFiles['RelatedVideos'] = "{$dir}/RelatedVideos.namespaces.php";
wfLoadExtensionNamespaces('RelatedVideos', array(NS_RELATED_VIDEOS));
// permissions
$wgGroupPermissions['*']['relatedvideos'] = false;
// Ideally we would hide viewing of the namespace articles from all but admins
// and staff, but give logged-in users edit privileges (which are needed to
// support the GUI add/remove video tools).
// The relatedvideos namespace covers editing of the namespace. we should
// restrict viewing of the namespace articles in some other way.
$wgGroupPermissions['user']['relatedvideos'] = true;
开发者ID:schwarer2006,项目名称:wikia,代码行数:31,代码来源:RelatedVideos.setup.php


注:本文中的F::addClassConstructor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。