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


PHP FileUtils::join方法代码示例

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


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

示例1: after_create

 public function after_create()
 {
     UserMailer::deliver_new_user($this->email, $this);
     $path = FileUtils::join(NIMBLE_ROOT, 'get', $this->username);
     FileUtils::mkdir_p($path);
     chmod($path, 0755);
 }
开发者ID:xetorthio,项目名称:pearfarm_channel_server,代码行数:7,代码来源:user.php

示例2: setUp

 public function setUp()
 {
     $dir = dirname(__FILE__);
     $this->nimble = Nimble::getINstance();
     Nimble::set_config('stylesheet_folder', FileUtils::join($dir, 'assets', 'stylesheets'));
     Nimble::set_config('stylesheet_folder_url', '/stylesheet');
     Nimble::set_config('javascript_folder', FileUtils::join($dir, 'assets', 'javascript'));
     Nimble::set_config('javascript_folder_url', '/javascript');
 }
开发者ID:scottdavis,项目名称:nimblize,代码行数:9,代码来源:TagHelperTest.php

示例3: about

 public function about()
 {
     $this->set_default_side_bar();
     require_once FileUtils::join(NIMBLE_ROOT, 'lib', 'markdown.php');
     $template = FileUtils::join(NIMBLE_ROOT, 'app', 'view', 'help', 'about.markdown');
     $this->about = file_get_contents($template);
     $this->title = 'About Pearfarm';
     Nimble::set_title($this->title);
 }
开发者ID:xetorthio,项目名称:pearfarm_channel_server,代码行数:9,代码来源:help_controller.php

示例4: create_package

 public static function create_package()
 {
     $user = User::find_by_username('bob');
     $file = FileUtils::join(NIMBLE_ROOT, 'test', 'data', 'bobs_other_package-0.0.1.tgz');
     $package = Package::from_upload(array('file' => $file, 'user' => $user));
     foreach (User::_find('all') as $user) {
         $raiting = '0.' . $user->id;
         PackageRating::_create(array('user_id' => $user->id, 'package_id' => $package->id, 'rating' => (double) $raiting));
     }
 }
开发者ID:scottdavis,项目名称:pearfarm_channel_server,代码行数:10,代码来源:story_helper.php

示例5: testUploadHtmlFailsnoFile

 public function testUploadHtmlFailsnoFile()
 {
     $localfile = FileUtils::join(NIMBLE_ROOT, 'test', 'data', 'bobs_other_package-1.0.4.tgz');
     $_FILES = array();
     $_FILES['file'] = array();
     $_FILES['file']['tmp_name'] = '';
     $key = md5(time());
     $this->post('upload', array(), array('upload_key' => $key), array('upload_key' => md5(md5(time())), 'user' => User::find_by_username('bob')->id), 'html');
     $this->assertEquals($_SESSION['flashes']['notice'], 'Package channel  does not match bob.localhost.com');
     $this->assertRedirect(url_for('LandingController', 'user_index', User::find_by_username('bob')->username));
 }
开发者ID:scottdavis,项目名称:pearfarm_channel_server,代码行数:11,代码来源:ChannelControllerTest.php

示例6: testUploadFailbadSig

 public function testUploadFailbadSig()
 {
     $localfile = FileUtils::join(NIMBLE_ROOT, 'test', 'data', 'joes_other_package-1.0.4.tgz');
     $sig = PackageVerifyTest::calculatePackageSignature($localfile);
     $user = User::find_by_username('joe');
     try {
         $p = Package::from_upload(array('file' => $localfile, 'sig' => $sig, 'user' => $user), true);
     } catch (NimbleException $e) {
         $this->assertEquals("Invalid package signature", $e->getMessage());
     }
 }
开发者ID:scottdavis,项目名称:pearfarm_channel_server,代码行数:11,代码来源:FileUploadTest.php

示例7: load_action

 /**
  * @param string $action action you wish to call
  * @param array $action_params array of arguments to pass to the action method
  */
 private function load_action($action, $action_params)
 {
     global $_SESSION, $_POST, $_GET;
     $nimble = Nimble::getInstance();
     ob_start();
     $controller = new $this->controller_name();
     $controller->format = !empty($action_params['format']) ? $action_params['format'] : $controller->default_format;
     call_user_func(array($controller, "run_before_filters"), $action);
     call_user_func_array(array($controller, $action), array($action_params));
     $path = strtolower(Inflector::underscore(str_replace('Controller', '', $this->controller_name)));
     $template = FileUtils::join($path, $action);
     if ($controller->has_rendered === false) {
         if (empty($controller->layout_template) && $controller->layout) {
             $controller->set_layout_template();
         }
         $controller->render($template);
     }
     call_user_func(array($controller, "run_after_filters"), $action);
     $this->response = ob_get_clean();
     $this->controller = $controller;
 }
开发者ID:sbeam,项目名称:nimble,代码行数:25,代码来源:phpunit_testcase.php

示例8: file_path

 public function file_path($version)
 {
     return FileUtils::join(NIMBLE_ROOT, 'get', $this->user->username, "{$this->name}-{$version}.tgz");
 }
开发者ID:scottdavis,项目名称:pearfarm_channel_server,代码行数:4,代码来源:package.php

示例9: testFileJoinReturnsString

 public function testFileJoinReturnsString()
 {
     $string = 'test' . DIRECTORY_SEPARATOR . 'myfolder';
     $this->assertEquals($string, FileUtils::join('test', 'myfolder'));
 }
开发者ID:scottdavis,项目名称:nimble,代码行数:5,代码来源:FileUtilsTest.php

示例10: load_interfaces

 public static function load_interfaces($dir = '')
 {
     $dirs = array(__DIR__ . '/interfaces');
     if (!empty($dir)) {
         $dirs[] = $dir;
     }
     foreach ($dirs as $dir) {
         if ($dh = opendir($dir)) {
             while (($file = readdir($dh)) !== false) {
                 if (strpos($file, '.php') !== false) {
                     require_once FileUtils::join($dir, $file);
                     $class = Inflector::classify(substr(basename($file), 0, -4));
                     $methods = call_user_func(array($class, 'methods'));
                     $out = array();
                     foreach ($methods as $method) {
                         $out[$method] = $class;
                     }
                     static::$interface_map = array_merge(static::$interface_map, $out);
                 }
             }
             closedir($dh);
         }
     }
 }
开发者ID:scottdavis,项目名称:nimblize,代码行数:24,代码来源:nimble_record.php

示例11: render_partial

 /**
  * Include a PHP file, inject the controller's properties into that file, and return the output.
  * @param string $file The view file to render, relative to the base of the application.
  * @return string The rendered view file.
  */
 public function render_partial($file)
 {
     $this->rendered_partials[] = $file;
     return $this->open_template(FileUtils::join(Nimble::getInstance()->config['view_path'], $file));
 }
开发者ID:sbeam,项目名称:nimble,代码行数:10,代码来源:controller.php

示例12: nimble_load_helper

function nimble_load_helper($name)
{
    require_once FileUtils::join(dirname(__FILE__), $name . '.php');
}
开发者ID:sbeam,项目名称:nimble,代码行数:4,代码来源:base.php

示例13: foreach

<?php

/**
 * @package NimbleSupport
 * Loads in all support classes
 */
$dir = __DIR__;
require_once $dir . '/file_utils.php';
foreach (array('tag_helper', 'mime', 'string_cacher', 'asset_tag', 'cycler', 'form_helper') as $file) {
    require_once FileUtils::join($dir, $file . '.php');
}
开发者ID:scottdavis,项目名称:nimblize,代码行数:11,代码来源:base.php

示例14: mailer_template

 private static function mailer_template($class, $method)
 {
     FileUtils::mkdir_p(FileUtils::join(NIMBLE_ROOT, 'app', 'view', strtolower(Inflector::underscore($class))));
     touch(FileUtils::join(NIMBLE_ROOT, 'app', 'view', strtolower(Inflector::underscore($class)), strtolower($method) . '.php'));
     touch(FileUtils::join(NIMBLE_ROOT, 'app', 'view', strtolower(Inflector::underscore($class)), strtolower($method) . '.txt'));
 }
开发者ID:sbeam,项目名称:nimble,代码行数:6,代码来源:generator.php

示例15: render_partial

 /**
  * Include a PHP file, inject the controller's properties into that file, and return the output.
  * @param string $file The view file to render, relative to the base of the application.
  * @return string The rendered view file.
  */
 public function render_partial($file)
 {
     NimbleLogger::log("RENDERING PARTIAL: {$file}");
     $this->rendered_partials[] = $file;
     return $this->open_template(FileUtils::join(Nimble::getInstance()->config['view_path'], $file));
 }
开发者ID:scottdavis,项目名称:nimblize,代码行数:11,代码来源:controller.php


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