當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。