├── .gitignore ├── README.md ├── admin ├── assets │ ├── css │ │ └── fillitup.css │ ├── images │ │ ├── fillitup.svg │ │ ├── kdk_fill_it_up_preview_20200122.png │ │ └── sam_rockwell_yeah.gif │ └── js │ │ └── fillitup.js ├── controller.php ├── index.php ├── layouts │ ├── dashboard.php │ └── posts.php ├── lib │ ├── Faker │ │ ├── Calculator │ │ │ └── Luhn.php │ │ ├── DefaultGenerator.php │ │ ├── Documentor.php │ │ ├── Factory.php │ │ ├── Generator.php │ │ ├── Guesser │ │ │ └── Name.php │ │ ├── ORM │ │ │ ├── CakePHP │ │ │ │ ├── ColumnTypeGuesser.php │ │ │ │ ├── EntityPopulator.php │ │ │ │ └── Populator.php │ │ │ ├── Doctrine │ │ │ │ ├── ColumnTypeGuesser.php │ │ │ │ ├── EntityPopulator.php │ │ │ │ └── Populator.php │ │ │ ├── Mandango │ │ │ │ ├── ColumnTypeGuesser.php │ │ │ │ ├── EntityPopulator.php │ │ │ │ └── Populator.php │ │ │ └── Propel │ │ │ │ ├── ColumnTypeGuesser.php │ │ │ │ ├── EntityPopulator.php │ │ │ │ └── Populator.php │ │ ├── Provider │ │ │ ├── Address.php │ │ │ ├── Barcode.php │ │ │ ├── Base.php │ │ │ ├── Biased.php │ │ │ ├── Color.php │ │ │ ├── Company.php │ │ │ ├── DateTime.php │ │ │ ├── File.php │ │ │ ├── Image.php │ │ │ ├── Internet.php │ │ │ ├── Lorem.php │ │ │ ├── Miscellaneous.php │ │ │ ├── Payment.php │ │ │ ├── Person.php │ │ │ ├── PhoneNumber.php │ │ │ ├── Text.php │ │ │ ├── UserAgent.php │ │ │ ├── Uuid.php │ │ │ ├── ar_JO │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── Text.php │ │ │ ├── at_AT │ │ │ │ └── Payment.php │ │ │ ├── be_BE │ │ │ │ └── Payment.php │ │ │ ├── bg_BG │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── bn_BD │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Utils.php │ │ │ ├── cs_CZ │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── DateTime.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Text.php │ │ │ ├── da_DK │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── de_AT │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── de_DE │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Text.php │ │ │ ├── el_GR │ │ │ │ ├── Address.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── en_AU │ │ │ │ ├── Address.php │ │ │ │ ├── Internet.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── en_CA │ │ │ │ ├── Address.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── en_GB │ │ │ │ ├── Address.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── en_NZ │ │ │ │ ├── Address.php │ │ │ │ ├── Internet.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── en_PH │ │ │ │ └── Address.php │ │ │ ├── en_UG │ │ │ │ ├── Address.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── en_US │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Text.php │ │ │ ├── en_ZA │ │ │ │ ├── Address.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── es_AR │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── es_ES │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── es_PE │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── es_VE │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── fa_IR │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── Text.php │ │ │ ├── fi_FI │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── fr_BE │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── fr_CA │ │ │ │ ├── Address.php │ │ │ │ └── Person.php │ │ │ ├── fr_FR │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Text.php │ │ │ ├── hu_HU │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Text.php │ │ │ ├── hy_AM │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── id_ID │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── is_IS │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── it_IT │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Text.php │ │ │ ├── ja_JP │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── ka_GE │ │ │ │ ├── Person.php │ │ │ │ └── Text.php │ │ │ ├── kk_KZ │ │ │ │ ├── Address.php │ │ │ │ ├── Color.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Text.php │ │ │ ├── ko_KR │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── lv_LV │ │ │ │ ├── Address.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── me_ME │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── ne_NP │ │ │ │ ├── Address.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── nl_BE │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── nl_NL │ │ │ │ ├── Address.php │ │ │ │ ├── Color.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── no_NO │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── pl_PL │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Text.php │ │ │ ├── pt_BR │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── check_digit.php │ │ │ ├── pt_PT │ │ │ │ ├── Address.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── ro_MD │ │ │ │ ├── Address.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── ro_RO │ │ │ │ ├── Address.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── ru_RU │ │ │ │ ├── Address.php │ │ │ │ ├── Color.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Text.php │ │ │ ├── sk_SK │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── sl_SI │ │ │ │ ├── Address.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── sr_Cyrl_RS │ │ │ │ ├── Address.php │ │ │ │ ├── Payment.php │ │ │ │ └── Person.php │ │ │ ├── sr_Latn_RS │ │ │ │ ├── Address.php │ │ │ │ ├── Payment.php │ │ │ │ └── Person.php │ │ │ ├── sr_RS │ │ │ │ ├── Address.php │ │ │ │ ├── Payment.php │ │ │ │ └── Person.php │ │ │ ├── sv_SE │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── tr_TR │ │ │ │ ├── Address.php │ │ │ │ ├── Color.php │ │ │ │ ├── DateTime.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── uk_UA │ │ │ │ ├── Address.php │ │ │ │ ├── Color.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Text.php │ │ │ ├── vi_VN │ │ │ │ ├── Address.php │ │ │ │ ├── Color.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ ├── zh_CN │ │ │ │ ├── Address.php │ │ │ │ ├── Company.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Person.php │ │ │ │ └── PhoneNumber.php │ │ │ └── zh_TW │ │ │ │ ├── Address.php │ │ │ │ ├── Color.php │ │ │ │ ├── Company.php │ │ │ │ ├── DateTime.php │ │ │ │ ├── Internet.php │ │ │ │ ├── Payment.php │ │ │ │ ├── Person.php │ │ │ │ ├── PhoneNumber.php │ │ │ │ └── Text.php │ │ └── UniqueGenerator.php │ └── autoload.php └── views │ ├── dashboard.php │ └── posts.php ├── kdk_fill_it_up.php └── languages └── index.html /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .ftpconfig 3 | -------------------------------------------------------------------------------- /admin/assets/css/fillitup.css: -------------------------------------------------------------------------------- 1 | /** 2 | * @version 1.x 3 | * @package Fill It Up (Plugin) 4 | * @author Kodeka - https://kodeka.io 5 | * @copyright Copyright (c) 2018 - 2020 Kodeka OÜ. All rights reserved. 6 | * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html 7 | */ 8 | 9 | /* General */ 10 | .clr {display:block;clear:both;float:none;height:0;line-height:0;padding:0;margin:0;} 11 | 12 | /* Logo */ 13 | .wrap > h2::before, 14 | .plugin-title::before {content:'';background:url('../images/fillitup.svg');background-size:cover;width:30px;height:25px;margin-right:5px;display:inline-block;vertical-align:middle;} 15 | 16 | /* Generator */ 17 | #fillitup-percentage {margin-top:20px;font-size:30px;font-weight:bold;text-align:center;} 18 | #fillitup-status {width:100%;height:20px;border:1px solid #ccc;background:#f4f4f4;margin:8px 0;} 19 | #fillitup-status-bar {width:0%;height:20px;background:#4AA54F;} 20 | #fillitup-completed-message {text-align:center;} 21 | img#fillitup-success-img {display:block;clear:both;width:80%;height:auto;margin:20px auto;} 22 | 23 | /* Footer */ 24 | #fillItUpAdminFooter {text-align:center;margin-top:20px;padding:20px;} 25 | -------------------------------------------------------------------------------- /admin/assets/images/fillitup.svg: -------------------------------------------------------------------------------- 1 | 2 | image/svg+xml -------------------------------------------------------------------------------- /admin/assets/images/kdk_fill_it_up_preview_20200122.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kodeka/kdk_fill_it_up/d56163fabcc75a7a46958ed7c0d41081229a0900/admin/assets/images/kdk_fill_it_up_preview_20200122.png -------------------------------------------------------------------------------- /admin/assets/images/sam_rockwell_yeah.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kodeka/kdk_fill_it_up/d56163fabcc75a7a46958ed7c0d41081229a0900/admin/assets/images/sam_rockwell_yeah.gif -------------------------------------------------------------------------------- /admin/assets/js/fillitup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @version 1.x 3 | * @package Fill It Up (Plugin) 4 | * @author Kodeka - https://kodeka.io 5 | * @copyright Copyright (c) 2018 - 2020 Kodeka OÜ. All rights reserved. 6 | * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html 7 | */ 8 | 9 | var generating = false; 10 | window.addEventListener('beforeunload', function(e) { 11 | if (generating) { 12 | var confirmationMessage = 'Process has not completed!'; 13 | (e || window.event).returnValue = confirmationMessage; 14 | return confirmationMessage; 15 | } 16 | }); 17 | jQuery(document).ready(function($) { 18 | function generate() { 19 | $.ajax({ 20 | url : ajaxurl + '?action=ajax&task=generate', 21 | type : 'POST', 22 | data : $('#fillitup-generate-form').serialize(), 23 | dataType : 'json' 24 | }).done(function(response, result, request) { 25 | var total = $('input[name=total]').val(); 26 | var percentage = parseInt((response.offset / total) * 100); 27 | var offset = parseInt(response.offset) + 1; 28 | $('input[name=offset]').val(offset); 29 | $('input[name=definitions]').val(JSON.stringify(response.definitions)); 30 | $('#fillitup-percentage').text(percentage + '%'); 31 | $('#fillitup-status-bar').animate({ 32 | 'width' : (percentage) + '%' 33 | }, 'slow', 'linear', function() { 34 | if (parseInt(total) === parseInt(response.offset)) { 35 | generating = false; 36 | $('#fillitup-completed-message').show(); 37 | } else { 38 | generate(); 39 | } 40 | }); 41 | }).fail(function(request, result, statusText) { 42 | alert(request.responseText); 43 | }); 44 | } 45 | 46 | $('#fillitup-start-over-button').click(function(event) { 47 | event.preventDefault(); 48 | $('#fillitup-progress-container').slideUp(); 49 | $('#fillitup-form-container').slideDown(); 50 | $('#fillitup-status-bar').css('width', '0%'); 51 | $('#fillitup-percentage').text('0%'); 52 | $('#fillitup-completed-message').hide(); 53 | }); 54 | 55 | $('#fillitup-generate-form').on('submit', function(event) { 56 | event.preventDefault(); 57 | var total = parseInt($('input[name=total]').val()); 58 | if (total < 1) { 59 | alert('Invalid number of entries'); 60 | return false; 61 | } 62 | generating = true; 63 | $('input[name=offset]').val(1); 64 | $('#fillitup-form-container').slideUp(); 65 | $('#fillitup-progress-container').slideDown(); 66 | $.ajax({ 67 | type : 'GET', 68 | url : ajaxurl + '?action=ajax&task=definitions', 69 | dataType : 'json' 70 | }).done(function(response, result, request) { 71 | $('#fillitup-generate-form').find('input[name="definitions"]').val(JSON.stringify(response)); 72 | generate(); 73 | }).fail(function(request, result, statusText) { 74 | alert(request.responseText); 75 | }); 76 | 77 | }); 78 | }); 79 | -------------------------------------------------------------------------------- /admin/index.php: -------------------------------------------------------------------------------- 1 | execute($task); 20 | -------------------------------------------------------------------------------- /admin/lib/Faker/Calculator/Luhn.php: -------------------------------------------------------------------------------- 1 | = 0; $i -= 2) { 24 | $sum += $number{$i}; 25 | } 26 | for ($i = $length - 2; $i >= 0; $i -= 2) { 27 | $sum += array_sum(str_split($number{$i} * 2)); 28 | } 29 | 30 | return $sum % 10; 31 | } 32 | 33 | /** 34 | * @return string 35 | */ 36 | public static function computeCheckDigit($partialNumber) 37 | { 38 | $checkDigit = self::checksum($partialNumber . '0'); 39 | if ($checkDigit === 0) { 40 | return 0; 41 | } 42 | 43 | return (string) (10 - $checkDigit); 44 | } 45 | 46 | /** 47 | * Checks whether a number (partial number + check digit) is Luhn compliant 48 | * 49 | * @return boolean 50 | */ 51 | public static function isValid($number) 52 | { 53 | return self::checksum($number) === 0; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /admin/lib/Faker/DefaultGenerator.php: -------------------------------------------------------------------------------- 1 | optional(). 8 | */ 9 | class DefaultGenerator 10 | { 11 | protected $default = null; 12 | 13 | public function __construct($default = null) 14 | { 15 | $this->default = $default; 16 | } 17 | 18 | public function __get($attribute) 19 | { 20 | return $this->default; 21 | } 22 | 23 | public function __call($method, $attributes) 24 | { 25 | return $this->default; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /admin/lib/Faker/Documentor.php: -------------------------------------------------------------------------------- 1 | generator = $generator; 12 | } 13 | 14 | public function getFormatters() 15 | { 16 | $formatters = array(); 17 | $providers = array_reverse($this->generator->getProviders()); 18 | $providers[]= new \Faker\Provider\Base($this->generator); 19 | foreach ($providers as $provider) { 20 | $providerClass = get_class($provider); 21 | $formatters[$providerClass] = array(); 22 | $refl = new \ReflectionObject($provider); 23 | foreach ($refl->getMethods(\ReflectionMethod::IS_PUBLIC) as $reflmethod) { 24 | if ($reflmethod->getDeclaringClass()->getName() == 'Faker\Provider\Base' && $providerClass != 'Faker\Provider\Base') { 25 | continue; 26 | } 27 | $methodName = $reflmethod->name; 28 | if ($reflmethod->isConstructor()) { 29 | continue; 30 | } 31 | $parameters = array(); 32 | foreach ($reflmethod->getParameters() as $reflparameter) { 33 | $parameter = '$'. $reflparameter->getName(); 34 | if ($reflparameter->isDefaultValueAvailable()) { 35 | $parameter .= ' = ' . var_export($reflparameter->getDefaultValue(), true); 36 | } 37 | $parameters []= $parameter; 38 | } 39 | $parameters = $parameters ? '('. join(', ', $parameters) . ')' : ''; 40 | try { 41 | $example = $this->generator->format($methodName); 42 | } catch (\InvalidArgumentException $e) { 43 | $example = ''; 44 | } 45 | if (is_array($example)) { 46 | $example = "array('". join("', '", $example) . "')"; 47 | } elseif ($example instanceof \DateTime) { 48 | $example = "DateTime('" . $example->format('Y-m-d H:i:s') . "')"; 49 | } elseif ($example instanceof Generator || $example instanceof UniqueGenerator) { // modifier 50 | $example = ''; 51 | } else { 52 | $example = var_export($example, true); 53 | } 54 | $formatters[$providerClass][$methodName . $parameters] = $example; 55 | } 56 | } 57 | 58 | return $formatters; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /admin/lib/Faker/Factory.php: -------------------------------------------------------------------------------- 1 | addProvider(new $providerClassName($generator)); 17 | } 18 | 19 | return $generator; 20 | } 21 | 22 | protected static function getProviderClassname($provider, $locale = '') 23 | { 24 | if ($providerClass = self::findProviderClassname($provider, $locale)) { 25 | return $providerClass; 26 | } 27 | // fallback to default locale 28 | if ($providerClass = self::findProviderClassname($provider, static::DEFAULT_LOCALE)) { 29 | return $providerClass; 30 | } 31 | // fallback to no locale 32 | $providerClass = self::findProviderClassname($provider); 33 | if (class_exists($providerClass)) { 34 | return $providerClass; 35 | } 36 | throw new \InvalidArgumentException(sprintf('Unable to find provider "%s" with locale "%s"', $provider, $locale)); 37 | } 38 | 39 | protected static function findProviderClassname($provider, $locale = '') 40 | { 41 | $providerClass = 'Faker\\' . ($locale ? sprintf('Provider\%s\%s', $locale, $provider) : sprintf('Provider\%s', $provider)); 42 | if (class_exists($providerClass, true)) { 43 | return $providerClass; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /admin/lib/Faker/Guesser/Name.php: -------------------------------------------------------------------------------- 1 | generator = $generator; 14 | } 15 | 16 | public function guessFormat($name) 17 | { 18 | $name = Base::toLower($name); 19 | $generator = $this->generator; 20 | if (preg_match('/^is[_A-Z]/', $name)) { 21 | return function () use ($generator) { 22 | return $generator->boolean; 23 | }; 24 | } 25 | if (preg_match('/(_a|A)t$/', $name)) { 26 | return function () use ($generator) { 27 | return $generator->dateTime; 28 | }; 29 | } 30 | switch ($name) { 31 | case 'first_name': 32 | case 'firstname': 33 | return function () use ($generator) { 34 | return $generator->firstName; 35 | }; 36 | case 'last_name': 37 | case 'lastname': 38 | return function () use ($generator) { 39 | return $generator->lastName; 40 | }; 41 | case 'username': 42 | case 'login': 43 | return function () use ($generator) { 44 | return $generator->userName; 45 | }; 46 | case 'email': 47 | return function () use ($generator) { 48 | return $generator->email; 49 | }; 50 | case 'phone_number': 51 | case 'phonenumber': 52 | case 'phone': 53 | return function () use ($generator) { 54 | return $generator->phoneNumber; 55 | }; 56 | case 'address': 57 | return function () use ($generator) { 58 | return $generator->address; 59 | }; 60 | case 'city': 61 | return function () use ($generator) { 62 | return $generator->city; 63 | }; 64 | case 'streetaddress': 65 | return function () use ($generator) { 66 | return $generator->streetAddress; 67 | }; 68 | case 'postcode': 69 | case 'zipcode': 70 | return function () use ($generator) { 71 | return $generator->postcode; 72 | }; 73 | case 'state': 74 | return function () use ($generator) { 75 | return $generator->state; 76 | }; 77 | case 'country': 78 | return function () use ($generator) { 79 | return $generator->country; 80 | }; 81 | case 'title': 82 | return function () use ($generator) { 83 | return $generator->sentence; 84 | }; 85 | case 'body': 86 | case 'summary': 87 | return function () use ($generator) { 88 | return $generator->text; 89 | }; 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /admin/lib/Faker/ORM/CakePHP/ColumnTypeGuesser.php: -------------------------------------------------------------------------------- 1 | generator = $generator; 12 | } 13 | 14 | public function guessFormat($column, $table) 15 | { 16 | $generator = $this->generator; 17 | $schema = $table->schema(); 18 | 19 | switch ($schema->columnType($column)) { 20 | case 'boolean': 21 | return function () use ($generator) { 22 | return $generator->boolean; 23 | }; 24 | case 'integer': 25 | return function () use ($generator) { 26 | return $generator->randomNumber(10); 27 | }; 28 | case 'biginteger': 29 | return function () use ($generator) { 30 | return $generator->randomNumber(20); 31 | }; 32 | case 'decimal': 33 | case 'float': 34 | return function () use ($generator) { 35 | return $generator->randomFloat(); 36 | }; 37 | case 'uuid': 38 | return function () use ($generator) { 39 | return $generator->uuid(); 40 | }; 41 | case 'string': 42 | $columnData = $schema->column($column); 43 | $length = $columnData['length']; 44 | return function () use ($generator, $length) { 45 | return $generator->text($length); 46 | }; 47 | case 'text': 48 | return function () use ($generator) { 49 | return $generator->text(); 50 | }; 51 | case 'date': 52 | case 'datetime': 53 | case 'timestamp': 54 | case 'time': 55 | return function () use ($generator) { 56 | return $generator->datetime(); 57 | }; 58 | 59 | case 'binary': 60 | default: 61 | return null; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /admin/lib/Faker/ORM/CakePHP/Populator.php: -------------------------------------------------------------------------------- 1 | generator = $generator; 16 | } 17 | 18 | public function getGenerator() 19 | { 20 | return $this->generator; 21 | } 22 | 23 | public function getGuessers() 24 | { 25 | return $this->guessers; 26 | } 27 | 28 | public function removeGuesser($name) 29 | { 30 | if ($this->guessers[$name]) { 31 | unset($this->guessers[$name]); 32 | } 33 | return $this; 34 | } 35 | 36 | public function addGuesser($class) 37 | { 38 | if (!is_object($class)) { 39 | $class = new $class($this->generator); 40 | } 41 | 42 | if (!method_exists($class, 'guessFormat')) { 43 | throw new \Exception('Missing required custom guesser method: ' . get_class($class) . '::guessFormat()'); 44 | } 45 | 46 | $this->guessers[get_class($class)] = $class; 47 | return $this; 48 | } 49 | 50 | public function addEntity($entity, $number, $customColumnFormatters = [], $customModifiers = []) 51 | { 52 | if (!$entity instanceof EntityPopulator) { 53 | $entity = new EntityPopulator($entity); 54 | } 55 | 56 | $entity->columnFormatters = $entity->guessColumnFormatters($this); 57 | if ($customColumnFormatters) { 58 | $entity->mergeColumnFormattersWith($customColumnFormatters); 59 | } 60 | 61 | $entity->modifiers = $entity->guessModifiers($this); 62 | if ($customModifiers) { 63 | $entity->mergeModifiers($customModifiers); 64 | } 65 | 66 | $class = $entity->class; 67 | $this->entities[$class] = $entity; 68 | $this->quantities[$class] = $number; 69 | return $this; 70 | } 71 | 72 | public function execute($options = []) 73 | { 74 | $insertedEntities = []; 75 | 76 | foreach ($this->quantities as $class => $number) { 77 | for ($i = 0; $i < $number; $i++) { 78 | $insertedEntities[$class][] = $this->entities[$class]->execute($class, $insertedEntities, $options); 79 | } 80 | } 81 | 82 | return $insertedEntities; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /admin/lib/Faker/ORM/Doctrine/ColumnTypeGuesser.php: -------------------------------------------------------------------------------- 1 | generator = $generator; 14 | } 15 | 16 | public function guessFormat($fieldName, ClassMetadata $class) 17 | { 18 | $generator = $this->generator; 19 | $type = $class->getTypeOfField($fieldName); 20 | switch ($type) { 21 | case 'boolean': 22 | return function () use ($generator) { 23 | return $generator->boolean; 24 | }; 25 | case 'decimal': 26 | $size = isset($class->fieldMappings[$fieldName]['precision']) ? $class->fieldMappings[$fieldName]['precision'] : 2; 27 | 28 | return function () use ($generator, $size) { 29 | return $generator->randomNumber($size + 2) / 100; 30 | }; 31 | case 'smallint': 32 | return function () { 33 | return mt_rand(0, 65535); 34 | }; 35 | case 'integer': 36 | return function () { 37 | return mt_rand(0, intval('2147483647')); 38 | }; 39 | case 'bigint': 40 | return function () { 41 | return mt_rand(0, intval('18446744073709551615')); 42 | }; 43 | case 'float': 44 | return function () { 45 | return mt_rand(0, intval('4294967295'))/mt_rand(1, intval('4294967295')); 46 | }; 47 | case 'string': 48 | $size = isset($class->fieldMappings[$fieldName]['length']) ? $class->fieldMappings[$fieldName]['length'] : 255; 49 | 50 | return function () use ($generator, $size) { 51 | return $generator->text($size); 52 | }; 53 | case 'text': 54 | return function () use ($generator) { 55 | return $generator->text; 56 | }; 57 | case 'datetime': 58 | case 'date': 59 | case 'time': 60 | return function () use ($generator) { 61 | return $generator->datetime; 62 | }; 63 | default: 64 | // no smart way to guess what the user expects here 65 | return null; 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /admin/lib/Faker/ORM/Doctrine/Populator.php: -------------------------------------------------------------------------------- 1 | generator = $generator; 22 | $this->manager = $manager; 23 | } 24 | 25 | /** 26 | * Add an order for the generation of $number records for $entity. 27 | * 28 | * @param mixed $entity A Doctrine classname, or a \Faker\ORM\Doctrine\EntityPopulator instance 29 | * @param int $number The number of entities to populate 30 | */ 31 | public function addEntity($entity, $number, $customColumnFormatters = array(), $customModifiers = array(), $generateId = false) 32 | { 33 | if (!$entity instanceof \Faker\ORM\Doctrine\EntityPopulator) { 34 | if (null === $this->manager) { 35 | throw new \InvalidArgumentException("No entity manager passed to Doctrine Populator."); 36 | } 37 | $entity = new \Faker\ORM\Doctrine\EntityPopulator($this->manager->getClassMetadata($entity)); 38 | } 39 | $entity->setColumnFormatters($entity->guessColumnFormatters($this->generator)); 40 | if ($customColumnFormatters) { 41 | $entity->mergeColumnFormattersWith($customColumnFormatters); 42 | } 43 | $entity->mergeModifiersWith($customModifiers); 44 | $this->generateId[$entity->getClass()] = $generateId; 45 | 46 | $class = $entity->getClass(); 47 | $this->entities[$class] = $entity; 48 | $this->quantities[$class] = $number; 49 | } 50 | 51 | /** 52 | * Populate the database using all the Entity classes previously added. 53 | * 54 | * @param EntityManager $entityManager A Doctrine connection object 55 | * 56 | * @return array A list of the inserted PKs 57 | */ 58 | public function execute($entityManager = null) 59 | { 60 | if (null === $entityManager) { 61 | $entityManager = $this->manager; 62 | } 63 | if (null === $entityManager) { 64 | throw new \InvalidArgumentException("No entity manager passed to Doctrine Populator."); 65 | } 66 | 67 | $insertedEntities = array(); 68 | foreach ($this->quantities as $class => $number) { 69 | $generateId = $this->generateId[$class]; 70 | for ($i=0; $i < $number; $i++) { 71 | $insertedEntities[$class][]= $this->entities[$class]->execute($entityManager, $insertedEntities, $generateId); 72 | } 73 | $entityManager->flush(); 74 | } 75 | 76 | return $insertedEntities; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /admin/lib/Faker/ORM/Mandango/ColumnTypeGuesser.php: -------------------------------------------------------------------------------- 1 | generator = $generator; 12 | } 13 | 14 | public function guessFormat($field) 15 | { 16 | $generator = $this->generator; 17 | switch ($field['type']) { 18 | case 'boolean': 19 | return function () use ($generator) { 20 | return $generator->boolean; 21 | }; 22 | case 'integer': 23 | return function () { 24 | return mt_rand(0, intval('4294967295')); 25 | }; 26 | case 'float': 27 | return function () { 28 | return mt_rand(0, intval('4294967295'))/mt_rand(1, intval('4294967295')); 29 | }; 30 | case 'string': 31 | return function () use ($generator) { 32 | return $generator->text(255); 33 | }; 34 | case 'date': 35 | return function () use ($generator) { 36 | return $generator->datetime; 37 | }; 38 | default: 39 | // no smart way to guess what the user expects here 40 | return null; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /admin/lib/Faker/ORM/Mandango/Populator.php: -------------------------------------------------------------------------------- 1 | generator = $generator; 21 | $this->mandango = $mandango; 22 | } 23 | 24 | /** 25 | * Add an order for the generation of $number records for $entity. 26 | * 27 | * @param mixed $entity A Propel ActiveRecord classname, or a \Faker\ORM\Propel\EntityPopulator instance 28 | * @param int $number The number of entities to populate 29 | */ 30 | public function addEntity($entity, $number, $customColumnFormatters = array()) 31 | { 32 | if (!$entity instanceof \Faker\ORM\Mandango\EntityPopulator) { 33 | $entity = new \Faker\ORM\Mandango\EntityPopulator($entity); 34 | } 35 | $entity->setColumnFormatters($entity->guessColumnFormatters($this->generator, $this->mandango)); 36 | if ($customColumnFormatters) { 37 | $entity->mergeColumnFormattersWith($customColumnFormatters); 38 | } 39 | $class = $entity->getClass(); 40 | $this->entities[$class] = $entity; 41 | $this->quantities[$class] = $number; 42 | } 43 | 44 | /** 45 | * Populate the database using all the Entity classes previously added. 46 | * 47 | * @return array A list of the inserted entities. 48 | */ 49 | public function execute() 50 | { 51 | $insertedEntities = array(); 52 | foreach ($this->quantities as $class => $number) { 53 | for ($i=0; $i < $number; $i++) { 54 | $insertedEntities[$class][]= $this->entities[$class]->execute($this->mandango, $insertedEntities); 55 | } 56 | } 57 | $this->mandango->flush(); 58 | 59 | return $insertedEntities; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /admin/lib/Faker/ORM/Propel/Populator.php: -------------------------------------------------------------------------------- 1 | generator = $generator; 18 | } 19 | 20 | /** 21 | * Add an order for the generation of $number records for $entity. 22 | * 23 | * @param mixed $entity A Propel ActiveRecord classname, or a \Faker\ORM\Propel\EntityPopulator instance 24 | * @param int $number The number of entities to populate 25 | */ 26 | public function addEntity($entity, $number, $customColumnFormatters = array(), $customModifiers = array()) 27 | { 28 | if (!$entity instanceof \Faker\ORM\Propel\EntityPopulator) { 29 | $entity = new \Faker\ORM\Propel\EntityPopulator($entity); 30 | } 31 | $entity->setColumnFormatters($entity->guessColumnFormatters($this->generator)); 32 | if ($customColumnFormatters) { 33 | $entity->mergeColumnFormattersWith($customColumnFormatters); 34 | } 35 | $entity->setModifiers($entity->guessModifiers($this->generator)); 36 | if ($customModifiers) { 37 | $entity->mergeModifiersWith($customModifiers); 38 | } 39 | $class = $entity->getClass(); 40 | $this->entities[$class] = $entity; 41 | $this->quantities[$class] = $number; 42 | } 43 | 44 | /** 45 | * Populate the database using all the Entity classes previously added. 46 | * 47 | * @param PropelPDO $con A Propel connection object 48 | * 49 | * @return array A list of the inserted PKs 50 | */ 51 | public function execute($con = null) 52 | { 53 | if (null === $con) { 54 | $con = $this->getConnection(); 55 | } 56 | $isInstancePoolingEnabled = \Propel::isInstancePoolingEnabled(); 57 | \Propel::disableInstancePooling(); 58 | $insertedEntities = array(); 59 | $con->beginTransaction(); 60 | foreach ($this->quantities as $class => $number) { 61 | for ($i=0; $i < $number; $i++) { 62 | $insertedEntities[$class][]= $this->entities[$class]->execute($con, $insertedEntities); 63 | } 64 | } 65 | $con->commit(); 66 | if ($isInstancePoolingEnabled) { 67 | \Propel::enableInstancePooling(); 68 | } 69 | 70 | return $insertedEntities; 71 | } 72 | 73 | protected function getConnection() 74 | { 75 | // use the first connection available 76 | $class = key($this->entities); 77 | 78 | if (!$class) { 79 | throw new \RuntimeException('No class found from entities. Did you add entities to the Populator ?'); 80 | } 81 | 82 | $peer = $class::PEER; 83 | 84 | return \Propel::getConnection($peer::DATABASE_NAME, \Propel::CONNECTION_WRITE); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/Address.php: -------------------------------------------------------------------------------- 1 | generator->parse($format); 58 | } 59 | 60 | /** 61 | * @example 'Crist Parks' 62 | */ 63 | public function streetName() 64 | { 65 | $format = static::randomElement(static::$streetNameFormats); 66 | 67 | return $this->generator->parse($format); 68 | } 69 | 70 | /** 71 | * @example '791 Crist Parks' 72 | */ 73 | public function streetAddress() 74 | { 75 | $format = static::randomElement(static::$streetAddressFormats); 76 | 77 | return $this->generator->parse($format); 78 | } 79 | 80 | /** 81 | * @example 86039-9874 82 | */ 83 | public static function postcode() 84 | { 85 | return static::toUpper(static::bothify(static::randomElement(static::$postcode))); 86 | } 87 | 88 | /** 89 | * @example '791 Crist Parks, Sashabury, IL 86039-9874' 90 | */ 91 | public function address() 92 | { 93 | $format = static::randomElement(static::$addressFormats); 94 | 95 | return $this->generator->parse($format); 96 | } 97 | 98 | /** 99 | * @example 'Japan' 100 | */ 101 | public static function country() 102 | { 103 | return static::randomElement(static::$country); 104 | } 105 | 106 | /** 107 | * @example 77.147489 108 | * @return float Uses signed degrees format (returns a float number between -90 and 90) 109 | */ 110 | public static function latitude() 111 | { 112 | return static::randomFloat(6, 0, 180) - 90; 113 | } 114 | 115 | /** 116 | * @example 86.211205 117 | * @return float Uses signed degrees format (returns a float number between -180 and 180) 118 | */ 119 | public static function longitude() 120 | { 121 | return static::randomFloat(6, 0, 360) - 180; 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/Barcode.php: -------------------------------------------------------------------------------- 1 | numerify(str_repeat('#', $length - 1)); 14 | 15 | return $code . static::eanChecksum($code); 16 | } 17 | 18 | /** 19 | * Utility function for computing EAN checksums 20 | */ 21 | protected static function eanChecksum($input) 22 | { 23 | $sequence = (strlen($input) - 1) == 8 ? array(3, 1) : array(1, 3); 24 | $sums = 0; 25 | foreach (str_split($input) as $n => $digit) { 26 | $sums += $digit * $sequence[$n % 2]; 27 | } 28 | return (10 - $sums % 10) % 10; 29 | } 30 | 31 | /** 32 | * ISBN-10 check digit 33 | * @link http://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-10_check_digits 34 | * 35 | * @param string $input ISBN without check-digit 36 | * @throws \LengthException When wrong input length passed 37 | * 38 | * @return integer Check digit 39 | */ 40 | protected static function isbnChecksum($input) 41 | { 42 | // We're calculating check digit for ISBN-10 43 | // so, the length of the input should be 9 44 | $length = 9; 45 | 46 | if (strlen($input) != $length) { 47 | throw new \LengthException(sprintf('Input length should be equal to %d', $length)); 48 | } 49 | 50 | $digits = str_split($input); 51 | array_walk( 52 | $digits, 53 | function (&$digit, $position) { 54 | $digit = (10 - $position) * $digit; 55 | } 56 | ); 57 | $result = (11 - array_sum($digits) % 11) % 11; 58 | 59 | // 10 is replaced by X 60 | return ($result < 10)?$result:'X'; 61 | } 62 | 63 | /** 64 | * Get a random EAN13 barcode. 65 | * @return string 66 | * @example '4006381333931' 67 | */ 68 | public function ean13() 69 | { 70 | return $this->ean(13); 71 | } 72 | 73 | /** 74 | * Get a random EAN8 barcode. 75 | * @return string 76 | * @example '73513537' 77 | */ 78 | public function ean8() 79 | { 80 | return $this->ean(8); 81 | } 82 | 83 | /** 84 | * Get a random ISBN-10 code 85 | * @link http://en.wikipedia.org/wiki/International_Standard_Book_Number 86 | * 87 | * @return string 88 | * @example '4881416324' 89 | */ 90 | public function isbn10() 91 | { 92 | $code = $this->numerify(str_repeat('#', 9)); 93 | 94 | return $code . static::isbnChecksum($code); 95 | } 96 | 97 | /** 98 | * Get a random ISBN-13 code 99 | * @link http://en.wikipedia.org/wiki/International_Standard_Book_Number 100 | * 101 | * @return string 102 | * @example '9790404436093' 103 | */ 104 | public function isbn13() 105 | { 106 | $code = '97' . static::numberBetween(8, 9) . $this->numerify(str_repeat('#', 9)); 107 | 108 | return $code . static::eanChecksum($code); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/Biased.php: -------------------------------------------------------------------------------- 1 | generator->parse($format); 21 | } 22 | 23 | /** 24 | * @example 'Ltd' 25 | */ 26 | public static function companySuffix() 27 | { 28 | return static::randomElement(static::$companySuffix); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/Image.php: -------------------------------------------------------------------------------- 1 | > 8) | (($tLo & 0xff000000) >> 24); 31 | $tMi = (($tMi & 0x00ff) << 8) | (($tMi & 0xff00) >> 8); 32 | $tHi = (($tHi & 0x00ff) << 8) | (($tHi & 0xff00) >> 8); 33 | } 34 | 35 | // apply version number 36 | $tHi &= 0x0fff; 37 | $tHi |= (3 << 12); 38 | 39 | // cast to string 40 | $uuid = sprintf( 41 | '%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x', 42 | $tLo, 43 | $tMi, 44 | $tHi, 45 | $csHi, 46 | $csLo, 47 | $byte[10], 48 | $byte[11], 49 | $byte[12], 50 | $byte[13], 51 | $byte[14], 52 | $byte[15] 53 | ); 54 | 55 | return $uuid; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/ar_JO/Company.php: -------------------------------------------------------------------------------- 1 | generator->parse($format)); 46 | } 47 | 48 | /** 49 | * @example 'wewebit.jo' 50 | */ 51 | public function domainName() 52 | { 53 | return static::randomElement(static::$lastNameAscii) . '.' . $this->tld(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/at_AT/Payment.php: -------------------------------------------------------------------------------- 1 | format('w')]; 38 | } 39 | 40 | /** 41 | * @param \DateTime|int|string $max maximum timestamp used as random end limit, default to "now" 42 | * @return string 43 | * @example '2' 44 | */ 45 | public static function dayOfMonth($max = 'now') 46 | { 47 | return static::dateTime($max)->format('j'); 48 | } 49 | 50 | /** 51 | * Full date with inflected month 52 | * @return string 53 | * @example '16. listopadu 2003' 54 | */ 55 | public function formattedDate() 56 | { 57 | $format = static::randomElement(static::$formattedDateFormat); 58 | 59 | return $this->generator->parse($format); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/cs_CZ/Internet.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Company extends \Faker\Provider\Company 9 | { 10 | /** 11 | * @var array Danish company name formats. 12 | */ 13 | protected static $formats = array( 14 | '{{lastName}} {{companySuffix}}', 15 | '{{lastName}} {{companySuffix}}', 16 | '{{lastName}} {{companySuffix}}', 17 | '{{firstname}} {{lastName}} {{companySuffix}}', 18 | '{{middleName}} {{companySuffix}}', 19 | '{{middleName}} {{companySuffix}}', 20 | '{{middleName}} {{companySuffix}}', 21 | '{{firstname}} {{middleName}} {{companySuffix}}', 22 | '{{lastName}} & {{lastName}} {{companySuffix}}', 23 | '{{lastName}} og {{lastName}} {{companySuffix}}', 24 | '{{lastName}} & {{lastName}} {{companySuffix}}', 25 | '{{lastName}} og {{lastName}} {{companySuffix}}', 26 | '{{middleName}} & {{middleName}} {{companySuffix}}', 27 | '{{middleName}} og {{middleName}} {{companySuffix}}', 28 | '{{middleName}} & {{lastName}}', 29 | '{{middleName}} og {{lastName}}', 30 | ); 31 | 32 | /** 33 | * @var array Company suffixes. 34 | */ 35 | protected static $companySuffix = array('ApS', 'A/S', 'I/S', 'K/S'); 36 | 37 | /** 38 | * @link http://cvr.dk/Site/Forms/CMS/DisplayPage.aspx?pageid=60 39 | * 40 | * @var string CVR number format. 41 | */ 42 | protected static $cvrFormat = '%#######'; 43 | 44 | /** 45 | * @link http://cvr.dk/Site/Forms/CMS/DisplayPage.aspx?pageid=60 46 | * 47 | * @var string P number (production number) format. 48 | */ 49 | protected static $pFormat = '%#########'; 50 | 51 | /** 52 | * Generates a CVR number (8 digits). 53 | * 54 | * @return string 55 | */ 56 | public static function cvr() 57 | { 58 | return static::numerify(static::$cvrFormat); 59 | } 60 | 61 | /** 62 | * Generates a P entity number (10 digits). 63 | * 64 | * @return string 65 | */ 66 | public static function p() 67 | { 68 | return static::numerify(static::$pFormat); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/da_DK/Internet.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Internet extends \Faker\Provider\Internet 9 | { 10 | /** 11 | * @var array Some safe email TLD. 12 | */ 13 | protected static $safeEmailTld = array( 14 | 'org', 'com', 'net', 'dk', 'dk', 'dk', 15 | ); 16 | 17 | /** 18 | * @var array Some email domains in Denmark. 19 | */ 20 | protected static $freeEmailDomain = array( 21 | 'gmail.com', 'yahoo.com', 'yahoo.dk', 'hotmail.com', 'hotmail.dk', 'mail.dk', 'live.dk' 22 | ); 23 | 24 | /** 25 | * @var array Some TLD. 26 | */ 27 | protected static $tld = array( 28 | 'com', 'com', 'com', 'biz', 'info', 'net', 'org', 'dk', 'dk', 'dk', 29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/da_DK/Payment.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class PhoneNumber extends \Faker\Provider\PhoneNumber 9 | { 10 | /** 11 | * @var array Danish phonenumber formats. 12 | */ 13 | protected static $formats = array( 14 | '+45 ## ## ## ##', 15 | '+45 #### ####', 16 | '+45########', 17 | '## ## ## ##', 18 | '#### ####', 19 | '########', 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/de_AT/Company.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Company extends \Faker\Provider\Company 9 | { 10 | /** 11 | * @var array Danish company name formats. 12 | */ 13 | protected static $formats = array( 14 | '{{lastName}} {{companySuffix}}', 15 | '{{lastName}} {{companySuffix}}', 16 | '{{lastName}} {{companySuffix}}', 17 | '{{firstname}} {{lastName}} {{companySuffix}}', 18 | '{{middleName}} {{companySuffix}}', 19 | '{{middleName}} {{companySuffix}}', 20 | '{{middleName}} {{companySuffix}}', 21 | '{{firstname}} {{middleName}} {{companySuffix}}', 22 | '{{lastName}} & {{lastName}} {{companySuffix}}', 23 | '{{lastName}} og {{lastName}} {{companySuffix}}', 24 | '{{lastName}} & {{lastName}} {{companySuffix}}', 25 | '{{lastName}} og {{lastName}} {{companySuffix}}', 26 | '{{middleName}} & {{middleName}} {{companySuffix}}', 27 | '{{middleName}} og {{middleName}} {{companySuffix}}', 28 | '{{middleName}} & {{lastName}}', 29 | '{{middleName}} og {{lastName}}', 30 | ); 31 | 32 | /** 33 | * @var array Company suffixes. 34 | */ 35 | protected static $companySuffix = array('ehf.', 'hf.', 'sf.'); 36 | 37 | /** 38 | * @link http://www.rsk.is/atvinnurekstur/virdisaukaskattur/ 39 | * 40 | * @var string VSK number format. 41 | */ 42 | protected static $vskFormat = '%####'; 43 | 44 | /** 45 | * Generates a VSK number (5 digits). 46 | * 47 | * @return string 48 | */ 49 | public static function vsk() 50 | { 51 | return static::numerify(static::$vskFormat); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/is_IS/Internet.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class Internet extends \Faker\Provider\Internet 9 | { 10 | /** 11 | * @var array Some email domains in Denmark. 12 | */ 13 | protected static $freeEmailDomain = array( 14 | 'gmail.com', 'yahoo.com', 'hotmail.com', 'visir.is', 'simnet.is', 'internet.is' 15 | ); 16 | 17 | /** 18 | * @var array Some TLD. 19 | */ 20 | protected static $tld = array( 21 | 'com', 'com', 'com', 'net', 'is', 'is', 'is', 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/is_IS/Payment.php: -------------------------------------------------------------------------------- 1 | 7 | */ 8 | class PhoneNumber extends \Faker\Provider\PhoneNumber 9 | { 10 | /** 11 | * @var array Icelandic phone number formats. 12 | */ 13 | protected static $formats = array( 14 | '+354 ### ####', 15 | '+354 #######', 16 | '+354#######', 17 | '### ####', 18 | '#######', 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/it_IT/Internet.php: -------------------------------------------------------------------------------- 1 | generator->parse($format)); 48 | } 49 | 50 | /** 51 | * @example 'yamada.jp' 52 | */ 53 | public function domainName() 54 | { 55 | return static::randomElement(static::$lastNameAscii) . '.' . $this->tld(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/ja_JP/PhoneNumber.php: -------------------------------------------------------------------------------- 1 | generator->parse($format); 90 | } 91 | 92 | public static function country() 93 | { 94 | return static::randomElement(static::$country); 95 | } 96 | 97 | public static function postcode() 98 | { 99 | return static::toUpper(static::bothify(static::randomElement(static::$postcode))); 100 | } 101 | 102 | public static function regionSuffix() 103 | { 104 | return static::randomElement(static::$regionSuffix); 105 | } 106 | 107 | public static function region() 108 | { 109 | return static::randomElement(static::$region); 110 | } 111 | 112 | public static function citySuffix() 113 | { 114 | return static::randomElement(static::$citySuffix); 115 | } 116 | 117 | public function city() 118 | { 119 | return static::randomElement(static::$city); 120 | } 121 | 122 | public static function streetSuffix() 123 | { 124 | return static::randomElement(static::$streetSuffix); 125 | } 126 | 127 | public static function street() 128 | { 129 | return static::randomElement(static::$street); 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/kk_KZ/Color.php: -------------------------------------------------------------------------------- 1 | generator->parse($format); 35 | } 36 | 37 | public static function companyPrefix() 38 | { 39 | return static::randomElement(static::$companyPrefixes); 40 | } 41 | 42 | public static function companyNameElement() 43 | { 44 | return static::randomElement(static::$companyElements); 45 | } 46 | 47 | public static function companyNameSuffix() 48 | { 49 | return static::randomElement(static::$companyNameSuffixes); 50 | } 51 | 52 | /** 53 | * National Business Identification Numbers 54 | * 55 | * @link http://egov.kz/wps/portal/!utWCM/p/b1/04_Sj9Q1MjAwsDQ1s9CP0I_KSyzLTE8syczPS8wB8aPM4oO8PE2cnAwdDSxMw4wMHE08nZ2CA0KDXcwMgQoikRUYWIY4gxS4hwU4mRkbGBgTp98AB3A0IKQ_XD8KVQkWF4AV4LHCzyM_N1U_uKhUPzcqx83SU9cRANth_Rk!/dl4/d5/L0lHSkovd0RNQU5rQUVnQSEhLzRKVUUvZW4!/ 56 | * @param \DateTime $registrationDate 57 | * @return string 12 digits, like 150140000019 58 | */ 59 | public static function businessIdentificationNumber(\DateTime $registrationDate = null) 60 | { 61 | if (!$registrationDate) { 62 | $registrationDate = \Faker\Provider\DateTime::dateTimeThisYear(); 63 | } 64 | 65 | $dateAsString = $registrationDate->format('ym'); 66 | $legalEntityType = (string) static::numberBetween(4, 6); 67 | $legalEntityAdditionalType = (string) static::numberBetween(0, 3); 68 | $randomDigits = (string) static::numerify('######'); 69 | 70 | return $dateAsString . $legalEntityType . $legalEntityAdditionalType . $randomDigits; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/kk_KZ/Internet.php: -------------------------------------------------------------------------------- 1 | generator->numerify('########0001'); 28 | $n .= check_digit($n); 29 | $n .= check_digit($n); 30 | 31 | return $formatted? vsprintf('%d%d.%d%d%d.%d%d%d/%d%d%d%d-%d%d', str_split($n)) : $n; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/pt_BR/Internet.php: -------------------------------------------------------------------------------- 1 | = 12; 18 | $verifier = 0; 19 | 20 | for ($i = 1; $i <= $length; $i++) { 21 | if (!$second_algorithm) { 22 | $multiplier = $i+1; 23 | } else { 24 | $multiplier = ($i >= 9)? $i-7 : $i+1; 25 | } 26 | $verifier += $numbers[$length-$i] * $multiplier; 27 | } 28 | 29 | $verifier = 11 - ($verifier % 11); 30 | if ($verifier >= 10) { 31 | $verifier = 0; 32 | } 33 | 34 | return $verifier; 35 | } 36 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/pt_PT/Payment.php: -------------------------------------------------------------------------------- 1 | array( 9 | '021#######', // Bucharest 10 | '023#######', 11 | '024#######', 12 | '025#######', 13 | '026#######', 14 | '027#######', // non-geographic 15 | '031#######', // Bucharest 16 | '033#######', 17 | '034#######', 18 | '035#######', 19 | '036#######', 20 | '037#######', // non-geographic 21 | ), 22 | 'mobile' => array( 23 | '07########', 24 | ) 25 | ); 26 | 27 | protected static $specialFormats = array( 28 | 'toll-free' => array( 29 | '0800######', 30 | '0801######', // shared-cost numbers 31 | '0802######', // personal numbering 32 | '0806######', // virtual cards 33 | '0807######', // pre-paid cards 34 | '0870######', // internet dial-up 35 | ), 36 | 'premium-rate' => array( 37 | '0900######', 38 | '0903######', // financial information 39 | '0906######', // adult entertainment 40 | ) 41 | ); 42 | 43 | /** 44 | * @link http://en.wikipedia.org/wiki/Telephone_numbers_in_Romania#Last_years 45 | */ 46 | public static function phoneNumber() 47 | { 48 | $type = static::randomElement(array_keys(static::$normalFormats)); 49 | $number = static::numerify(static::randomElement(static::$normalFormats[$type])); 50 | 51 | return $number; 52 | } 53 | 54 | public static function tollFreePhoneNumber() 55 | { 56 | $number = static::numerify(static::randomElement(static::$specialFormats['toll-free'])); 57 | 58 | return $number; 59 | } 60 | 61 | public static function premiumRatePhoneNumber() 62 | { 63 | $number = static::numerify(static::randomElement(static::$specialFormats['premium-rate'])); 64 | 65 | return $number; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/ru_RU/Color.php: -------------------------------------------------------------------------------- 1 | generator->parse($format); 36 | } 37 | 38 | public static function companyPrefix() 39 | { 40 | return static::randomElement(static::$companyPrefixes); 41 | } 42 | 43 | public static function companyNameElement() 44 | { 45 | return static::randomElement(static::$companyElements); 46 | } 47 | 48 | public static function companyNameSuffix() 49 | { 50 | return static::randomElement(static::$companyNameSuffixes); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/ru_RU/Internet.php: -------------------------------------------------------------------------------- 1 | format('a') === 'am' ? 'öö' : 'ös'; 10 | } 11 | 12 | public static function dayOfWeek($max = 'now') 13 | { 14 | $map = array( 15 | 'Sunday' => 'Pazar', 16 | 'Monday' => 'Pazartesi', 17 | 'Tuesday' => 'Salı', 18 | 'Wednesday' => 'Çarşamba', 19 | 'Thursday' => 'Perşembe', 20 | 'Friday' => 'Cuma', 21 | 'Saturday' => 'Cumartesi', 22 | ); 23 | $week = static::dateTime($max)->format('l'); 24 | return isset($map[$week]) ? $map[$week] : $week; 25 | } 26 | 27 | public static function monthName($max = 'now') 28 | { 29 | $map = array( 30 | 'January' => 'Ocak', 31 | 'February' => 'Şubat', 32 | 'March' => 'Mart', 33 | 'April' => 'Nisan', 34 | 'May' => 'Mayıs', 35 | 'June' => 'Haziran', 36 | 'July' => 'Temmuz', 37 | 'August' => 'Ağustos', 38 | 'September' => 'Eylül', 39 | 'October' => 'Ekim', 40 | 'November' => 'Kasım', 41 | 'December' => 'Aralık', 42 | ); 43 | $month = static::dateTime($max)->format('F'); 44 | return isset($map[$month]) ? $map[$month] : $month; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/tr_TR/Internet.php: -------------------------------------------------------------------------------- 1 | generator->parse($format); 33 | } 34 | 35 | public static function companyPrefix() 36 | { 37 | return static::randomElement(static::$companyPrefix); 38 | } 39 | 40 | public static function companyName() 41 | { 42 | return static::randomElement(static::$companyName); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/uk_UA/Internet.php: -------------------------------------------------------------------------------- 1 | array( 30 | '0[a] ### ####', 31 | '(0[a]) ### ####', 32 | '0[a]-###-####', 33 | '(0[a])###-####', 34 | '84-[a]-###-####', 35 | '(84)([a])###-####', 36 | '+84-[a]-###-####', 37 | ), 38 | '8' => array( 39 | '0[a] #### ####', 40 | '(0[a]) #### ####', 41 | '0[a]-####-####', 42 | '(0[a])####-####', 43 | '84-[a]-####-####', 44 | '(84)([a])####-####', 45 | '+84-[a]-####-####', 46 | ), 47 | ); 48 | 49 | public static function phoneNumber() 50 | { 51 | $areaCode = static::randomElement(static::$areaCodes); 52 | $areaCodeLength = strlen($areaCode); 53 | $digits = 7; 54 | 55 | if ($areaCodeLength < 2) { 56 | $digits = 8; 57 | } 58 | 59 | return static::numerify(str_replace('[a]', $areaCode, static::randomElement(static::$formats[$digits]))); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/zh_CN/Address.php: -------------------------------------------------------------------------------- 1 | city() . static::area(); 34 | } 35 | 36 | public static function postcode() 37 | { 38 | $prefix = str_pad(mt_rand(1, 85), 2, 0, STR_PAD_LEFT); 39 | $suffix = '00'; 40 | 41 | return $prefix . mt_rand(10, 88) . $suffix; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/zh_CN/Company.php: -------------------------------------------------------------------------------- 1 | format('a') === 'am' ? '上午' : '下午'; 10 | } 11 | 12 | public static function dayOfWeek($max = 'now') 13 | { 14 | $map = array( 15 | 'Sunday' => '星期日', 16 | 'Monday' => '星期一', 17 | 'Tuesday' => '星期二', 18 | 'Wednesday' => '星期三', 19 | 'Thursday' => '星期四', 20 | 'Friday' => '星期五', 21 | 'Saturday' => '星期六', 22 | ); 23 | $week = static::dateTime($max)->format('l'); 24 | return isset($map[$week]) ? $map[$week] : $week; 25 | } 26 | 27 | public static function monthName($max = 'now') 28 | { 29 | $map = array( 30 | 'January' => '一月', 31 | 'February' => '二月', 32 | 'March' => '三月', 33 | 'April' => '四月', 34 | 'May' => '五月', 35 | 'June' => '六月', 36 | 'July' => '七月', 37 | 'August' => '八月', 38 | 'September' => '九月', 39 | 'October' => '十月', 40 | 'November' => '十一月', 41 | 'December' => '十二月', 42 | ); 43 | $month = static::dateTime($max)->format('F'); 44 | return isset($map[$month]) ? $map[$month] : $month; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/zh_TW/Internet.php: -------------------------------------------------------------------------------- 1 | userName(); 10 | } 11 | 12 | public function domainWord() 13 | { 14 | return \Faker\Factory::create('en_US')->domainWord(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/zh_TW/Payment.php: -------------------------------------------------------------------------------- 1 | creditCardDetails($valid); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /admin/lib/Faker/Provider/zh_TW/PhoneNumber.php: -------------------------------------------------------------------------------- 1 | unique() 8 | */ 9 | class UniqueGenerator 10 | { 11 | protected $generator; 12 | protected $maxRetries; 13 | protected $uniques = array(); 14 | 15 | public function __construct(Generator $generator, $maxRetries) 16 | { 17 | $this->generator = $generator; 18 | $this->maxRetries = $maxRetries; 19 | } 20 | 21 | /** 22 | * Catch and proxy all generator calls but return only unique values 23 | */ 24 | public function __get($attribute) 25 | { 26 | return $this->__call($attribute, array()); 27 | } 28 | 29 | /** 30 | * Catch and proxy all generator calls with arguments but return only unique values 31 | */ 32 | public function __call($name, $arguments) 33 | { 34 | if (!isset($this->uniques[$name])) { 35 | $this->uniques[$name] = array(); 36 | } 37 | $i = 0; 38 | do { 39 | $res = call_user_func_array(array($this->generator, $name), $arguments); 40 | $i++; 41 | if ($i > $this->maxRetries) { 42 | throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a unique value', $this->maxRetries)); 43 | } 44 | } while (array_key_exists($res, $this->uniques[$name])); 45 | $this->uniques[$name][$res]= null; 46 | 47 | return $res; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /admin/lib/autoload.php: -------------------------------------------------------------------------------- 1 | info = $info; 31 | 32 | $layout = FILLITUP_DIR.'admin/layouts/'.$this->layout.'.php'; 33 | ob_start(); 34 | include $layout; 35 | $output = ob_get_contents(); 36 | ob_end_clean(); 37 | echo $output; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /admin/views/posts.php: -------------------------------------------------------------------------------- 1 | true, 27 | '_builtin' => false 28 | ); 29 | $custom = get_post_types($args, 'objects'); 30 | 31 | $postTypes = array_merge($native, $custom); 32 | 33 | $layout = FILLITUP_DIR.'admin/layouts/'.$this->layout.'.php'; 34 | ob_start(); 35 | include $layout; 36 | $output = ob_get_contents(); 37 | ob_end_clean(); 38 | echo $output; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /languages/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kodeka/kdk_fill_it_up/d56163fabcc75a7a46958ed7c0d41081229a0900/languages/index.html --------------------------------------------------------------------------------