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


PHP Object::useCustomClass方法代码示例

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


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

示例1: testSetup

 public function testSetup()
 {
     Object::useCustomClass('Email', 'SMTPEmail');
     Email::set_mailer(new SmtpMailer());
     SMTPEmail::set_mailer(new SmtpMailer());
     $mailer = Email::mailer();
     $this->assertEquals('SmtpMailer', get_class($mailer));
     $mailer = SMTPEmail::mailer();
     $this->assertEquals('SmtpMailer', get_class($mailer));
 }
开发者ID:helpfulrobot,项目名称:azt3k-abc-silverstripe-mailer,代码行数:10,代码来源:SMTPMailerTest.php

示例2: init

 /**
  * @return void
  */
 public function init()
 {
     parent::init();
     $access = new IpAccess($this->getRequest()->getIP());
     if (!$access->hasAccess()) {
         $access->respondNoAccess($this);
     }
     if (Config::inst()->get('AdminLogin', 'UseTheme') !== true) {
         // this prevents loading frontend css and javscript files
         Object::useCustomClass('Page_Controller', 'AdminLoginPage_Controller');
         Requirements::css('adminlogin/css/style.css');
     }
     Object::useCustomClass('MemberLoginForm', 'AdminLoginForm');
 }
开发者ID:axyr,项目名称:silverstripe-adminlogin,代码行数:17,代码来源:AdminSecurity.php

示例3: setAsMailer

 /**
  * Helper method to initialize the mailer
  *
  * @param string $apiKey
  * @throws Exception
  */
 public static function setAsMailer()
 {
     $mandrillMailer = new MandrillMailer();
     Email::set_mailer($mandrillMailer);
     if (defined('MANDRILL_SENDING_DISABLED') && MANDRILL_SENDING_DISABLED) {
         self::setSendingDisabled();
     }
     if (defined('MANDRILL_ENABLE_LOGGING') && MANDRILL_ENABLE_LOGGING) {
         self::setEnableLogging();
     }
     // Use custom classes
     Object::useCustomClass('Member_ChangePasswordEmail', 'Mandrill_ChangePasswordEmail');
     Object::useCustomClass('Member_ForgotPasswordEmail', 'Mandrill_ForgotPasswordEmail');
 }
开发者ID:helpfulrobot,项目名称:lekoala-silverstripe-mandrill,代码行数:20,代码来源:MandrillMailer.php

示例4: init

 public function init()
 {
     parent::init();
     if (Config::inst()->get('IpAccess', 'enabled')) {
         $ipAccess = new IpAccess($this->owner->getRequest()->getIP(), Config::inst()->get('IpAccess', 'allowed_ips'));
         if (!$ipAccess->hasAccess()) {
             $reponse = '';
             if (class_exists('ErrorPage', true)) {
                 $response = ErrorPage::response_for(404);
             }
             return $this->owner->httpError(404, $response ? $response : 'The requested page could not be found.');
         }
     }
     if (Config::inst()->get('AdminLogin', 'UseTheme') !== true) {
         // this prevents loading frontend css and javscript files
         Object::useCustomClass('Page_Controller', 'AdminLoginPage_Controller');
         Requirements::css('adminlogin/css/style.css');
     }
     Object::useCustomClass('MemberLoginForm', 'AdminLoginForm');
 }
开发者ID:helpfulrobot,项目名称:axyr-silverstripe-adminlogin,代码行数:20,代码来源:AdminLogin.php

示例5: define

<?php

define('MARKDOWN_MODULE_BASE', basename(dirname(__FILE__)));
MarkdownExtension::ReplaceHTMLFields();
MarkdownEditorField::include_default_js();
if (ClassInfo::exists('CloudinaryUploadField')) {
    MarkdownEditorField::add_extension('MarkdownCloudinaryUpload');
}
Object::useCustomClass('HtmlEditorField_Toolbar', 'MarkdownEditorField_Toolbar', true);
开发者ID:helpfulrobot,项目名称:undefinedoffset-silverstripe-markdown,代码行数:9,代码来源:_config.php

示例6: define

<?php

define('SORTABLEGALLERY_DIR', basename(dirname(__FILE__)));
//Image::add_extension('GalleryImage');
Object::add_extension('Image', 'GalleryImage');
Object::useCustomClass('UploadField_SelectHandler', 'SortableGalleryUploadField_SelectHandler');
开发者ID:helpfulrobot,项目名称:jonshutt-silverstripe-sortable-gallery-field,代码行数:6,代码来源:_config.php

示例7:

<?php

Object::useCustomClass('HtmlEditorField', 'CustomConfigHtmlEditorField');
开发者ID:helpfulrobot,项目名称:peda-htmleditor,代码行数:3,代码来源:_config.php

示例8: array

<?php

global $project;
$project = 'mysite';
global $databaseConfig;
$databaseConfig = array('type' => 'MySQLDatabase', 'server' => '127.0.0.1', 'username' => 'root', 'password' => '311a0oZu', 'database' => 'SS_mysite', 'path' => '');
// Set the site locale
i18n::set_locale('en_US');
Object::useCustomClass('Member', 'SSMember');
开发者ID:qteo94,项目名称:Silverstripe_tutorial,代码行数:9,代码来源:_config.php

示例9: array

<?php

Object::add_extension('Page', 'VideoEmbedPageExtesion');
Object::add_extension('Oembed_Result', 'Oembed_ResultExtension');
if (class_exists("PhotoAlbum") && class_exists("PhotoAlbumExtension")) {
    Object::add_extension('PhotoAlbum', 'PhotoAlbumExtension');
}
if (class_exists("PhotoGallery_Controller") && class_exists("PhotoGallery_ControllerExtension")) {
    Object::add_extension('PhotoGallery_Controller', 'PhotoGallery_ControllerExtension');
}
if (class_exists("PhotoItem") && class_exists("PhotoItemExtension")) {
    Object::add_extension('PhotoItem', 'PhotoItemExtension');
    Object::add_extension('VideoEmbed', 'VideoEmbedExtension');
}
Object::useCustomClass('HtmlEditorField_Toolbar', 'HtmlEditorField_Toolbar_Extension', true);
$oembedProviders = Config::inst()->get('Oembed', 'providers');
$categories = Config::inst()->get('File', 'app_categories');
$localProvider = array("http" => Director::absoluteURL('/oembed.json'), "https" => Director::absoluteURL('/oembed.json'));
if (isset($categories['audio'])) {
    foreach ($categories['audio'] as $ext) {
        $oembedProviders['*' . ASSETS_DIR . '/*.' . $ext] = $localProvider;
    }
}
if (isset($categories['mov'])) {
    foreach ($categories['mov'] as $ext) {
        $oembedProviders['*' . ASSETS_DIR . '/*.' . $ext] = $localProvider;
    }
}
Config::inst()->update('Oembed', 'providers', $oembedProviders);
ShortcodeParser::get('default')->register('embed', array('Oembed_Custom', 'handle_shortcode'));
开发者ID:helpfulrobot,项目名称:gdmedia-silverstripe-video-embed,代码行数:30,代码来源:_config.php

示例10: define

<?php

define('FRONTEND_ADMIN_DIR', basename(dirname(__FILE__)));
Object::useCustomClass('Boolean', 'FrontEndBoolean', true);
Object::useCustomClass('Enum', 'FrontEndEnum', true);
//Object::useCustomClass('Image', 'FrontEndImage', true);
Object::useCustomClass('HTMLText', 'FrontendEditorHTMLText', true);
Object::useCustomClass('Text', 'FrontendEditorText', true);
Object::useCustomClass('Varchar', 'FrontendEditorVarchar', true);
//Image::add_extension('FrontEndImageExtension');
Object::add_extension('Page_Controller', 'FrontendEditingControllerExtension');
Object::add_extension('Page', 'FrontendAdminPageExtension');
if (class_exists("DynamicCacheExtension")) {
    Object::add_extension('DynamicCache', 'FrontEndAdminDynamicCacheExtension');
}
开发者ID:helpfulrobot,项目名称:gdmedia-silverstripe-frontend-admin,代码行数:15,代码来源:_config.php

示例11:

<?php

// Replace MemberProfilePage with RegisterMemberPage(later change to only Controller)
Object::useCustomClass('MemberProfilePage', 'RegisterMemberPage');
开发者ID:vinstah,项目名称:body,代码行数:4,代码来源:_config.php

示例12: array

SilvercartPlugin::registerPluginProvider('SilvercartContactMessage', 'SilvercartContactMessagePluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartIncrementPositionQuantityForm', 'SilvercartIncrementPositionQuantityFormPluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartOrder', 'SilvercartOrderPluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartOrderPosition', 'SilvercartOrderPositionPluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartProduct', 'SilvercartProductPluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartProductAddCartFormDetail', 'SilvercartProductAddCartFormDetailPluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartProductAddCartFormList', 'SilvercartProductAddCartFormListPluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartProductAddCartFormTile', 'SilvercartProductAddCartFormTilePluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartProductAddCartForm', 'SilvercartProductAddCartFormPluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartProductCsvBulkLoader', 'SilvercartProductCsvBulkLoaderPluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartProductGroupPage_Controller', 'SilvercartProductGroupPage_ControllerPluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartRemovePositionForm', 'SilvercartRemovePositionFormPluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartShoppingCart', 'SilvercartShoppingCartPluginProvider');
SilvercartPlugin::registerPluginProvider('SilvercartShoppingCartPosition', 'SilvercartShoppingCartPositionPluginProvider');
// use custom classes
Object::useCustomClass('Member_ForgotPasswordEmail', 'SilvercartCustomer_ForgotPasswordEmail');
// configure WidgetSet
WidgetSetWidgetExtension::preventWidgetCreationByClass('SilvercartWidget');
SilvercartGridFieldBatchController::addBatchActionFor('SilvercartOrder', 'SilvercartGridFieldBatchAction_ChangeOrderStatus');
SilvercartGridFieldBatchController::addBatchActionFor('SilvercartOrder', 'SilvercartGridFieldBatchAction_PrintOrders');
SilvercartGridFieldBatchController::addBatchActionFor('SilvercartOrder', 'SilvercartGridFieldBatchAction_MarkAsSeen');
SilvercartGridFieldBatchController::addBatchActionFor('SilvercartOrder', 'SilvercartGridFieldBatchAction_MarkAsNotSeen');
SilvercartGridFieldBatchController::addBatchActionFor('SilvercartProduct', 'SilvercartGridFieldBatchAction_ActivateDataObject');
SilvercartGridFieldBatchController::addBatchActionFor('SilvercartProduct', 'SilvercartGridFieldBatchAction_DeactivateDataObject');
SilvercartGridFieldBatchController::addBatchActionFor('SilvercartProduct', 'SilvercartGridFieldBatchAction_ChangeAvailabilityStatus');
SilvercartGridFieldBatchController::addBatchActionFor('SilvercartProduct', 'SilvercartGridFieldBatchAction_ChangeManufacturer');
SilvercartGridFieldBatchController::addBatchActionFor('SilvercartProduct', 'SilvercartGridFieldBatchAction_ChangeProductGroup');
// ----------------------------------------------------------------------------
// Blacklists for SilvercartRestfulServer
// ----------------------------------------------------------------------------
SilvercartRestfulServer::addApiAccessBlackListFields('Group', array('Locked', 'Sort', 'IPRestrictions', 'HtmlEditorConfig'));
开发者ID:silvercart,项目名称:silvercart,代码行数:31,代码来源:_config.php

示例13: define

<?php

Deprecation::notification_version('1.0', 'retinaimages');
define('RETINA_MODULE_DIR', dirname(__FILE__));
Object::useCustomClass('Image', 'RetinaImage');
Object::useCustomClass('Image_Cached', 'RetinaImage_Cached');
// SiteTree uses new HtmlEditorField() instead of HtmlEditorField::create()
// as a result if you want retina images in your WYSIWYG editor you'll need to
// recreate the HtmlEditorField.
Object::useCustomClass('HtmlEditorField', 'RetinaImageHtmlEditorField');
// tinyCMS additional HTML5 elements
$wysiwyg = HtmlEditorConfig::get('cms')->getOption('valid_elements');
$wysiwyg .= ',-img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align|data*|srcset]';
HtmlEditorConfig::get('cms')->setOption('valid_elements', $wysiwyg);
开发者ID:helpfulrobot,项目名称:chitosystems-silverstripe-retina-images,代码行数:14,代码来源:_config.php

示例14: define

<?php

/**
 * 
 * @author Deviate Ltd 2014-2015 http://www.deviate.net.nz
 * @package silverstripe-advancedassets
 */
define("SECURED_FILES_MODULE_NAME", "Advanced Assets");
define("SECURED_FILES_MODULE_DIR", "silverstripe-advancedassets");
define("SECURED_FILES_ASSET_SUBDIR", "_securedfiles");
if (!file_exists(BASE_PATH . DIRECTORY_SEPARATOR . SECURED_FILES_MODULE_DIR)) {
    $msg = "Module directory seems to be named incorrectly." . " The " . SECURED_FILES_MODULE_NAME . " module" . " should be installed into a folder named " . SECURED_FILES_MODULE_DIR;
    user_error($msg);
}
// Overload use of default {@link AssetAdmin} with the module's own {@link NonSecuredAssetAdmin}.
Object::useCustomClass('AssetAdmin', 'NonSecuredAssetAdmin', true);
CMSMenu::remove_menu_item('AssetAdmin');
CMSMenu::remove_menu_item('CMSSecuredFileAddController');
CMSMenu::remove_menu_item('CMSNonSecuredFileAddController');
// "Obliterate" the securedfiles' SecureFileExtension class.
if (class_exists('SecureFileExtension')) {
    File::remove_extension("SecureFileExtension");
}
开发者ID:helpfulrobot,项目名称:deviateltd-silverstripe-advancedassets,代码行数:23,代码来源:_config.php

示例15: define

<?php

define('SHOP_DIR', basename(__DIR__));
define('SHOP_PATH', BASE_PATH . DIRECTORY_SEPARATOR . SHOP_DIR);
Object::useCustomClass('Currency', 'ShopCurrency', true);
if ($checkoutsteps = CheckoutPage::config()->steps) {
    SteppedCheckout::setupSteps($checkoutsteps);
}
开发者ID:helpfulrobot,项目名称:silvershop-core,代码行数:8,代码来源:_config.php


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