本文整理汇总了PHP中CakePlugin::path方法的典型用法代码示例。如果您正苦于以下问题:PHP CakePlugin::path方法的具体用法?PHP CakePlugin::path怎么用?PHP CakePlugin::path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakePlugin
的用法示例。
在下文中一共展示了CakePlugin::path方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testParse
public function testParse()
{
$path = CakePlugin::path('Translations') . 'Test/Files/simple.plist';
$result = PlistParser::parse($path);
$expected = array('count' => 1, 'translations' => array(array('locale' => 'en', 'domain' => 'default', 'category' => 'LC_MESSAGES', 'key' => 'foo', 'value' => 'foo value')));
$this->assertSame($expected, $result);
}
示例2: suite
/**
* Suite define the tests for this suite
*
* @return void
*/
public static function suite()
{
$suite = new CakeTestSuite('All Bs3Helpers tests');
$path = CakePlugin::path('Bs3Helpers') . 'Test' . DS . 'Case' . DS . 'View' . DS . 'Helper' . DS;
$suite->addTestDirectory($path);
return $suite;
}
示例3: testImageFromBlob
/**
* HtmlExtHelperTest::testImageFromBlob()
*
* @return void
*/
public function testImageFromBlob()
{
$folder = CakePlugin::path('Tools') . 'Test' . DS . 'test_files' . DS . 'img' . DS;
$content = file_get_contents($folder . 'hotel.png');
$is = $this->Html->imageFromBlob($content);
$this->assertTrue(!empty($is));
}
示例4: _configTestFile
protected function _configTestFile($path = null, $baseKey = null)
{
if ($path === null) {
$path = CakePlugin::path('YamlReader') . 'Test' . DS . 'files' . DS;
}
Configure::config('YamlTestConfig', new YamlReader($path, $baseKey));
}
示例5: setUp
public function setUp()
{
$this->FileManager = new FileManager(false, null, null, null);
$this->__testAppPath = CakePlugin::path('FileManager') . 'Test' . DS . 'test_app' . DS;
$this->__setFilePathsForTests();
parent::setUp();
}
示例6: _basePath
/**
* Generates the base path to a set of tests based on the parameters.
*
* @param array $params
* @return string The base path.
*/
protected static function _basePath($params)
{
$result = null;
if (!empty($params['core'])) {
$result = CORE_TEST_CASES;
// CUSTOMIZE ADD 2014/07/02 ryuring
// >>>
} elseif ($params['baser']) {
$result = BASER_TEST_CASES;
// <<<
} elseif (!empty($params['plugin'])) {
if (!CakePlugin::loaded($params['plugin'])) {
try {
CakePlugin::load($params['plugin']);
$result = CakePlugin::path($params['plugin']) . 'Test' . DS . 'Case';
} catch (MissingPluginException $e) {
}
} else {
$result = CakePlugin::path($params['plugin']) . 'Test' . DS . 'Case';
}
} elseif (!empty($params['app'])) {
$result = APP_TEST_CASES;
}
return $result;
}
示例7: suite
public static function suite()
{
$suite = new CakeTestSuite('OAuth Tests');
$path = CakePlugin::path('OAuth') . 'Test' . DS . 'Case' . DS;
$suite->addTestDirectory($path . 'Model' . DS . 'Behavior');
return $suite;
}
示例8: setUp
public function setUp()
{
parent::setUp();
App::build(['Model' => [CakePlugin::path('Tools') . 'Test' . DS . 'test_app' . DS . 'Model' . DS]], App::RESET);
$this->Comment = ClassRegistry::init('BitmaskedComment');
$this->Comment->Behaviors->load('Tools.Bitmasked', ['mappedField' => 'statuses']);
}
示例9: suite
/**
* Suite define the tests for this suite
*
* @return void
*/
public static function suite()
{
$suite = new CakeTestSuite('All Datasources test');
$path = CakePlugin::path('InlineCss') . 'Test' . DS . 'Case' . DS;
$suite->addTestDirectoryRecursive($path);
return $suite;
}
示例10: init
/**
* Initialization.
*
* It loads the required classes for web and cli environments.
*
* @throws ConfigureException if needed configuration parameters are not found.
* @param array $config Configuration options.
* @return void
*/
public static function init($config = null)
{
self::loadConfig($config);
if (!($redis = Configure::read('CakeResque.Redis')) || !($resqueLib = Configure::read('CakeResque.Resque.lib')) || !($schedulerLib = Configure::read('CakeResque.Scheduler.lib')) || !($statusLib = Configure::read('CakeResque.Status.lib'))) {
throw new ConfigureException(__d('cake_resque', 'There is an error in the configuration file.'));
}
if (empty($redis['host']) || empty($redis['port']) || empty($redis['database']) && !is_numeric($redis['database']) || empty($redis['namespace'])) {
throw new ConfigureException(__d('cake_resque', 'There is an error in the Redis configuration key.'));
}
$pluginVendorPath = CakePlugin::path('CakeResque') . 'vendor' . DS;
if (!Folder::isAbsolute($resqueLib)) {
$resqueLib = $pluginVendorPath . $resqueLib;
}
$resqueLib .= DS . 'lib' . DS;
if (!Folder::isAbsolute($schedulerLib)) {
$schedulerLib = $pluginVendorPath . $schedulerLib;
}
$schedulerLib .= DS . 'lib' . DS . 'ResqueScheduler' . DS;
if (!Folder::isAbsolute($statusLib)) {
$statusLib = $pluginVendorPath . $statusLib;
}
require_once realpath($resqueLib . 'Resque.php');
require_once realpath($resqueLib . 'Resque' . DS . 'Worker.php');
require_once realpath($schedulerLib . 'ResqueScheduler.php');
require_once realpath($schedulerLib . 'Stat.php');
require_once realpath($schedulerLib . 'Job' . DS . 'Status.php');
require_once realpath($statusLib . DS . 'src' . DS . 'ResqueStatus' . DS . 'ResqueStatus.php');
Resque::setBackend($redis['host'] . ':' . $redis['port'], $redis['database'], $redis['namespace']);
}
示例11: suite
/**
* Suite define the tests for this plugin
*
* @return void
*/
public static function suite()
{
$suite = new CakeTestSuite('All VatNumberCheck test');
$path = CakePlugin::path('VatNumberCheck') . 'Test' . DS . 'Case' . DS;
$suite->addTestDirectoryRecursive($path);
return $suite;
}
示例12: suite
public static function suite()
{
$suite = new CakeTestSuite('All Extensions plugin tests');
$path = CakePlugin::path('Extensions') . DS . 'Test' . DS . 'Case' . DS;
$suite->addTestDirectory($path . 'Lib');
return $suite;
}
示例13: setUp
/**
* setUp method
*/
public function setUp()
{
parent::setUp();
App::build(array('Plugin' => array(CakePlugin::path('Migrations') . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)), APP::RESET);
$this->connection = 'test';
$this->Migrations = new Migrations($this->connection);
}
示例14: getAssetFile
/**
* Builds asset file path based off url
*
* @param string $url
* @return string Absolute path for asset file
*/
static function getAssetFile($url)
{
$parts = explode('/', $url);
if ($parts[0] === 'theme') {
$file = '';
$fileFragments = explode(',', $url);
$fileNumber = count($fileFragments);
foreach ($fileFragments as $k => $fileFragment) {
$fileParts = explode('/', $fileFragment);
unset($fileParts[0], $fileParts[1]);
if ($fileNumber == $k + 1) {
$file .= urldecode(implode(DS, $fileParts));
} else {
$file .= urldecode(implode(DS, $fileParts)) . ',';
}
}
$themeName = $parts[1];
$path = Configure::read('App.www_root') . 'theme' . DS . $themeName;
if (!file_exists($path)) {
$path = App::themePath($themeName) . 'webroot';
}
return array($path, $file);
}
$plugin = Inflector::camelize($parts[0]);
if (CakePlugin::loaded($plugin)) {
unset($parts[0]);
$fileFragment = urldecode(implode(DS, $parts));
$pluginWebroot = CakePlugin::path($plugin) . 'webroot';
return array($pluginWebroot, $fileFragment);
} else {
return array(WWW_ROOT, $_GET['f']);
}
}
示例15: suite
public static function suite()
{
$suite = new CakeTestSuite('All Acl component class tests');
$path = CakePlugin::path('Acl') . DS . 'Test' . DS . 'Case';
$suite->addTestDirectory($path . DS . 'Controller' . DS . 'Component');
return $suite;
}