当前位置: 首页>>代码示例>>PHP>>正文


PHP AkConfig::getDir方法代码示例

本文整理汇总了PHP中AkConfig::getDir方法的典型用法代码示例。如果您正苦于以下问题:PHP AkConfig::getDir方法的具体用法?PHP AkConfig::getDir怎么用?PHP AkConfig::getDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AkConfig的用法示例。


在下文中一共展示了AkConfig::getDir方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test_should_connect_using_custom_namespace

 public function test_should_connect_using_custom_namespace()
 {
     file_put_contents(AkConfig::getDir('config') . '/testing_object_database.yml', AkConfig::getDir('fixtures') . '/sample_config.yml');
     $this->db->settings_namespace = 'testing_object_database';
     $this->assertTrue($this->db->setupAdapter());
     unlink(AkConfig::getDir('config') . '/testing_object_database.yml');
 }
开发者ID:bermi,项目名称:akelos,代码行数:7,代码来源:document_adapter.php

示例2: test_should_fill_the_table_with_yaml_data

 public function test_should_fill_the_table_with_yaml_data()
 {
     $unit_tester = new AkUnitTest();
     $unit_tester->installAndIncludeModels(array('TheModel' => 'id,name'));
     $TheModel =& $unit_tester->TheModel;
     $TheModel->create(array('name' => 'eins'));
     $TheModel->create(array('name' => 'zwei'));
     $TheModel->create(array('name' => 'drei'));
     $TheModel->create(array('name' => 'vier'));
     $this->assertEqual($TheModel->count(), 4);
     $this->assertTrue($AllRecords = $TheModel->find());
     $yaml = $TheModel->toYaml($AllRecords);
     $yaml_path = AkConfig::getDir('fixtures') . DS . 'the_models.yml';
     $this->assertFalse(file_exists($yaml_path));
     AkFileSystem::file_put_contents($yaml_path, $yaml);
     $unit_tester->installAndIncludeModels(array('TheModel' => 'id,name'));
     try {
         $TheModel->find();
     } catch (RecordNotFoundException $e) {
         $this->pass();
     }
     $this->assertEqual($TheModel->count(), 0);
     $unit_tester->installAndIncludeModels(array('TheModel' => 'id,name'), array('populate' => true));
     $this->assertEqual($TheModel->count(), 4);
     unlink($yaml_path);
 }
开发者ID:bermi,项目名称:akelos,代码行数:26,代码来源:unit_test.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     foreach (glob(AkConfig::getDir('config') . '/locales/*.php') as $file) {
         $this->original_locales[$file] = file_get_contents($file);
     }
 }
开发者ID:bermi,项目名称:akelos,代码行数:7,代码来源:locale_manager.php

示例4: setUp

 public function setUp()
 {
     $this->PluginInstaller = new AkPluginInstaller();
     $this->PluginInstaller->app_app_dir = AkConfig::getDir('fixtures');
     copy($this->template_path, $this->target_path);
     $this->PluginInstaller->extension_points = array('PluginInstallerTargetClass' => 'plugin_installer_target_class.php');
 }
开发者ID:bermi,项目名称:akelos,代码行数:7,代码来源:plugin_installer.php

示例5: _run_from_file

 public function _run_from_file($file_name, $all_in_one_test = true)
 {
     $multiple_expected_php = $multiple_sintags = '';
     $tests = explode('===================================', file_get_contents(AkConfig::getDir('fixtures') . DS . $file_name));
     foreach ($tests as $test) {
         list($sintags, $php) = explode('-----------------------------------', $test);
         $sintags = trim($sintags);
         $expected_php = trim($php);
         if (empty($sintags)) {
             return;
         } else {
             $multiple_sintags .= $sintags;
             $multiple_expected_php .= $expected_php;
         }
         $AkSintags = new AkSintagsParser();
         $php = $AkSintags->parse($sintags);
         if ($php != $expected_php) {
             AkDebug::trace("GENERATED: \n" . $php);
             AkDebug::trace("EXPECTED: \n" . $expected_php);
             AkDebug::trace("SINTAGS: \n" . $sintags);
         }
         $this->assertEqual($php, $expected_php);
     }
     if ($all_in_one_test) {
         $AkSintags = new AkSintagsParser();
         $php = $AkSintags->parse($multiple_sintags);
         if ($php != $multiple_expected_php) {
             AkDebug::trace("GENERATED: \n" . $php);
             AkDebug::trace("EXPECTED: \n" . $expected_php);
             AkDebug::trace("SINTAGS: \n" . $sintags);
         }
         $this->assertEqual($php, $multiple_expected_php);
     }
 }
开发者ID:bermi,项目名称:akelos,代码行数:34,代码来源:sintags.php

示例6: test_should_generate_controller_and_auxiliary_files

 public function test_should_generate_controller_and_auxiliary_files()
 {
     $files = array(AkConfig::getDir('controllers') . DS . 'credit_card_controller.php', AkConfig::getDir('helpers') . DS . 'credit_card_helper.php', AkConfig::getDir('test') . DS . 'functional' . DS . 'controllers' . DS . 'credit_card_controller_test.php', AkConfig::getDir('test') . DS . 'unit' . DS . 'helpers' . DS . 'credit_card_helper_test.php', AkConfig::getDir('views') . DS . 'credit_card' . DS . 'open.html.tpl', AkConfig::getDir('views') . DS . 'credit_card' . DS . 'debit.html.tpl', AkConfig::getDir('views') . DS . 'credit_card' . DS . 'credit.html.tpl', AkConfig::getDir('views') . DS . 'credit_card' . DS . 'close.html.tpl');
     clearstatcache();
     foreach ($files as $file) {
         file_exists($file) && unlink($file);
         $this->assertFalse(file_exists($file));
     }
     AkFileSystem::file_put_contents(AkConfig::getDir('views') . DS . 'credit_card' . DS . 'credit.html.tpl', 'foo', array('base_path' => AK_FRAMEWORK_DIR));
     clearstatcache();
     $this->assertPattern('/collisions/', $this->runGeneratorCommand('controller CreditCard open debit credit close'));
     AkFileSystem::file_delete(AkConfig::getDir('views') . DS . 'credit_card' . DS . 'credit.html.tpl', array('base_path' => AK_FRAMEWORK_DIR));
     clearstatcache();
     foreach ($files as $file) {
         $this->assertFalse(file_exists($file));
     }
     $this->assertPattern('/ files have been created/', $this->runGeneratorCommand('controller CreditCard open debit credit close'));
     clearstatcache();
     foreach ($files as $file) {
         $this->assertTrue(file_exists($file));
         if (!file_exists($file)) {
             AkDebug::trace($file);
         }
         @unlink($file);
     }
 }
开发者ID:bermi,项目名称:akelos,代码行数:26,代码来源:generators.php

示例7: createTemplate

 public function createTemplate($file_name, $content = 'Dummy')
 {
     $file_name = str_replace('/', DS, $file_name);
     $file_name = AkConfig::getDir('views') . DS . $file_name;
     $this->assertTrue((bool) AkFileSystem::file_put_contents($file_name, $content));
     $this->created_files[] = $file_name;
 }
开发者ID:bermi,项目名称:akelos,代码行数:7,代码来源:template_unit_test.php

示例8: index

 public function index()
 {
     $this->base_dir = AK_BASE_DIR;
     $this->akelos_dir = AK_FRAMEWORK_DIR;
     $this->tasks_dir = AK_TASKS_DIR;
     $this->has_configuration = file_exists(AkConfig::getDir('config') . DS . 'config.php');
     $this->has_routes = file_exists(AkConfig::getDir('config') . DS . 'routes.php');
     $this->has_database = file_exists(AkConfig::getDir('config') . DS . 'database.yml');
     $this->using_root_path = $this->Request->getPath() == '/';
     $this->new_install = !$this->has_configuration || !$this->has_routes || $this->using_root_path;
     $this->environment = AK_ENVIRONMENT;
     $this->memcached_on = AkMemcache::isServerUp();
     $this->constants = AkDebug::get_constants();
     $this->langs = Ak::langs();
     $this->database_settings = Ak::getSettings('database', false);
     $this->server_user = trim(AK_WIN ? `ECHO %USERNAME%` : `whoami`);
     $this->local_ips = AkConfig::getOption('local_ips', array('localhost', '127.0.0.1', '::1'));
     $paths = array(AK_APP_DIR . DS . 'locales');
     $this->invalid_permissions = array();
     foreach ($paths as $path) {
         if (is_dir($path) && !@file_put_contents($path . DS . '__test_file')) {
             $this->invalid_permissions[] = $path;
         } else {
             @unlink($path . DS . '__test_file');
         }
     }
 }
开发者ID:bermi,项目名称:akelos,代码行数:27,代码来源:akelos_dashboard_controller.php

示例9: test_get_methods_filtered

 public function test_get_methods_filtered()
 {
     $file = AkConfig::getDir('fixtures') . DS . 'reflection_test_class.php';
     $class = new AkReflectionClass(file_get_contents($file));
     $filteredMethods = $class->getMethods(array('tags' => array('WingsPluginInstallAs' => '.*')));
     $this->assertEqual(1, count($filteredMethods));
     $this->assertEqual('testFunction2', $filteredMethods[0]->getName());
 }
开发者ID:bermi,项目名称:akelos,代码行数:8,代码来源:reflection_class.php

示例10: testPickLayoutIfActionameMatches

 public function testPickLayoutIfActionameMatches()
 {
     $this->createViewTemplate('index.html');
     $this->createTemplate('layouts/application.tpl');
     $controller = $this->createControllerFor('index');
     $controller->setLayout('application', array('only' => 'index'));
     $this->expectRender(array('index.html', AkConfig::getDir('views') . DS . 'layouts/application.tpl'));
     $controller->defaultRender();
 }
开发者ID:bermi,项目名称:akelos,代码行数:9,代码来源:template_paths.php

示例11: test_setup

 public function test_setup()
 {
     $original_fixtures = AkConfig::getDir('fixtures');
     AkConfig::setDir('fixtures', AkConfig::getDir('suite') . DS . 'fixtures');
     $this->uninstallAndInstallMigration('AdminPlugin');
     $this->Extension = new Extension();
     $this->populateTables('extensions');
     AkConfig::setDir('fixtures', $original_fixtures);
 }
开发者ID:bermi,项目名称:admin,代码行数:9,代码来源:extension.php

示例12: test_special1

 public function test_special1()
 {
     $filename = AkConfig::getDir('fixtures') . DS . 'reflection_doc_block_test_class.php';
     $file = new AkReflectionFile($filename);
     $this->assertEqual(1, count($file->getClasses()));
     $classes = $file->getClasses();
     $this->assertEqual('ReflectionDocBlockTestClass', $classes[0]->getName());
     $class = $classes[0];
     $this->assertEqual('BaseActiveRecord', $class->getTag('ExtensionPoint'));
 }
开发者ID:bermi,项目名称:akelos,代码行数:10,代码来源:reflection_file.php

示例13: getFilePaths

 public function getFilePaths()
 {
     $this->_setDefaults();
     $views_path = AkConfig::getDir('views') . DS . $this->table_name;
     $files = array($this->controller_file_name => 'controller', AkConfig::getDir('views') . DS . 'layouts' . DS . $this->table_name . '.tpl' => 'layout');
     foreach (array('_form', 'add', 'edit', 'index', 'show') as $action) {
         $files[$views_path . DS . $action . '.html.tpl'] = $action;
     }
     return $files;
 }
开发者ID:bermi,项目名称:akelos,代码行数:10,代码来源:scaffold_controller_generator.php

示例14: test_should_get_all_controllers_with_their_actions

 public function test_should_get_all_controllers_with_their_actions()
 {
     $available_controllers = (array) AkFileSystem::dir(AkConfig::getDir('controllers'), array('dirs' => false));
     $got = $this->menu_helper->_get_default_full_menu();
     foreach ($available_controllers as $controller_filename) {
         $controller_name = str_replace('_controller.php', '', $controller_filename);
         $this->assertTrue(isset($got[$controller_name]));
     }
     $this->assertTrue(in_array('authenticate', $got['authentication']));
 }
开发者ID:bermi,项目名称:akelos,代码行数:10,代码来源:menu_helper.php

示例15: trim

 public function &recognize($Map = null)
 {
     $this->_startSession();
     $this->_enableInternationalizationSupport();
     $this->mapRoutes($Map);
     $params = $this->getParams();
     $module_path = $module_class_peffix = '';
     if (!empty($params['module'])) {
         $module_path = trim(str_replace(array('/', '\\'), DS, Ak::sanitize_include($params['module'], 'high')), DS) . DS;
         $module_shared_model = AkConfig::getDir('controllers') . DS . trim($module_path, DS) . '_controller.php';
         $module_class_peffix = str_replace(' ', '_', AkInflector::titleize(str_replace(DS, ' ', trim($module_path, DS)))) . '_';
     }
     $controller_file_name = AkInflector::underscore($params['controller']) . '_controller.php';
     $controller_class_name = $module_class_peffix . AkInflector::camelize($params['controller']) . 'Controller';
     $controller_path = AkConfig::getDir('controllers') . DS . $module_path . $controller_file_name;
     if (!empty($module_path) && file_exists($module_shared_model)) {
         include_once $module_shared_model;
     }
     if (!is_file($controller_path) || !(include_once $controller_path)) {
         AK_LOG_EVENTS && Ak::getLogger()->error('Controller ' . $controller_path . ' not found.');
         if (AK_ENVIRONMENT == 'development') {
             trigger_error(Ak::t('Could not find the file /app/controllers/<i>%controller_file_name</i> for ' . 'the controller %controller_class_name', array('%controller_file_name' => $controller_file_name, '%controller_class_name' => $controller_class_name)), E_USER_ERROR);
         } elseif (@(include AkConfig::getDir('public') . DS . '404.php')) {
             $response = new AkTestResponse();
             $response->addHeader('Status', 404);
             return false;
             //exit;
         } else {
             //header("HTTP/1.1 404 Not Found");
             $response = new AkResponse();
             $response->addHeader('Status', 404);
             return false;
             //die('404 Not found');
         }
     }
     if (!class_exists($controller_class_name)) {
         AK_LOG_EVENTS && Ak::getLogger()->error('Controller ' . $controller_path . ' does not implement ' . $controller_class_name . ' class.');
         if (AK_ENVIRONMENT == 'development') {
             trigger_error(Ak::t('Controller <i>%controller_name</i> does not exist', array('%controller_name' => $controller_class_name)), E_USER_ERROR);
         } elseif (@(include AkConfig::getDir('public') . DS . '405.php')) {
             exit;
         } else {
             $response = new AkResponse();
             $response->addHeader('Status', 405);
             return false;
             //header("HTTP/1.1 405 Method Not Allowed");
             //die('405 Method Not Allowed');
         }
     }
     $Controller = new $controller_class_name(array('controller' => true));
     $Controller->setModulePath($module_path);
     isset($_SESSION) ? $Controller->session =& $_SESSION : null;
     return $Controller;
 }
开发者ID:bermi,项目名称:akelos,代码行数:54,代码来源:request.php


注:本文中的AkConfig::getDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。