本文整理汇总了PHP中Autoload::addVendor方法的典型用法代码示例。如果您正苦于以下问题:PHP Autoload::addVendor方法的具体用法?PHP Autoload::addVendor怎么用?PHP Autoload::addVendor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Autoload
的用法示例。
在下文中一共展示了Autoload::addVendor方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
static function init()
{
$processor = Config::getInstance()->language->processor;
$classname = nameToClass($processor) . 'LanguageProcessor';
Autoload::addVendor('language', $processor);
self::$processor = new $classname();
self::$processor->init();
}
示例2: __construct
public function __construct()
{
$config = Config::getInstance();
$this->trigger("BeforeInit", $this);
$this->params2save += array("id", "user_id", "cast", "ip", "remember_me");
$sessionEngine = Config::getInstance()->session->engine;
$classname = nameToClass($sessionEngine);
Autoload::addVendor("session", $sessionEngine);
$classname .= "Session";
$this->engine = new $classname();
if (!$this->engine instanceof SessionEngine) {
throw new SessionException("Class '{$classname}' is not valid session engine");
}
$this->engine->init();
Controller::getInstance()->onBeforeHeadBodyTail = array($this, "save");
$this->trigger("AfterInit", $this);
register_shutdown_function(array($this, "save"));
}
示例3:
* THIS SOFTWARE IS PROVIDED BY CASSEA PROJECT ''AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL CASSEA PROJECT BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}}} -*/
//
// $Id:$
//
WidgetLoader::load("WComponent");
Autoload::addVendor("feed");
//{{{ WFeedLink
class WFeedLink extends WComponent
{
protected $title = null, $href = null, $type = Feed::ATOM;
// {{{ __construct
/**
* Method description
*
* More detailed method description
* @param void
*/
function __construct($id = null)
{
parent::__construct($id);
}
示例4: init
/**
* Initialize storage-subsystem. Class to be used as
* a storage engine is chosen on the base of config file.
*
* So, if in config string <code>storage_engine='foo'</code>
* exists, file/class FooStorage will be looked up
* int the vendors/storage directory.
*
* @param null
* @return null
*/
static function init()
{
$storageEngine = Config::get('STORAGE_ENGINE');
self::$classname = nameToClass($storageEngine) . 'Storage';
Autoload::addVendor('storage', $storageEngine);
}
示例5: write
/**
* Send the event's message by E-mail
* @param $event
* @return null
*/
public function write($event)
{
try {
Autoload::addVendor('delayedjob');
$towrite = $this->formatter->format($event);
$j = new DelayedJob('sendByDJ', array($towrite, $this->fromname, $this->from, $this->email));
$j->priority(1)->attempts(2)->queue('logger')->add();
} catch (Exception $e) {
throw new LogException($e);
}
}
示例6: array
<?php
Autoload::addVendor("inlinehtml");
Controller::getInstance()->onBeforeBuildWidget = array("InlineHTML", "processDOM");
示例7: cmdUpdate
<?php
Console::InitCore();
Autoload::addVendor('packageManager');
class PackageManagerFacade extends Command
{
// {{{ cmdUpdate
/**
* Обновляет информацию о пакетах в известных репозиториях.
*
* Прокси метод вызывающий pm repository update
*/
function cmdUpdate()
{
require_once 'commands/repository/RepositoryManager.php';
$rm = new RepositoryManager('.', array('name' => 'repository', $this->commandsSeq));
return $rm->cmdUpdate();
}
// }}}
// {{{ cmdUpgrade
/**
* Поиск и установка одновлений для всех пакетов
*/
function cmdUpgrade()
{
PackageManager::get()->startup();
IO::out('~WHITE~Upgrading packages:~~~');
$upack = array();
foreach (PackageManager::getPackageSequence() as $p) {
$upack[$p['name']] = 1;
}
示例8: importUrl
<?php
require_once "FeedData.php";
require_once "RSSFeed.php";
require_once "AtomFeed.php";
Autoload::addVendor("gCurl");
class Grabber
{
public static function importUrl($url)
{
$is_html = false;
$socket = Config::get('feed_grabber_transport');
if ($socket == 'gCurl') {
try {
$curl = new gCurl($url);
$r = $curl->exec();
$h = $r->getHeaderValues('Content-Type');
if (!(strpos($h, "text/html") === false)) {
$is_html = true;
}
} catch (gksException $e) {
$message = $e->getLogMessage();
echo $e->getHtmlMessage();
}
} else {
$f = fopen($url, 'r');
$r = stream_get_contents($f);
$s = stream_get_meta_data($f);
foreach ($s['wrapper_data'] as $w) {
if (preg_match('/^Content-Type:\\s*(\\S+);/', $w, $match) && !empty($match) && $match[1] == "text/html") {
$is_html = true;
示例9: getProfileClass
/**
* Tries to calculate name of the class from config and add to vendor lookup
* paths list retrieved directory.
*
* For performance reasons, obtained classname is memorized in internal private variable.
*
* @param null
* @return string class name of the profile.
*/
private static function getProfileClass()
{
if (self::$profile_classname) {
return self::$profile_classname;
}
try {
if ($_t = Config::getInstance()->profile->name != "cassea") {
//for compatibility
self::$profile_classname = $_t;
}
} catch (ConfigException $e) {
//just normal. Using default profile class
}
Autoload::addVendor(self::$profile_classname);
return self::$profile_classname = nameToClass($profile_classname);
}