本文整理汇总了PHP中OC_Filesystem::mkdir方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Filesystem::mkdir方法的具体用法?PHP OC_Filesystem::mkdir怎么用?PHP OC_Filesystem::mkdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Filesystem
的用法示例。
在下文中一共展示了OC_Filesystem::mkdir方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create_execution_env
/**
*
* @param type $study_name the name of the study directory
* @return the job id
*/
function create_execution_env($study_name, $script_name)
{
include 'config.inc.php';
$jobid = create_job_id($study_name, $script_name);
$job_dir = get_job_exec_dir($jobid);
while (is_dir($job_dir)) {
// the sandbox directory is already existing, sleep 1 second and generate another ID
sleep(1);
$jobid = create_job_id($study_name, $script_name);
$job_dir = get_job_exec_dir($jobid);
}
mkdir($job_dir, 0777, true);
// [job_root_dir]/[job_id]/data --> ../../data/[fs_root]/[study_name]/data
$datadir = $NC_CONFIG["symlink_prefix"] . "/" . $study_name . "/data";
$pipelinedir = get_absolute_path($study_name . "/pipeline");
$resultsdir = $NC_CONFIG["symlink_prefix"] . "/" . $study_name . "/results/" . $jobid;
OC_Filesystem::mkdir("{$study_name}/results/{$jobid}");
# le dir /data e /results sono link simbolici alle vere directory del caso di studio
mkdir($job_dir . "/pipeline");
symlink($datadir, $job_dir . "/data");
symlink($resultsdir, $job_dir . "/results");
# creo il file in cui verrà rediretto lo standard output
$date = date("Y-m-d H:i:s");
OC_Filesystem::file_put_contents(get_job_output_file($study_name, $jobid), "Standard output for job {$jobid}, run at {$date}\n");
$jobinfo = array("jobid" => $jobid, "study" => $study_name);
save_job_info($study_name, $jobid, $jobinfo);
# copia gli script del caso di studio nella pipeline
copy_dir($pipelinedir, $job_dir . "/pipeline");
return $jobid;
}
示例2: __construct
public function __construct($arguments)
{
$this->datadir = $arguments['datadir'];
if (OC_Share::getItemsInFolder($this->datadir)) {
if (!OC_Filesystem::is_dir($this->datadir)) {
OC_Filesystem::mkdir($this->datadir);
}
} else {
if (OC_Filesystem::is_dir($this->datadir)) {
OC_Filesystem::rmdir($this->datadir);
}
}
$this->datadir .= "/";
}
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:14,代码来源:owncloud_apps_files_sharing_sharedstorage.php
示例3: createDataScope
public static function createDataScope($appUrl, $userAddress, $dataScope)
{
$token = uniqid();
self::addToken($token, $appUrl, $userAddress, $dataScope);
//TODO: input checking on $userAddress and $dataScope
list($userName, $userHost) = explode('@', $userAddress);
OC_Util::setupFS(OC_User::getUser());
$scopePathParts = array('remoteStorage', 'webdav', $userHost, $userName, $dataScope);
for ($i = 0; $i <= count($scopePathParts); $i++) {
$thisPath = '/' . implode('/', array_slice($scopePathParts, 0, $i));
if (!OC_Filesystem::file_exists($thisPath)) {
OC_Filesystem::mkdir($thisPath);
}
}
return $token;
}
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:16,代码来源:owncloud_apps_remoteStorage_lib_remoteStorage.php
示例4: createCategories
public static function createCategories($appUrl, $categories)
{
$token = uniqid();
OC_Util::setupFS(OC_User::getUser());
self::addToken($token, $appUrl, $categories);
foreach (explode(',', $categories) as $category) {
//TODO: input checking on $category
$scopePathParts = array('remoteStorage', $category);
for ($i = 0; $i <= count($scopePathParts); $i++) {
$thisPath = '/' . implode('/', array_slice($scopePathParts, 0, $i));
if (!OC_Filesystem::file_exists($thisPath)) {
OC_Filesystem::mkdir($thisPath);
}
}
}
return base64_encode('remoteStorage:' . $token);
}
示例5: newFile
/**
* create a new file or folder
*
* @param dir $dir
* @param file $name
* @param type $type
*/
public static function newFile($dir, $name, $type)
{
if (OC_User::isLoggedIn()) {
$file = $dir . '/' . $name;
if ($type == 'dir') {
return OC_Filesystem::mkdir($file);
} elseif ($type == 'file') {
$fileHandle = OC_Filesystem::fopen($file, 'w');
if ($fileHandle) {
fclose($fileHandle);
return true;
} else {
return false;
}
}
}
}
示例6: createDirectory
/**
* Creates a new subdirectory
*
* @param string $name
* @return void
*/
public function createDirectory($name)
{
$newPath = $this->path . '/' . $name;
OC_Filesystem::mkdir($newPath);
}
示例7: testHooks
public function testHooks()
{
if (OC_Filesystem::getView()) {
$user = OC_User::getUser();
} else {
$user = uniqid();
OC_Filesystem::init('/' . $user . '/files');
}
OC_Hook::clear('OC_Filesystem');
OC_Hook::connect('OC_Filesystem', 'post_write', $this, 'dummyHook');
OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
$rootView = new OC_FilesystemView('');
$rootView->mkdir('/' . $user);
$rootView->mkdir('/' . $user . '/files');
OC_Filesystem::file_put_contents('/foo', 'foo');
OC_Filesystem::mkdir('/bar');
OC_Filesystem::file_put_contents('/bar//foo', 'foo');
$tmpFile = OC_Helper::tmpFile();
file_put_contents($tmpFile, 'foo');
$fh = fopen($tmpFile, 'r');
OC_Filesystem::file_put_contents('/bar//foo', $fh);
}
示例8: strtolower
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
require_once '../../../../lib/base.php';
OC_JSON::checkAppEnabled('ocdownloader');
OC_JSON::checkLoggedIn();
if (!OC_Filesystem::is_dir('/Downloads')) {
OC_Filesystem::mkdir('/Downloads');
}
$pr = $_POST['pr'];
switch ($pr) {
case 'web':
$k = OC_ocDownloaderFile::getHttpFile($_POST['url']);
break;
default:
if (preg_match('/^pr_([0-9]{1,4})$/', $pr, $m)) {
$pr_name = OC_ocDownloader::getProvider($m[1]);
$user_info = OC_ocDownloader::getUserProviderInfo($m[1]);
$pr_name = strtolower($pr_name['pr_name']);
if (file_exists(OC::$SERVERROOT . '/apps/ocdownloader/providers/' . $pr_name . '.php')) {
require_once OC::$SERVERROOT . '/apps/ocdownloader/providers/' . $pr_name . '.php';
}
}