本文整理汇总了PHP中ezcBase类的典型用法代码示例。如果您正苦于以下问题:PHP ezcBase类的具体用法?PHP ezcBase怎么用?PHP ezcBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ezcBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __autoload
function __autoload($className)
{
try {
ezcBase::autoload($className);
} catch (Exception $e) {
echo $e->getMessage();
}
}
开发者ID:ernestob,项目名称:ezflow,代码行数:8,代码来源:ezpxmlextfilelist.php
示例2: __construct
/**
* Creates a new controller object and sets all the request variables as class variables.
*
* @throws ezcMvcControllerException if the action method is empty
* @param string $action
* @param ezcMvcRequest $request
*/
public function __construct($action, ezcMvcRequest $request)
{
if (ezcBase::inDevMode() && (!is_string($action) || strlen($action) == 0)) {
throw new ezcMvcControllerException("The '" . get_class($this) . "' controller requires an action.");
}
$this->action = $action;
$this->setRequestVariables($request);
}
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:15,代码来源:controller.php
示例3: __callstatic
public static function __callstatic($name, $args)
{
if (ezcBase::getRunMode() == ezcBase::MODE_DEVELOPMENT) {
return call_user_func_array(array(self::$ezcDebugInstance, $name), $args);
} else {
return null;
}
}
开发者ID:jeanvoye,项目名称:utb,代码行数:8,代码来源:logger.php
示例4: __autoload
function __autoload($className)
{
if (strpos($className, '_') !== false) {
$file = str_replace('_', '/', $className) . '.php';
@($val = (require_once $file));
return $val === true;
}
ezcBase::autoload($className);
}
开发者ID:naderman,项目名称:ezc-unit-test,代码行数:9,代码来源:bootstrap.php
示例5: glpiautoload
function glpiautoload($classname)
{
global $DEBUG_AUTOLOAD, $CFG_GLPI;
static $notfound = array();
// empty classname or non concerted plugin
if (empty($classname) || is_numeric($classname)) {
return false;
}
$dir = GLPI_ROOT . "/inc/";
//$classname="PluginExampleProfile";
if ($plug = isPluginItemType($classname)) {
$plugname = strtolower($plug['plugin']);
$dir = GLPI_ROOT . "/plugins/{$plugname}/inc/";
$item = strtolower($plug['class']);
// Is the plugin activate ?
// Command line usage of GLPI : need to do a real check plugin activation
if (isCommandLine()) {
$plugin = new Plugin();
if (count($plugin->find("directory='{$plugname}' AND state=" . Plugin::ACTIVATED)) == 0) {
// Plugin does not exists or not activated
return false;
}
} else {
// Standard use of GLPI
if (!in_array($plugname, $_SESSION['glpi_plugins'])) {
// Plugin not activated
return false;
}
}
} else {
// Is ezComponent class ?
if (preg_match('/^ezc([A-Z][a-z]+)/', $classname, $matches)) {
include_once GLPI_EZC_BASE;
ezcBase::autoload($classname);
return true;
} else {
$item = strtolower($classname);
}
}
// No errors for missing classes due to implementation
if (!isset($CFG_GLPI['missingclasses']) or !in_array($item, $CFG_GLPI['missingclasses'])) {
if (file_exists("{$dir}{$item}.class.php")) {
include_once "{$dir}{$item}.class.php";
if ($_SESSION['glpi_use_mode'] == DEBUG_MODE) {
$DEBUG_AUTOLOAD[] = $classname;
}
} else {
if (!isset($notfound["x{$classname}"])) {
// trigger an error to get a backtrace, but only once (use prefix 'x' to handle empty case)
//logInFile('debug',"file $dir$item.class.php not founded trying to load class $classname\n");
trigger_error("GLPI autoload : file {$dir}{$item}.class.php not founded trying to load class '{$classname}'");
$notfound["x{$classname}"] = true;
}
}
}
}
开发者ID:RubichonL,项目名称:glpi_monitoring,代码行数:56,代码来源:AllTests.php
示例6: __construct
/**
* Creates a ezcBaseMetaData object
*
* The sole parameter $installMethod should only be used if you are really
* sure that you need to use it. It is mostly there to make testing at
* least slightly possible. Again, do not set it unless instructed.
*
* @param string $installMethod
*/
public function __construct($installMethod = NULL)
{
$installMethod = $installMethod !== NULL ? $installMethod : ezcBase::getInstallMethod();
// figure out which reader to use
switch ($installMethod) {
case 'tarball':
$this->reader = new ezcBaseMetaDataTarballReader();
break;
case 'pear':
$this->reader = new ezcBaseMetaDataPearReader();
break;
default:
throw new ezcBaseMetaDataReaderException("Unknown install method '{$installMethod}'.");
break;
}
}
开发者ID:fobiaweb,项目名称:ezc-base,代码行数:25,代码来源:metadata.php
示例7: getRoutingInformation
/**
* Returns routing information, including a controller classname from the set of routes.
*
* This method is run by the dispatcher to obtain a controller. It uses the
* user implemented createRoutes() method from the inherited class to fetch the
* routes. It then loops over these routes in order - the first one that
* matches the request returns the routing information. The loop stops as
* soon as a route has matched. In case none of the routes matched
* with the request data an exception is thrown.
*
* @throws ezcMvcNoRoutesException when there are no routes defined.
* @throws ezcBaseValueException when one of the returned routes was not
* actually an object implementing the ezcMvcRoute interface.
* @throws ezcMvcRouteNotFoundException when no routes matched the request URI.
* @return ezcMvcRoutingInformation
*/
public function getRoutingInformation()
{
$routes = $this->createRoutes();
if (ezcBase::inDevMode() && (!is_array($routes) || !count($routes))) {
throw new ezcMvcNoRoutesException();
}
foreach ($routes as $route) {
if (ezcBase::inDevMode() && !$route instanceof ezcMvcRoute) {
throw new ezcBaseValueException('route', $route, 'instance of ezcMvcRoute');
}
$routingInformation = $route->matches($this->request);
if ($routingInformation !== null) {
return $routingInformation;
}
}
throw new ezcMvcRouteNotFoundException($this->request);
}
开发者ID:jacomyma,项目名称:GEXF-Atlas,代码行数:33,代码来源:router.php
示例8: getRoutingInformation
/**
* Returns routing information, including a controller classname from the set of routes.
*
* This method is run by the dispatcher to obtain a controller. It uses the
* user implemented createRoutes() method from the inherited class to fetch the
* routes. It then loops over these routes in order - the first one that
* matches the request returns the routing information. The loop stops as
* soon as a route has matched. In case none of the routes matched
* with the request data an exception is thrown.
*
* @throws ezcMvcNoRoutesException when there are no routes defined.
* @throws ezcBaseValueException when one of the returned routes was not
* actually an object implementing the ezcMvcRoute interface.
* @throws ezcMvcRouteNotFoundException when no routes matched the request URI.
* @return ezcMvcRoutingInformation
*/
public function getRoutingInformation()
{
$routes = $this->createRoutes();
if (ezcBase::inDevMode() && (!is_array($routes) || !count($routes))) {
throw new ezcMvcNoRoutesException();
}
foreach ($routes as $route) {
if (ezcBase::inDevMode() && !$route instanceof ezcMvcRoute) {
throw new ezcBaseValueException('route', $route, 'instance of ezcMvcRoute');
}
$routingInformation = $route->matches($this->request);
if ($routingInformation !== null) {
// Add the router to the routing information struct, so that
// can be passed to the controllers for reversed route
// generation.
$routingInformation->router = $this;
return $routingInformation;
}
}
throw new ezcMvcRouteNotFoundException($this->request);
}
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:37,代码来源:router.php
示例9: teardown
public function teardown()
{
$options = new ezcBaseAutoloadOptions();
$options->debug = true;
ezcBase::setOptions($options);
}
开发者ID:broschb,项目名称:cyclebrain,代码行数:6,代码来源:base_test.php
示例10: autoload
public static function autoload($className)
{
if (class_exists('ezcBase')) {
ezcBase::autoload($className);
}
}
开发者ID:Kirill,项目名称:mantisbt,代码行数:6,代码来源:MantisGraph.php
示例11: spl_autoload_register
<?php
require_once 'ezc/Base/base.php';
spl_autoload_register(array('ezcBase', 'autoload'));
ezcBase::addClassRepository(realpath(dirname(__FILE__) . '/../src'));
$exampleFiles = glob(dirname(__FILE__) . '/dir/*.php');
$examples = array();
foreach ($exampleFiles as $exampleFile) {
$examples[pathinfo($exampleFile, PATHINFO_FILENAME)] = $exampleFile;
}
if (isset($_GET['example']) && array_key_exists($_GET['example'], $examples)) {
$example = $_GET['example'];
require $examples[$example];
} else {
$example = '';
}
?>
<html>
<head>
<style>
.failed
{
background-color: #CC0000;
}
</style>
</head>
<body>
<div>
<?php
foreach ($examples as $key => $file) {
echo '<a href="?example=', $key, '">', $key, '</a>, ';
开发者ID:jou,项目名称:ymc-components,代码行数:31,代码来源:index.php
示例12: spl_autoload_register
<?php
/**
* WebChecker config php file
* Created on January, the 12th 2010 at 21:26:14 by ronan
*
* @copyright Copyright (C) 2011 Ronan Guilloux. All rights reserved.
* @license http://www.gnu.org/licenses/agpl.html GNU AFFERO GPL v3
* @version //autogen//
* @author Ronan Guilloux - coolforest.net
* @package WebChecker
* @filesource config.php
*/
// SPL autoloading for Zeta components
// see http://incubator.apache.org/zetacomponents/documentation/install.html
require_once 'src/zetacomponents/Base/base.php';
spl_autoload_register( array( 'ezcBase', 'autoload' ) );
// Zeta components autoloading for the all rest :
$options = new ezcBaseAutoloadOptions( array( 'debug' => false, 'preload' => true ) );
ezcBase::setOptions( $options );
ezcBase::addClassRepository( dirname( __FILE__ ) . '/src/checker', null, 'chk' );
// here you can add your own libs using addClassRepository()
// App. settings
$reader = new ezcConfigurationIniReader();
$reader->init( dirname( __FILE__ ), 'settings' );
$ini = $reader->load();
?>
开发者ID:ronanguilloux,项目名称:rgWebCheck,代码行数:30,代码来源:config.php
示例13: __autoload
function __autoload($className)
{
ezcBase::autoload($className);
}
开发者ID:p4prawin,项目名称:livechat,代码行数:4,代码来源:cron.php
示例14: setRunMode
/**
* Sets the development mode to the one specified.
*
* @param int $runMode
*/
public static function setRunMode($runMode)
{
if (!in_array($runMode, array(ezcBase::MODE_PRODUCTION, ezcBase::MODE_DEVELOPMENT))) {
throw new ezcBaseValueException('runMode', $runMode, 'ezcBase::MODE_PRODUCTION or ezcBase::MODE_DEVELOPMENT');
}
self::$runMode = $runMode;
}
开发者ID:khoaanh2212,项目名称:kata-tdd-1-khoa-anh,代码行数:12,代码来源:base.php
示例15: __construct
/**
* Constructor
*
* @param array $options Default option array
* @return void
* @ignore
*/
public function __construct(array $options = array())
{
ezcBase::checkDependency('Graph', ezcBase::DEP_PHP_EXTENSION, 'dom');
$this->options = new ezcGraphSvgDriverOptions($options);
$this->font = new ezcGraphSvgFont();
}
开发者ID:gbleydon,项目名称:mahara-survey,代码行数:13,代码来源:svg.php
示例16: webdav_autoload
/**
* Autoload ezc classes
*
* @param string $className
*/
function webdav_autoload($className)
{
ezcBase::autoload($className);
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:9,代码来源:autoload.php
示例17: getAutoload
static function getAutoload($className)
{
return 'ezcBase' == $className ? 'ezc/Base/base.php' : ezcBase::getAutoload($className);
}
开发者ID:nicolas-grekas,项目名称:Patchwork-sandbox,代码行数:4,代码来源:ezc.php
示例18: dirname
<?php
$root = dirname(__FILE__);
ini_set('include_path', "/usr/share/php/ezc:{$root}");
require 'Base/ezc_bootstrap.php';
$options = new ezcBaseAutoloadOptions(array('debug' => true));
ezcBase::setOptions($options);
// Add the class repository containing our application's classes. We store
// those in the /lib directory and the classes have the "tcl" prefix.
ezcBase::addClassRepository($p = "{$root}/lib", null, 'tcl');
class customLazyCacheConfiguration implements ezcBaseConfigurationInitializer
{
public static function configureObject($id)
{
$options = array('ttl' => 1800);
switch ($id) {
case 'scrapers':
ezcCacheManager::createCache('scrapers', '../cache/scrapers', 'ezcCacheStorageFilePlain', $options);
break;
}
}
}
ezcBaseInit::setCallback('ezcInitCacheManager', 'customLazyCacheConfiguration');
开发者ID:bdunogier,项目名称:tcl,代码行数:23,代码来源:config.php
示例19: runResponseFilters
function runResponseFilters(ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result, ezcMvcResponse $response)
{
if (!ezcBase::inDevMode()) {
if (in_array('gzip', $request->accept->encodings)) {
$filter = new ezcMvcGzipResponseFilter();
$filter->filterResponse($response);
} else {
if (in_array('deflate', $request->accept->encodings)) {
$filter = new ezcMvcGzDeflateResponseFilter();
$filter->filterResponse($response);
}
}
}
}
开发者ID:jeanvoye,项目名称:utb,代码行数:14,代码来源:config.php
示例20: exit
#!/usr/bin/php5
<?php
if (php_sapi_name() != 'cli') {
echo "PHP code to execute directly on the command line\n";
exit(-1);
}
ini_set('error_reporting', E_ALL);
ini_set('register_globals', 0);
ini_set('display_errors', 1);
ini_set("max_execution_time", "3600");
require_once "lib/core/lhcore/password.php";
require_once "ezcomponents/Base/src/base.php";
// dependent on installation method, see below
require_once 'cli/lib/install.php';
ezcBase::addClassRepository('./', './lib/autoloads');
spl_autoload_register(array('ezcBase', 'autoload'), true, false);
#erLhcoreClassSystem::init();
// your code here
ezcBaseInit::setCallback('ezcInitDatabaseInstance', 'erLhcoreClassLazyDatabaseConfiguration');
$cfgSite = erConfigClassLhConfig::getInstance();
if ($cfgSite->getSetting('site', 'installed') == true) {
print 'Live helper chat installation complete';
exit;
}
$instance = erLhcoreClassSystem::instance();
function validate_args($argv, $argc)
{
if ($argc != 2) {
echo "Wrong number of parameters.\n";
return 1;
}
开发者ID:detain,项目名称:livehelperchat,代码行数:31,代码来源:install-cli.php
注:本文中的ezcBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论