// clone remote repo $repo = new GitRepo($repo_path, true, false); $repo->clone_remote($source); } if (!empty($_POST['file_title'])) { $f_title = trim($_POST['file_title']); $f_desc = trim($_POST['file_description']); $f_tags = trim($_POST['file_tags']); $f_code = trim($_POST['file_code']); // TITLE // if title not end in .js make it end in .js if (!preg_match('/.js$/', $f_title)) { $f_title = $f_title . ".js"; } // pull from origin $repo->run('pull'); // If file already exits warn and stop $fileName = $repo_path . "/" . $f_title; if (file_exists($fileName)) { $status_message = 'Pick another name, a file with the name \'' . $f_title . '\' already exists.'; } else { if (!($file = fopen($fileName, 'w'))) { $status_message = "Error creating file: " . $fileName; } // DESCRIPTION // comment description $f_desc = "// Description \n// " . $f_desc; // TAGS // add # to tags if they don't already have them $tag_array = explode(" ", $f_tags); $f_tags = "// Tags \n// ";
if (!empty($_POST['file_title'])) { $f_main_cat = trim($_POST['main_cat']); $f_sub_cat = trim($_POST['sub_cat']); $f_folder = trim($_POST['file_folder']); $folders = $_POST['folders']; $f_title = trim($_POST['file_title']); $f_desc = trim($_POST['file_description']); $f_tags = trim($_POST['file_tags']); $f_code = trim($_POST['file_code']); // TITLE // if title not end in .js make it end in .js // if( !preg_match('/.js$/',$f_title) ){ // $f_title = $f_title.".js"; // } // pull from origin $repo->run('pull'); // create path to file $file_path = $repo_path; if (count($folders) != 0) { for ($i = 0; $i < count($folders); $i++) { $file_path = $file_path . "/" . $folders[$i]; } } // THIS IS NOT WORKING // by this i mean the creating a folder $file_path = $file_path . "/" . $f_folder; echo $file_path; // echo("[$f_folder]"); // If folder or file already exits warn and stop $fileName = $file_path . "/" . $f_title; if (is_dir($file_path) && !empty($f_folder)) {