Changeset 594166
- Timestamp:
- 09/03/2012 08:24:14 PM (14 years ago)
- Location:
- edge-suite/trunk
- Files:
-
- 5 edited
-
admin/manage.php (modified) (1 diff)
-
edge-suite.php (modified) (1 diff)
-
includes/edge-suite-comp-builder.inc (modified) (6 diffs)
-
includes/edge-suite-comp.inc (modified) (1 diff)
-
includes/edge-suite-general.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
edge-suite/trunk/admin/manage.php
r587841 r594166 57 57 } 58 58 59 // Init file system 60 WP_Filesystem(); 59 61 60 //Here we check that $ok was not set to 0 by an error61 62 $tmp_file = EDGE_SUITE_PUBLIC_DIR . '/tmp/' . $_FILES['edge_suite_composition_upload']['name']; 62 63 if (!is_dir(EDGE_SUITE_PUBLIC_DIR . '/tmp')) { 63 mkdir(EDGE_SUITE_PUBLIC_DIR . '/tmp'); 64 if(!mkdir_recursive(EDGE_SUITE_PUBLIC_DIR . '/tmp')){ 65 throw new Exception("Edge suite tmp could not be created.<br />"); 66 } 67 } 68 if(!dir_is_writable(EDGE_SUITE_PUBLIC_DIR . '/tmp')){ 69 throw new Exception("Edge suite tmp is not writable.<br />"); 64 70 } 65 71 66 72 if (move_uploaded_file($_FILES['edge_suite_composition_upload']['tmp_name'], $tmp_file)) { 67 WP_Filesystem(); 73 68 74 edge_suite_comp_create($tmp_file, TRUE); 69 75 echo '<div style="background-color: rgb(255, 251, 204);" id="message" class="updated fade">'; -
edge-suite/trunk/edge-suite.php
r587841 r594166 114 114 115 115 //Check if dir is writable and create directory structure. 116 if (! wp_mkdir_p(EDGE_SUITE_COMP_PROJECT_DIR)) {116 if (!mkdir_recursive(EDGE_SUITE_COMP_PROJECT_DIR)) { 117 117 $message = sprintf(__('Unable to create directory %s. Is its parent directory writable by the server?'), EDGE_SUITE_COMP_PROJECT_DIR_REL); 118 118 return array('error' => $message); -
edge-suite/trunk/includes/edge-suite-comp-builder.inc
r587841 r594166 103 103 */ 104 104 public function __construct($base_dir, $project_dir) { 105 // global $user;106 105 $this->edgeDir = $base_dir; 107 106 $this->edgeProjectDir = $project_dir; … … 111 110 112 111 if (!is_dir($base_dir . '/edge_tmp')) { 113 mkdir($base_dir . '/edge_tmp'); 112 if(!mkdir_recursive($base_dir . '/edge_tmp')){ 113 throw new Exception ("Can't create edge_tmp directory."); 114 }; 114 115 } 115 116 116 117 if (!is_dir($this->tmpDirBase)) { 117 mkdir($this->tmpDirBase); 118 if(!mkdir_recursive($this->tmpDirBase)){ 119 throw new Exception ("Can't create project tmp directory."); 120 } 118 121 } 119 122 120 123 if (!is_dir($this->edgeProjectDir)) { 121 mkdir($this->edgeProjectDir); 122 } 123 124 if(!mkdir_recursive($this->edgeProjectDir)){ 125 throw new Exception ("Can't project directory."); 126 } 127 } 128 129 if(!dir_is_writable($base_dir . '/edge_tmp')){ 130 throw new Exception("edge_tmp is not writable.<br />"); 131 } 132 133 if(!dir_is_writable($this->tmpDirBase)){ 134 throw new Exception("Project tmp directory is not writable.<br />"); 135 } 136 137 if(!dir_is_writable($this->edgeProjectDir)){ 138 throw new Exception("Specific project directory is not writable.<br />"); 139 } 124 140 125 141 $this->dimensions = array( … … 208 224 } 209 225 } 210 mkdir($this->destinationDir); 226 if(!mkdir_recursive($this->destinationDir)){ 227 throw new Exception ('The project directory could not be created.'); 228 } 211 229 212 230 // Extract the archive. … … 496 514 // Set up shared folder if it doesn't exist. 497 515 if (!is_dir($this->edgeDir . '/edge_includes')) { 498 mkdir ($this->edgeDir . '/edge_includes');516 mkdir_recursive($this->edgeDir . '/edge_includes'); 499 517 } 500 518 … … 570 588 // Check if list is valid. 571 589 if (!preg_match('/^([a-zA-Z0-9]{2,6}\|)*([a-zA-Z0-9]{2,6})$/', $allowed_extensions)) { 572 $allowed_extensions = 'js|png|jpg|gif|svg ';590 $allowed_extensions = 'js|png|jpg|gif|svg|css'; 573 591 } 574 592 … … 582 600 $rel_dir = substr($dir, strlen($src) + 1); 583 601 if (!file_exists($dest . '/' . $rel_dir)) { 584 mkdir ($dest . '/' . $rel_dir);602 mkdir_recursive($dest . '/' . $rel_dir); 585 603 } 586 604 // TODO: Feedback if file couldn't be moved. -
edge-suite/trunk/includes/edge-suite-comp.inc
r587841 r594166 39 39 if (!is_dir(EDGE_SUITE_COMP_PROJECT_DIR)) { 40 40 if (!is_dir(EDGE_SUITE_PUBLIC_DIR)) { 41 mkdir (EDGE_SUITE_PUBLIC_DIR);42 } 43 mkdir (EDGE_SUITE_COMP_PROJECT_DIR);41 mkdir_recursive(EDGE_SUITE_PUBLIC_DIR); 42 } 43 mkdir_recursive(EDGE_SUITE_COMP_PROJECT_DIR); 44 44 } 45 45 -
edge-suite/trunk/includes/edge-suite-general.php
r587841 r594166 18 18 } 19 19 20 function mkdir_recursive($path){ 21 if (wp_mkdir_p($path)) { 22 return true; 23 } 24 else{ 25 return $path . " could not be created."; 26 } 27 } 28 29 function dir_is_writable($path){ 30 global $wp_filesystem; 31 return $wp_filesystem->is_writable($path); 32 } 20 33 21 34 function check_plain($text) {
Note: See TracChangeset
for help on using the changeset viewer.