How to use mkdir method of controller class

Best Atoum code snippet using controller.mkdir

Build.class.php

Source:Build.class.php Github

copy

Full Screen

...38 }39 // 创建应用和模块的目录结构40 static public function buildAppDir($module) {41 // 没有创建的话自动创建42 if(!is_dir(APP_PATH)) mkdir(APP_PATH,0755,true);43 if(is_writeable(APP_PATH)) {44 $dirs = array(45 COMMON_PATH,46 COMMON_PATH.'Common/',47 CONF_PATH,48 APP_PATH.$module.'/',49 APP_PATH.$module.'/Common/',50 APP_PATH.$module.'/Controller/',51 APP_PATH.$module.'/Model/',52 APP_PATH.$module.'/Conf/',53 APP_PATH.$module.'/View/',54 RUNTIME_PATH,55 CACHE_PATH,56 CACHE_PATH.$module.'/',57 LOG_PATH,58 LOG_PATH.$module.'/',59 TEMP_PATH,60 DATA_PATH,61 );62 foreach ($dirs as $dir){63 if(!is_dir($dir)) mkdir($dir,0755,true);64 }65 // 写入目录安全文件66 self::buildDirSecure($dirs);67 // 写入应用配置文件68 if(!is_file(CONF_PATH.'config'.CONF_EXT))69 file_put_contents(CONF_PATH.'config'.CONF_EXT,'.php' == CONF_EXT ? "<?php\nreturn array(\n\t//'配置项'=>'配置值'\n);":'');70 // 写入模块配置文件71 if(!is_file(APP_PATH.$module.'/Conf/config'.CONF_EXT))72 file_put_contents(APP_PATH.$module.'/Conf/config'.CONF_EXT,'.php' == CONF_EXT ? "<?php\nreturn array(\n\t//'配置项'=>'配置值'\n);":'');73 // 生成模块的测试控制器74 if(defined('BUILD_CONTROLLER_LIST')){75 // 自动生成的控制器列表(注意大小写)76 $list = explode(',',BUILD_CONTROLLER_LIST);77 foreach($list as $controller){78 self::buildController($module,$controller);79 }80 }else{81 // 生成默认的控制器82 self::buildController($module);83 }84 // 生成模块的模型85 if(defined('BUILD_MODEL_LIST')){86 // 自动生成的控制器列表(注意大小写)87 $list = explode(',',BUILD_MODEL_LIST);88 foreach($list as $model){89 self::buildModel($module,$model);90 }91 } 92 }else{93 header('Content-Type:text/html; charset=utf-8');94 exit('应用目录['.APP_PATH.']不可写,目录无法自动生成!<BR>请手动生成项目目录~');95 }96 }97 // 检查缓存目录(Runtime) 如果不存在则自动创建98 static public function buildRuntime() {99 if(!is_dir(RUNTIME_PATH)) {100 mkdir(RUNTIME_PATH);101 }elseif(!is_writeable(RUNTIME_PATH)) {102 header('Content-Type:text/html; charset=utf-8');103 exit('目录 [ '.RUNTIME_PATH.' ] 不可写!');104 }105 mkdir(CACHE_PATH); // 模板缓存目录106 if(!is_dir(LOG_PATH)) mkdir(LOG_PATH); // 日志目录107 if(!is_dir(TEMP_PATH)) mkdir(TEMP_PATH); // 数据缓存目录108 if(!is_dir(DATA_PATH)) mkdir(DATA_PATH); // 数据文件目录109 return true;110 }111 // 创建控制器类112 static public function buildController($module,$controller='Index') {113 $file = APP_PATH.$module.'/Controller/'.$controller.'Controller'.EXT;114 if(!is_file($file)){115 $content = str_replace(array('[MODULE]','[CONTROLLER]'),array($module,$controller),self::$controller);116 if(!C('APP_USE_NAMESPACE')){117 $content = preg_replace('/namespace\s(.*?);/','',$content,1);118 }119 $dir = dirname($file);120 if(!is_dir($dir)){121 mkdir($dir, 0755, true);122 }123 file_put_contents($file,$content);124 }125 }126 // 创建模型类127 static public function buildModel($module,$model) {128 $file = APP_PATH.$module.'/Model/'.$model.'Model'.EXT;129 if(!is_file($file)){130 $content = str_replace(array('[MODULE]','[MODEL]'),array($module,$model),self::$model);131 if(!C('APP_USE_NAMESPACE')){132 $content = preg_replace('/namespace\s(.*?);/','',$content,1);133 }134 $dir = dirname($file);135 if(!is_dir($dir)){136 mkdir($dir, 0755, true);137 }138 file_put_contents($file,$content);139 }140 }141 // 生成目录安全文件142 static public function buildDirSecure($dirs=array()) {143 // 目录安全写入(默认开启)144 defined('BUILD_DIR_SECURE') or define('BUILD_DIR_SECURE', true);145 if(BUILD_DIR_SECURE) {146 defined('DIR_SECURE_FILENAME') or define('DIR_SECURE_FILENAME', 'index.html');147 defined('DIR_SECURE_CONTENT') or define('DIR_SECURE_CONTENT', ' ');148 // 自动写入目录安全文件149 $content = DIR_SECURE_CONTENT;150 $files = explode(',', DIR_SECURE_FILENAME);...

Full Screen

Full Screen

controller.php

Source:controller.php Github

copy

Full Screen

...48 {49 $this50 ->if($controller = new testedClass(uniqid()))51 ->then52 ->boolean($controller->mkdir(uniqid(), 0777, STREAM_MKDIR_RECURSIVE))->isFalse()53 ->if($controller->notExists())54 ->then55 ->boolean($controller->mkdir(uniqid(), 0777, STREAM_MKDIR_RECURSIVE))->isTrue()56 ->integer($controller->getPermissions())->isEqualTo(0777)57 ;58 }59 public function testRmdir()60 {61 $this62 ->if($controller = new testedClass(uniqid()))63 ->and($controller->exists())64 ->then65 ->boolean($controller->rmdir(uniqid(), STREAM_MKDIR_RECURSIVE))->isTrue()66 ->variable($controller->getPermissions())->isNull()67 ->if($controller->exists())68 ->and($controller->isNotWritable())69 ->then...

Full Screen

Full Screen

mkdir

Using AI Code Generation

copy

Full Screen

1$this->controller->mkdir($path);2$this->controller->mkdir($path);3$this->controller->mkdir($path);4$this->controller->mkdir($path);5$this->controller->mkdir($path);6$this->controller->mkdir($path);7$this->controller->mkdir($path);8$this->controller->mkdir($path);9$this->controller->mkdir($path);10$this->controller->mkdir($path);11$this->controller->mkdir($path);12$this->controller->mkdir($path);13$this->controller->mkdir($path);14$this->controller->mkdir($path);15$this->controller->mkdir($path);16$this->controller->mkdir($path);17$this->controller->mkdir($path);18$this->controller->mkdir($path);19$this->controller->mkdir($path);20$this->controller->mkdir($path);

Full Screen

Full Screen

mkdir

Using AI Code Generation

copy

Full Screen

1$this->controller->mkdir("test");2$this->controller->rmdir("test");3$this->controller->file_put_contents("test.txt","test");4$this->controller->file_get_contents("test.txt");5$this->controller->file_exists("test.txt");6$this->controller->is_file("test.txt");7$this->controller->is_dir("test");8$this->controller->unlink("test.txt");9$this->controller->rename("test.txt","test1.txt");10$this->controller->copy("test1.txt","test2.txt");11$this->controller->scandir("test");12$this->controller->filemtime("test1.txt");13$this->controller->fileatime("test1.txt");14$this->controller->filectime("test1.txt");15$this->controller->filesize("test1.txt");16$this->controller->fileperms("test1.txt");17$this->controller->fileowner("test1.txt");18$this->controller->filegroup("test1.txt");19$this->controller->fileinode("test1.txt");20$this->controller->filetype("test1.txt");21$this->controller->is_readable("test1.txt");22$this->controller->is_writeable("test1.txt");23$this->controller->is_executable("test1.txt");

Full Screen

Full Screen

mkdir

Using AI Code Generation

copy

Full Screen

1$this->load->library('controller');2$this->controller->mkdir('folder_name');3$this->load->library('controller');4$this->controller->mkdir('folder_name');5$this->load->library('controller');6$this->controller->mkdir('folder_name');7$this->load->library('controller');8$this->controller->mkdir('folder_name');9$this->load->library('controller');10$this->controller->mkdir('folder_name');11$this->load->library('controller');12$this->controller->mkdir('folder_name');13$this->load->library('controller');14$this->controller->mkdir('folder_name');15$this->load->library('controller');16$this->controller->mkdir('folder_name');17$this->load->library('controller');18$this->controller->mkdir('folder_name');19$this->load->library('controller');20$this->controller->mkdir('folder_name');21$this->load->library('controller');22$this->controller->mkdir('folder_name');23$this->load->library('controller');24$this->controller->mkdir('folder_name');25$this->load->library('controller');26$this->controller->mkdir('folder_name');27$this->load->library('controller');28$this->controller->mkdir('folder_name');29$this->load->library('controller');30$this->controller->mkdir('folder_name');

Full Screen

Full Screen

mkdir

Using AI Code Generation

copy

Full Screen

1$this->controller->mkdir("testfolder");2$this->controller->rmdir("testfolder");3$this->controller->file_put_contents("testfile.txt","hello world");4$this->controller->file_get_contents("testfile.txt");5$this->controller->file_exists("testfile.txt");6$this->controller->unlink("testfile.txt");7$this->controller->rename("testfile.txt","testfile2.txt");8$this->controller->copy("testfile2.txt","testfile3.txt");9$this->controller->scandir("testfolder");10$this->controller->is_dir("testfolder");11$this->controller->is_file("testfile.txt");12$this->controller->filesize("testfile.txt");13$this->controller->filemtime("testfile.txt");14$this->controller->fileatime("testfile.txt");15$this->controller->filectime("testfile.txt");16$this->controller->fileperms("testfile.txt");17$this->controller->fileowner("testfile.txt");18$this->controller->filegroup("testfile.txt");19$this->controller->fileinode("testfile.txt");20$this->controller->filetype("testfile.txt");21$this->controller->is_readable("testfile.txt");22$this->controller->is_writable("testfile.txt");

Full Screen

Full Screen

mkdir

Using AI Code Generation

copy

Full Screen

1$dir = new controller();2$dir->mkdir('test');3$dir = new model();4$dir->mkdir('test');5$dir = new view();6$dir->mkdir('test');7$dir = new library();8$dir->mkdir('test');9$dir = new helper();10$dir->mkdir('test');11$dir = new config();12$dir->mkdir('test');13$dir = new database();14$dir->mkdir('test');15$dir = new route();16$dir->mkdir('test');17$dir = new log();18$dir->mkdir('test');19$dir = new session();20$dir->mkdir('test');21$dir = new cookie();22$dir->mkdir('test');23$dir = new request();24$dir->mkdir('test');25$dir = new response();26$dir->mkdir('test');27$dir = new cache();28$dir->mkdir('test');29$dir = new security();30$dir->mkdir('test');31$dir = new image();32$dir->mkdir('test');33$dir = new mail();34$dir->mkdir('test');

Full Screen

Full Screen

mkdir

Using AI Code Generation

copy

Full Screen

1$this->load->helper('file');2$this->load->helper('directory');3$dir = 'C:/wamp/www/CodeIgniter-2.1.3/uploads';4if (!is_dir($dir)) {5 mkdir($dir, 0777, true);6}7$dir = 'C:/wamp/www/CodeIgniter-2.1.3/uploads/' . $this->session->userdata('username');8if (!is_dir($dir)) {9 mkdir($dir, 0777, true);10}11$config['upload_path'] = $dir;12$config['allowed_types'] = 'gif|jpg|png';13$config['max_size'] = '100';14$config['max_width'] = '1024';15$config['max_height'] = '768';16$this->load->library('upload', $config);17if (!$this->upload->do_upload()) {18 $error = array('error' => $this->upload->display_errors());19 $this->load->view('upload_form', $error);20} else {21 $data = array('upload_data' => $this->upload->data());22 $this->load->view('upload_success', $data);23}24$this->load->helper('directory');25$dir = 'C:/wamp/www/CodeIgniter-2.1.3/uploads/' . $this->session->userdata('username');26$data = directory_map($dir);27print_r($data);28$this->load->helper('directory');29$this->load->helper('file');30$dir = 'C:/wamp/www/CodeIgniter-2.1.3/uploads/' . $this->session->userdata('username');31delete_files($dir, TRUE);32rmdir($dir);33$this->load->helper('directory');34$this->load->helper('file');35$dir = 'C:/wamp/www/CodeIgniter-2.1.3/uploads';36delete_files($dir, TRUE);37rmdir($dir);

Full Screen

Full Screen

mkdir

Using AI Code Generation

copy

Full Screen

1$dir = $this->mkdir('test');2if($this->file_exists('test'))3{4echo 'Directory exists';5}6{7echo 'Directory does not exist';8}9$this->rmdir('test');10if($this->file_exists('test'))11{12echo 'Directory exists';13}14{15echo 'Directory does not exist';16}

Full Screen

Full Screen

mkdir

Using AI Code Generation

copy

Full Screen

1$controller->mkdir("test");2$controller->mkfile("test.txt");3$controller->mkfile("test.txt");4$controller->mkfile("test.txt");5$controller->mkfile("test.txt");6$controller->mkfile("test.txt");7$controller->mkfile("test.txt");8$controller->mkfile("test.txt");9$controller->mkfile("test.txt");10$controller->mkfile("test.txt");11$controller->mkfile("test.txt");

Full Screen

Full Screen

mkdir

Using AI Code Generation

copy

Full Screen

1$foldername = date("Y-m-d");2$controller->mkdir($foldername);3$foldername = date("Y-m-d");4$controller->mkdir($foldername, 0755, true);5$foldername = date("Y-m-d");6$controller->mkdir($foldername, 0755, true, true);7$foldername = date("Y-m-d");8$controller->mkdir($foldername, 0777, true, true);9$foldername = date("Y-m-d");10$controller->mkdir($foldername, 0777, true, true, "myfolder");11$foldername = date("Y-m-d");12$controller->mkdir($foldername, 0777, true, true, "myfolder", "/var/www/html");

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Atoum automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in controller

Trigger mkdir code on LambdaTest Cloud Grid

Execute automation tests with mkdir on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful