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


PHP ezcBase類代碼示例

本文整理匯總了PHP中ezcBase的典型用法代碼示例。如果您正苦於以下問題:PHP ezcBase類的具體用法?PHP ezcBase怎麽用?PHP ezcBase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ezcBase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


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