當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OX_Component::factory方法代碼示例

本文整理匯總了PHP中OX_Component::factory方法的典型用法代碼示例。如果您正苦於以下問題:PHP OX_Component::factory方法的具體用法?PHP OX_Component::factory怎麽用?PHP OX_Component::factory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OX_Component的用法示例。


在下文中一共展示了OX_Component::factory方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testGetName

 function testGetName()
 {
     $oPlugin =& OX_Component::factory('deliveryLimitations', 'Geo', 'City');
     $oPlugin->init(array());
     // Assume it is called in the production after talking to Andrew
     $this->assertEqual('Geo - Country / City', $oPlugin->displayName);
 }
開發者ID:ballistiq,項目名稱:revive-adserver,代碼行數:7,代碼來源:DeliveryLimitationsGeoCity.plg.test.php

示例2: validate

 /**
  * Method that is called on settings form submission
  * Error messages are appended to the 0 index of the array
  *
  * @return boolean
  */
 function validate(&$aErrorMessage)
 {
     // Store current values from config
     // overwrite it by tested ones
     $storeSettings = array();
     if (isset($GLOBALS['oxMemcached_memcachedServers'])) {
         $storeSettings['memcachedServers'] = $GLOBALS['_MAX']['CONF']['oxMemcached']['memcachedServers'];
         $GLOBALS['_MAX']['CONF']['oxMemcached']['memcachedServers'] = $GLOBALS['oxMemcached_memcachedServers'];
     }
     if (isset($GLOBALS['oxMemcached_memcachedExpireTime'])) {
         $storeSettings['memcachedExpireTime'] = $GLOBALS['_MAX']['CONF']['oxMemcached']['memcachedExpireTime'];
         $GLOBALS['_MAX']['CONF']['oxMemcached']['memcachedExpireTime'] = $GLOBALS['oxMemcached_memcachedExpireTime'];
     }
     // Use memcached plugin getStatus function to validate
     $oPlgOxMemcached =& OX_Component::factory('deliveryCacheStore', 'oxMemcached', 'oxMemcached');
     $result = $oPlgOxMemcached->getStatus();
     if ($result !== true) {
         $aErrorMessage[0] = $result;
         $result = false;
     }
     // Restore config values
     foreach ($storeSettings as $key => $value) {
         $GLOBALS['_MAX']['CONF']['oxMemcached'][$key] = $value;
     }
     return $result;
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:32,代碼來源:processSettings.php

示例3: test_compile

 function test_compile()
 {
     $oPlugin =& OX_Component::factory('deliveryLimitations', 'Geo', 'Continent');
     $oPlugin->init(array('data' => 'EU', 'comparison' => '!~'));
     $this->_assertResourceData();
     $result = $oPlugin->compile();
     $this->assertEqual("MAX_checkGeo_Continent('eu,yu,gb,uk,ua,ch,se,sj,es,si,sk,sm,ru,ro,pt,pl,no,nl,mc,md,mt,mk,lu,lt,li,lv,it,ie,is,hu,va,gr,gi,de,ge,fx,fr,fi,fo,ee,dk,cz,cy,hr,bg,ba,be,by,at,am,ad,al', '!~')", $result);
 }
開發者ID:ballistiq,項目名稱:revive-adserver,代碼行數:8,代碼來源:DeliveryLimitationsGeoContinent.plg.test.php

示例4: test_oxMemcached_class

 function test_oxMemcached_class()
 {
     if (extension_loaded('memcache')) {
         $oComponent =& OX_Component::factory('deliveryCacheStore', 'oxMemcached', 'oxMemcached');
         $this->_assertClass($oComponent, 'deliveryCacheStore', 'oxMemcached', 'oxMemcached');
     } else {
         $this->skip("memcache extension not available");
     }
 }
開發者ID:ballistiq,項目名稱:revive-adserver,代碼行數:9,代碼來源:openXdeliveryCacheStore.plg.test.php

示例5: testCompile

 function testCompile()
 {
     $oPlugin =& OX_Component::factory('deliveryLimitations', 'Geo', 'Region');
     $rawData = 'GB|T5,T7';
     $oPlugin->init(array('data' => $rawData, 'comparison' => '=='));
     $this->assertEqual('MAX_checkGeo_Region(\'gb|t5,t7\', \'==\')', $oPlugin->compile());
     $this->assertEqual($rawData, $oPlugin->getData());
     $oPlugin->init(array('data' => array('GB', 'T5', 'T7'), 'comparison' => '=='));
     $this->assertEqual('MAX_checkGeo_Region(\'gb|t5,t7\', \'==\')', $oPlugin->compile());
 }
開發者ID:ballistiq,項目名稱:revive-adserver,代碼行數:10,代碼來源:DeliveryLimitationsGeoRegion.plg.test.php

示例6: testCompile

 function testCompile()
 {
     $oPlugin =& OX_Component::factory('deliveryLimitations', 'Site', 'Channel');
     $oPlugin->init(array('data' => '21', 'comparison' => '=='));
     $this->assertEqual("(MAX_checkSite_Channel('21', '=='))", $oPlugin->compile());
     $oPlugin->init(array('data' => '21,43', 'comparison' => '=='));
     $this->assertEqual("(MAX_checkSite_Channel('21', '==') && MAX_checkSite_Channel('43', '=='))", $oPlugin->compile());
     $oPlugin->init(array('data' => '21,43', 'comparison' => '=~'));
     $this->assertEqual("(MAX_checkSite_Channel('21', '=~') || MAX_checkSite_Channel('43', '=~'))", $oPlugin->compile());
     $oPlugin->init(array('data' => '21,43', 'comparison' => '!~'));
     $this->assertEqual("!(MAX_checkSite_Channel('21', '!~') || MAX_checkSite_Channel('43', '!~'))", $oPlugin->compile());
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:12,代碼來源:DeliveryLimitationsSiteChannel.plg.test.php

示例7: test_genericHtml_class

 function test_genericHtml_class()
 {
     // test the class implementation
     $oComponent =& OX_Component::factory('bannerTypeHtml', 'demoBannerTypeHtml', 'demoHtml');
     // common extension methods
     $this->_assertClass($oComponent, 'bannerTypeHtml', 'demoBannerTypeHtml', 'demoHtml');
     // plugin-specific methods
     $this->assertTrue(method_exists($oComponent, '_buildHtmlTemplate'), $sender . ' missing method _buildHtmlTemplate');
     $this->assertTrue(method_exists($oComponent, 'exportData'), $sender . ' missing method exportData');
     // generate test data
     $doBanners = OA_Dal::factoryDO('banners');
     $oDG = new DataGenerator();
     $oDG->setData('banners', array('ext_bannertype' => array($oComponent->getComponentIdentifier())));
     $aIds = $oDG->generate($doBanners, 5, false);
     $aFields = $aVariables = array();
     // test the processForm method
     // this method joins the banners and banners_demo tables
     // by creating a banners_demo record where
     // banners_demo.banners_demo_id = banners.bannerid
     foreach ($aIds as $i => $bannerId) {
         $aFields['description'] = 'description_' . $bannerId;
         $this->assertTrue($oComponent->processForm(true, $bannerId, $aFields, $aVariables));
         $doBannersDemo = OA_Dal::factoryDO('banners_demo');
         $doBannersDemo->banners_demo_id = $bannerId;
         $this->assertTrue($doBannersDemo->find(true));
         $this->assertEqual($doBannersDemo->banners_demo_desc, $aFields['description']);
     }
     // test the exportData method
     $aTables = $oComponent->exportData();
     $this->assertIsA($aTables, 'array');
     $this->assertEqual(count($aTables), 2);
     $prefix = $GLOBALS['_MAX']['CONF']['table']['prefix'];
     $pattern = '/' . $prefix . 'z_' . $oComponent->component . '[\\d]{8}_[\\d]{6}' . $prefix . 'banners/';
     $this->assertPattern($pattern, $aTables[0]);
     $pattern = '/' . $prefix . 'z_' . $oComponent->component . '[\\d]{8}_[\\d]{6}' . $prefix . 'banners_demo/';
     $this->assertPattern($pattern, $aTables[1]);
     $oDbh = OA_DB::singleton();
     $query = "SELECT * FROM " . $oDbh->quoteIdentifier($aTables[0]);
     $aResult = $oDbh->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
     foreach ($aResult as $i => $aFrom) {
         $this->assertEqual($aFrom['bannerid'], $aIds[$i]);
     }
     $query = "SELECT * FROM " . $oDbh->quoteIdentifier($aTables[1]);
     $aResult = $oDbh->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
     foreach ($aResult as $i => $aFrom) {
         $this->assertEqual($aFrom['banners_demo_id'], $aIds[$i]);
     }
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:48,代碼來源:demoBannerTypeHtml.plg.test.php

示例8: locateComponents

 /**
  * A private method to locate and instantiate all components that
  * use the deliveryLog extension, and are in installed plugins, storing
  * them in an array, grouped by the component's destination statistics
  * table -- this will provide all of the plugin components that use
  * the deliveryLog extension (i.e. have bucket-based delivery data that
  * needs to be migrated to statistics tables), grouped by the detsination
  * statistics tables (so that all components that have data migrated to
  * the same table can be migrated in the one call).
  *
  * @access private
  * @return array An array of plugins components, as described above.
  */
 private function locateComponents()
 {
     $aSummariseComponents = array();
     foreach ($this->aPackages as $aPluginInfo) {
         foreach ($aPluginInfo['contents'] as $aContents) {
             if ($aContents['extends'] == 'deliveryLog') {
                 foreach ($aContents['components'] as $aComponent) {
                     $oComponent =& OX_Component::factory('deliveryLog', $aContents['name'], $aComponent['name']);
                     if ($oComponent->enabled) {
                         $destinationTable = $oComponent->getStatisticsTableName();
                         $aSummariseComponents[$destinationTable][get_class($oComponent)] = $oComponent;
                     }
                 }
             }
         }
     }
     return $aSummariseComponents;
 }
開發者ID:ballistiq,項目名稱:revive-adserver,代碼行數:31,代碼來源:MigrateBucketData.php

示例9: check

 public function check($oSection)
 {
     phpAds_registerGlobal('clientid', 'campaignid');
     global $clientid, $campaignid;
     $sectionId = $oSection->getId();
     static $cache = array();
     $oMarkedTextAdvertiserComponent = OX_Component::factory('admin', 'oxMarkedTextAdvertiser');
     $oEntityHelper = $oMarkedTextAdvertiserComponent->getEntityHelper();
     $enabled = true;
     switch ($sectionId) {
         case 'advertiser-edit':
         case 'advertiser-trackers':
         case 'advertiser-access':
         case 'campaign-edit_new':
         case 'campaign-edit':
         case 'campaign-trackers':
         case 'campaign-banners':
             if (isset($cache[$clientid])) {
                 return $cache[$clientid];
             }
             break;
         case 'banner-edit':
             if (isset($cache[$clientid])) {
                 return $cache[$clientid];
             }
             break;
         case 'banner-acl':
         case 'banner-zone':
         case 'banner-advanced':
         case 'campaign-zone':
     }
     $sessionClientId = $this->getSessionClientId();
     if (isset($sessionClientId)) {
         $this->clearMarketEntitiesInSession();
     }
     return $enabled;
 }
開發者ID:rcdesign-cemetery,項目名稱:openx-markedtext,代碼行數:37,代碼來源:oxMarkedTextAdvertiserEntityChecker.php

示例10: array

    $aBanner['imageurl'] = "http://";
    $aBanner['width'] = '';
    $aBanner['height'] = '';
    $aBanner['htmltemplate'] = '';
    $aBanner['description'] = '';
    $aBanner['comments'] = '';
    $aBanner['contenttype'] = '';
    $aBanner['adserver'] = '';
    $aBanner['keyword'] = '';
    $aBanner["weight"] = $pref['default_banner_weight'];
    $aBanner['hardcoded_links'] = array();
    $aBanner['hardcoded_targets'] = array();
}
if ($ext_bannertype) {
    list($extension, $group, $plugin) = explode(':', $ext_bannertype);
    $oComponent =& OX_Component::factory($extension, $group, $plugin);
    if (!$oComponent) {
        $oComponent = OX_Component::getFallbackHandler($extension);
    }
    $formDisabled = !$oComponent || !$oComponent->enabled;
}
if (!$ext_bannertype && $type && !in_array($type, array('sql', 'web', 'url', 'html', 'txt'))) {
    list($extension, $group, $plugin) = explode('.', $type);
    $oComponent =& OX_Component::factoryByComponentIdentifier($extension, $group, $plugin);
    $formDisabled = !$oComponent || !$oComponent->enabled;
    if ($oComponent) {
        $ext_bannertype = $type;
        $type = $oComponent->getStorageType();
    } else {
        $ext_bannertype = '';
        $type = '';
開發者ID:rcdesign-cemetery,項目名稱:openx-markedtext,代碼行數:31,代碼來源:banner-edit.php

示例11: test_getComponentIdentifier

 function test_getComponentIdentifier()
 {
     $GLOBALS['_MAX']['CONF']['pluginPaths']['plugins'] = '/lib/OX/Plugin/tests/data/testExtensions/';
     $GLOBALS['_MAX']['CONF']['pluginGroupComponents'] = array('testGroup1' => 1, 'testGroup2' => 0);
     $oComponent = OX_Component::factory('testExtension1', 'testGroup1', 'testComponent1');
     $this->assertEqual($oComponent->getComponentIdentifier('testExtension1', 'testGroup1', 'testComponent1'), 'testExtension1:testGroup1:testComponent1');
 }
開發者ID:Jaree,項目名稱:revive-adserver,代碼行數:7,代碼來源:Component.plg.test.php

示例12: test_adsense_class

 function test_adsense_class()
 {
     $oComponent =& OX_Component::factory('bannerTypeHtml', 'openXHtmlAdsense', 'adsense');
     $this->_assertClass($oComponent, 'bannerTypeHtml', 'openXHtmlAdsense', 'adsense');
     $this->assertTrue(method_exists($oComponent, 'buildHtmlTemplate'), $sender . ' missing method buildHtmlTemplate');
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:6,代碼來源:openXAdditionalBannerTypes.plg.test.php

示例13: phpAds_registerGlobal

<?php

require_once '../../../../init.php';
require_once '../../config.php';
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Dll.php';
require_once MAX_PATH . '/lib/max/other/html.php';
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
require_once MAX_PATH . '/lib/OA/Admin/TemplatePlugin.php';
require_once MAX_PATH . '/lib/OA/Admin/UI/component/Form.php';
require_once MAX_PATH . '/lib/OX/Admin/Redirect.php';
require_once 'oxMarkedTextAdvertiser.class.php';
phpAds_registerGlobal('hideinactive', 'listorder', 'orderdirection');
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
$oMarkedTextComponent = OX_Component::factory('admin', 'oxMarkedTextAdvertiser');
if (!empty($clientid) && !OA_Permission::hasAccessToObject('clients', $clientid)) {
    $page = basename($_SERVER['SCRIPT_NAME']);
    OX_Admin_Redirect::redirect($page);
}
if (!empty($campaignid) && !OA_Permission::hasAccessToObject('campaigns', $campaignid)) {
    $page = basename($_SERVER['SCRIPT_NAME']);
    OX_Admin_Redirect::redirect("{$page}?clientid={$clientid}");
}
$aAdvertisers = getAdvertiserMap();
if (empty($clientid)) {
    $campaignid = null;
    if ($session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid']) {
        $sessionClientId = $session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'];
        if (isset($aAdvertisers[$sessionClientId])) {
            $clientid = $sessionClientId;
        }
開發者ID:rcdesign-cemetery,項目名稱:openx-markedtext,代碼行數:31,代碼來源:oxMarkedTextAdvertiser-index.php

示例14: setUp

 function setUp()
 {
     //$this->oPlugin = &MAX_Plugin::factory('reports', 'oxStandard', 'conversionTrackingReport');
     $GLOBALS['_MAX']['CONF']['pluginPaths']['plugins'] = str_replace('reports/oxReportsStandard/tests/unit', '', dirname(str_replace(MAX_PATH, '', __FILE__)));
     $this->oPlugin =& OX_Component::factory('reports', 'oxReportsStandard', 'conversionTrackingReport');
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:6,代碼來源:ReportsConversionTrackingReport.plg.test.php

示例15: buildWebsiteForm

        }
    }
} else {
    //set some default
    $affiliate['website'] = 'http://';
}
/*-------------------------------------------------------*/
/* MAIN REQUEST PROCESSING                               */
/*-------------------------------------------------------*/
//  check if Thorium plugin is enabled
$oComponent = null;
if (isset($GLOBALS['_MAX']['CONF']['plugins']['openXThorium']) && $GLOBALS['_MAX']['CONF']['plugins']['openXThorium']) {
    $oComponent =& OX_Component::factory('admin', 'oxThorium', 'oxThorium');
}
if (isset($GLOBALS['_MAX']['CONF']['plugins']['openXMarket']) && $GLOBALS['_MAX']['CONF']['plugins']['openXMarket']) {
    $oComponent =& OX_Component::factory('admin', 'oxMarket', 'oxMarket');
}
//build form
$websiteForm = buildWebsiteForm($affiliate);
if ($websiteForm->validate()) {
    //process submitted values
    $oPublisherDll = processForm($affiliateid, $websiteForm, $oComponent);
    if ($oPublisherDll->_errorMessage || $oPublisherDll->_noticeMessage) {
        displayPage($affiliateid, $websiteForm, $oPublisherDll);
    }
} else {
    //either validation failed or form was not submitted, display the form
    displayPage($affiliateid, $websiteForm);
}
/*-------------------------------------------------------*/
/* Build form                                            */
開發者ID:villos,項目名稱:tree_admin,代碼行數:31,代碼來源:affiliate-edit.php


注:本文中的OX_Component::factory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。