本文整理汇总了PHP中FileUtils::mkdir_p方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUtils::mkdir_p方法的具体用法?PHP FileUtils::mkdir_p怎么用?PHP FileUtils::mkdir_p使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtils
的用法示例。
在下文中一共展示了FileUtils::mkdir_p方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: generate_migration
/**
* Generate a migration.
* @param string $name The name of the migration.
* @param string $table The table to create a migration for.
*/
public static function generate_migration($name, $table = '')
{
$path = FileUtils::join(static::$nimble_root, 'db', 'migrations');
FileUtils::mkdir_p($path);
$file_name = time() . '_' . $name . '_migration.php';
$class_name = Inflector::classify($name . 'Migration');
$out = file_get_contents(FileUtils::join(static::$template_path, 'migration.tmpl'));
$up = '';
$down = '';
if (!empty($table)) {
$up .= '$t = $this->create_table("' . $table . '");';
$up .= "\n" . ' //enter column definitions here';
$up .= "\n" . ' $t->go();';
$down .= ' $this->drop_table("' . $table . '");';
}
$out = str_replace(array('{class_name}', '{up_code}', '{down_code}'), array($class_name, $up, $down), $out);
static::write_file(FileUtils::join($path, $file_name), $out);
}
示例3: move_uploaded_file
public function move_uploaded_file($file, $version)
{
$path = $this->file_path($version);
FileUtils::mkdir_p(dirname($path));
if (is_uploaded_file($file)) {
move_uploaded_file($file, $this->file_path($version));
chmod($this->file_path($version), 0664);
} else {
copy($file, $path);
}
}
示例4: 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'));
}
示例5: __construct
public function __construct()
{
if (static::$enabled) {
FileUtils::mkdir_p(FileUtils::join(FileUtils::join(NIMBLE_ROOT, 'log')));
$this->log_file = FileUtils::join(NIMBLE_ROOT, 'log', NIMBLE_ENV . '.log');
}
}