文件操作 - Id_Generator.php
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/the-events-calendar/src/Tribe/Utils/Id_Generator.php
编辑文件内容
<?php class Tribe__Events__Utils__Id_Generator { protected static $count = []; public static function generate_id( $string, $group = 'default' ) { if ( ! ( is_string( $string ) || ( is_int( $string ) ) ) ) { throw new InvalidArgumentException( 'First argument must be a string or an int' ); } if ( ! ( is_string( $group ) || is_int( $group ) ) ) { throw new InvalidArgumentException( 'Group argument must be a string' ); } if ( ! isset( self::$count[ $group ] ) ) { self::$count[ $group ] = 0; } $out = $string . '-' . self::$count[ $group ]; self::$count[ $group ] ++; return $out; } public static function reset( $group = null ) { if ( empty( $group ) ) { self::$count = []; } else { self::$count[ $group ] = 0; } } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件