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


PHP Libraries::add方法代碼示例

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


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

示例1: tearDown

 public function tearDown()
 {
     $_SERVER = $this->_backup['_SERVER'];
     chdir($this->_backup['cwd']);
     Libraries::add('app', $this->_backup['app']);
     $this->_cleanUp();
 }
開發者ID:kdambekalns,項目名稱:framework-benchs,代碼行數:7,代碼來源:CreateTest.php

示例2: testConfig

 public function testConfig()
 {
     $oldConfig = Libraries::get('li3_facebook');
     Libraries::remove('li3_facebook');
     Libraries::add('li3_facebook');
     FacebookProxy::$_autoConfigure = false;
     FacebookProxy::__init();
     $this->assertEqual(FacebookProxy::config(), array(), 'config should be empty.');
     $this->assertEqual(FacebookProxy::config(array()), array(), 'config should be empty.');
     //check ignoring
     FacebookProxy::reset();
     $result = FacebookProxy::config(array('foo'));
     $this->assertTrue($result, array(), 'config should return true');
     $this->assertIdentical(FacebookProxy::config(), array(), 'config should be empty');
     //check ingoring vs. existing but unset associations
     FacebookProxy::reset();
     $result = FacebookProxy::config(array('appId'));
     $this->assertTrue($result, array(), 'config should return true');
     $this->assertIdentical(FacebookProxy::config(), array(), 'config should be empty');
     //check valid Settings
     FacebookProxy::reset();
     $sampleConfig = array('appId' => 'hello');
     $result = FacebookProxy::config($sampleConfig);
     $this->assertTrue($result, 'config should return true');
     $this->assertIdentical(FacebookProxy::config(), $sampleConfig, 'config should not be empty');
     //check vs. complete Settings
     FacebookProxy::reset();
     $result = FacebookProxy::config($this->_mockDefaults);
     $this->assertTrue($result, 'config should return true');
     $this->assertIdentical(FacebookProxy::config(), $this->_mockDefaults, 'config should not be empty');
     Libraries::remove('li3_facebook');
     Libraries::add('li3_facebook', $oldConfig);
     //FaceBookProxy::foo();
     //die(print_r(array($result,FacebookProxy::config()),true));
 }
開發者ID:tmaiaroto,項目名稱:li3_facebook,代碼行數:35,代碼來源:FacebookProxyTest.php

示例3: setUp

	public function setUp() {
		$this->_backup['cwd'] = getcwd();
		$this->_backup['_SERVER'] = $_SERVER;
		$_SERVER['argv'] = array();

		chdir($this->_testPath);

		Libraries::add('library_test', array(
			'path' => $this->_testPath . '/library_test', 'bootstrap' => false
		));

		Libraries::add('library_test_plugin', array(
			'path' => $this->_testPath . '/library_test_plugin'
		));

		$this->classes = array(
			'service' => 'lithium\tests\mocks\console\command\MockLibraryService',
			'response' => 'lithium\tests\mocks\console\MockResponse'
		);
		$this->request = new Request(array('input' => fopen('php://temp', 'w+')));
		$this->library = new Library(array(
			'request' => $this->request, 'classes' => $this->classes
		));
		$this->testConf = $this->library->conf = $this->_testPath . '/library.json';
	}
開發者ID:niel,項目名稱:lithium,代碼行數:25,代碼來源:LibraryTest.php

示例4: renderer

 /**
  * instantiates and returns instance of neon-renderer
  *
  * @return object instance of NeonRenderer
  */
 public static function renderer()
 {
     if (is_null(static::$_renderer)) {
         Libraries::add('Neon', array('path' => RADIUM_PATH . '/libraries/neon'));
         static::$_renderer = new NeonRenderer();
     }
     return static::$_renderer;
 }
開發者ID:bruensicke,項目名稱:radium,代碼行數:13,代碼來源:Neon.php

示例5: tearDown

 public function tearDown()
 {
     foreach ($this->_superglobals as $varname) {
         $GLOBALS[$varname] = $this->_env[$varname];
     }
     Libraries::remove('app');
     Libraries::add($this->_library['name'], $this->_library);
     $this->_cleanUp();
 }
開發者ID:nilamdoc,項目名稱:KYCGlobal,代碼行數:9,代碼來源:RequestTest.php

示例6: testShouldRunSetsLibraryConfig

 public function testShouldRunSetsLibraryConfig()
 {
     $config = $this->selfConfig;
     unset($config['shouldRun']);
     Libraries::add('li3_newrelic', $this->selfConfig);
     $result = NewrelicMock::shouldRun();
     $config = Libraries::get('li3_newrelic');
     $this->assertArrayHasKey('shouldRun', $config);
     $this->assertInternalType('bool', $result);
 }
開發者ID:mdx-dev,項目名稱:li3_newrelic,代碼行數:10,代碼來源:NewrelicTest.php

示例7: setUp

 public function setUp()
 {
     $this->_backup['cwd'] = getcwd();
     $this->_backup['_SERVER'] = $_SERVER;
     $_SERVER['argv'] = array();
     Libraries::add('create_test', array('path' => $this->_testPath . '/create_test'));
     $this->request = new Request(array('input' => fopen('php://temp', 'w+')));
     $this->request->params = array('library' => 'create_test', 'action' => null);
     Connections::add('default', array('type' => null, 'adapter' => 'lithium\\tests\\mocks\\data\\model\\MockDatabase'));
 }
開發者ID:davidpersson,項目名稱:FrameworkBenchmarks,代碼行數:10,代碼來源:CreateTest.php

示例8: setUp

 public function setUp()
 {
     $this->classes = array('response' => 'lithium\\tests\\mocks\\console\\MockResponse');
     $this->_backup['cwd'] = getcwd();
     $this->_backup['_SERVER'] = $_SERVER;
     $_SERVER['argv'] = array();
     Libraries::add('create_test', array('path' => $this->_testPath . '/create_test'));
     $this->request = new Request(array('input' => fopen('php://temp', 'w+')));
     $this->request->params = array('library' => 'create_test');
 }
開發者ID:unionofrad,項目名稱:lithium,代碼行數:10,代碼來源:MockTest.php

示例9: shouldRun

 /**
  *
  * Determines if we should run any `newrelic_` methods.
  *
  * If the configuration for the plugin `shouldRun` does not exist, set
  * a generic one.
  *
  * @return bool
  */
 public static function shouldRun()
 {
     if (!is_callable(Libraries::get('li3_newrelic', 'shouldRun'))) {
         $config = Libraries::get('li3_newrelic');
         $config['shouldRun'] = function () {
             return Environment::is('production') && extension_loaded('newrelic');
         };
         Libraries::add('li3_newrelic', $config);
     }
     return Libraries::get('li3_newrelic', 'shouldRun')->__invoke();
 }
開發者ID:mdx-dev,項目名稱:li3_newrelic,代碼行數:20,代碼來源:Newrelic.php

示例10: testEmptyConfig

 public function testEmptyConfig()
 {
     $oldConfig = Libraries::get('li3_facebook');
     $subject = new Facebook();
     //disable validation inside the proxy
     FacebookProxy::$_validateConfiguration = false;
     Libraries::remove('li3_facebook');
     Libraries::add('li3_facebook');
     $this->expectException('Configuration: `appId` should be set');
     $this->assertTrue($subject->check($this->request));
     Libraries::remove('li3_facebook');
     Libraries::add('li3_facebook', $oldConfig);
 }
開發者ID:tmaiaroto,項目名稱:li3_facebook,代碼行數:13,代碼來源:FacebookTest.php

示例11: setUp

 public function setUp()
 {
     $this->_backup['cwd'] = getcwd();
     $this->_backup['_SERVER'] = $_SERVER;
     $_SERVER['argv'] = array();
     $this->_testPath = LITHIUM_APP_PATH . '/resources/tmp/tests';
     chdir($this->_testPath);
     Libraries::add('library_test', array('path' => $this->_testPath . '/library_test'));
     Libraries::add('plugin', array('library_test_plugin' => array('path' => $this->_testPath . '/library_test_plugin')));
     $this->classes = array('service' => '\\lithium\\tests\\mocks\\console\\command\\MockLibraryService', 'response' => '\\lithium\\tests\\mocks\\console\\MockResponse');
     $this->request = new Request(array('input' => fopen('php://temp', 'w+')));
     $this->library = new Library(array('request' => $this->request, 'classes' => $this->classes));
     $this->library->conf = $this->_conf = $this->_testPath . '/library.json';
 }
開發者ID:kdambekalns,項目名稱:framework-benchs,代碼行數:14,代碼來源:LibraryTest.php

示例12: array

<?php

/**
 * Lithium: the most rad php framework
 *
 * @copyright     Copyright 2009, Union of RAD (http://union-of-rad.org)
 * @license       http://opensource.org/licenses/bsd-license.php The BSD License
 */
use lithium\core\Libraries;
/**
 * Add the `phpca` library.
 */
Libraries::add('phpca', array('prefix' => 'spriebsch\\PHPca\\', 'path' => dirname(__DIR__) . '/libraries/phpca/src', 'bootstrap' => 'Autoload.php'));
開發者ID:raisinbread,項目名稱:li3_qa,代碼行數:13,代碼來源:bootstrap.php

示例13: ErrorException

<?php

define('LITHIUM_LIBRARY_PATH', 'phar://lithium.phar');
if (!(include LITHIUM_LIBRARY_PATH . '/lithium/core/Libraries.php')) {
    $message = "Lithium core could not be found.  Check the value of LITHIUM_LIBRARY_PATH.";
    throw new ErrorException($message);
}
use lithium\core\Libraries;
Libraries::add('lithium');
開發者ID:raisinbread,項目名稱:sinatrium,代碼行數:9,代碼來源:bootstrap.php

示例14: array

require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Message.php';
require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Media.php';
require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Request.php';
require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Response.php';
require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Route.php';
require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Router.php';
require LITHIUM_LIBRARY_PATH . '/lithium/action/Controller.php';
require LITHIUM_LIBRARY_PATH . '/lithium/action/Dispatcher.php';
require LITHIUM_LIBRARY_PATH . '/lithium/action/Request.php';
require LITHIUM_LIBRARY_PATH . '/lithium/action/Response.php';
require LITHIUM_LIBRARY_PATH . '/lithium/template/View.php';
require LITHIUM_LIBRARY_PATH . '/lithium/template/view/Renderer.php';
require LITHIUM_LIBRARY_PATH . '/lithium/template/view/Compiler.php';
require LITHIUM_LIBRARY_PATH . '/lithium/template/view/adapter/File.php';
require LITHIUM_LIBRARY_PATH . '/lithium/storage/Cache.php';
require LITHIUM_LIBRARY_PATH . '/lithium/storage/cache/adapter/Apc.php';
/**
 * Add the Lithium core library.  This sets default paths and initializes the autoloader.  You
 * generally should not need to override any settings.
 */
Libraries::add('lithium');
/**
 * Add the application.  You can pass a `'path'` key here if this bootstrap file is outside of
 * your main application, but generally you should not need to change any settings.
 */
Libraries::add('app', array('default' => true));
/**
 * Add some plugins
 */
Libraries::add('li3_twig', array('bootstrap' => true));
開發者ID:nervetattoo,項目名稱:li3_backbone,代碼行數:30,代碼來源:libraries.php

示例15: array

require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Route.php';
require LITHIUM_LIBRARY_PATH . '/lithium/net/http/Router.php';
require LITHIUM_LIBRARY_PATH . '/lithium/action/Controller.php';
require LITHIUM_LIBRARY_PATH . '/lithium/action/Dispatcher.php';
require LITHIUM_LIBRARY_PATH . '/lithium/action/Request.php';
require LITHIUM_LIBRARY_PATH . '/lithium/action/Response.php';
require LITHIUM_LIBRARY_PATH . '/lithium/template/View.php';
require LITHIUM_LIBRARY_PATH . '/lithium/template/view/Renderer.php';
require LITHIUM_LIBRARY_PATH . '/lithium/template/view/Compiler.php';
require LITHIUM_LIBRARY_PATH . '/lithium/template/view/adapter/File.php';
require LITHIUM_LIBRARY_PATH . '/lithium/storage/Cache.php';
require LITHIUM_LIBRARY_PATH . '/lithium/storage/cache/adapter/Apc.php';
/**
 * Add the Lithium core library.  This sets default paths and initializes the autoloader.  You
 * generally should not need to override any settings.
 */
Libraries::add('lithium');
/**
 * Add the application.  You can pass a `'path'` key here if this bootstrap file is outside of
 * your main application, but generally you should not need to change any settings.
 */
Libraries::add('app', array('default' => true));
/**
 * Add some plugins:
 */
//Libraries::add('li3_show');
Libraries::add('li3_qrcode');
Libraries::add('li3_pdf');
Libraries::add('jpgraph', array('bootstrap' => 'jpgraph_required.php'));
Libraries::add('swiftmailer', array('bootstrap' => 'swift_required.php'));
開發者ID:nilamdoc,項目名稱:KYCGlobal,代碼行數:30,代碼來源:libraries.php


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