Skip to content

Commit 0405d5e

Browse files
committed
Merge branch 'release/v0.0.4'
2 parents d8930db + 7aca402 commit 0405d5e

19 files changed

+746
-193
lines changed

Assets/stop-words.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[
2+
"about","after","all","also","am","an","and","another","any","are","as","at","be",
3+
"because","been","before","being","between","both","but","by","came","can",
4+
"come","could","did","do","each","for","from","get","got","has","had",
5+
"he","have","her","here","him","himself","his","how","if","in","into",
6+
"is","it","like","make","many","me","might","more","most","much","must",
7+
"my","never","now","of","on","only","or","other","our","out","over",
8+
"said","same","see","should","since","some","still","such","take","than",
9+
"that","the","their","them","then","there","these","they","this","those",
10+
"through","to","too","under","up","very","was","way","we","well","were",
11+
"what","where","which","while","who","with","would","you","your","a","i",
12+
"2g1c", "2girls1cup", "acrotomophilia", "anal", "anilingus", "anus", "arsehole", "ass",
13+
"asshole","assmunch","autoerotic","autoerotic","babeland","babybatter","ballgag","ballgravy",
14+
"ballkicking","balllicking","ballsack","ballsucking","bangbros","bareback","barelylegal",
15+
"barenaked","bastardo","bastinado","bbw","bdsm","beavercleaver","beaverlips","bestiality",
16+
"bicurious","bigblack","bigbreasts","bigknockers","bigtits","bimbos","birdlock","bitch",
17+
"blackcock","blondeaction","blondeonblondeaction","blowj","blowyourl","bluewaffle","blumpkin",
18+
"bollocks","bondage","boner","boob","boobs","bootycall","brownshowers","brunetteaction",
19+
"bukkake","bulldyke","bulletvibe","bunghole","bunghole","busty","butt","buttcheeks","butthole",
20+
"cameltoe","camgirl","camslut","camwhore","carpetmuncher","carpetmuncher","chocolaterosebuds",
21+
"circlejerk","clevelandsteamer","clit","clitoris","cloverclamps","clusterfuck","cock","cocks",
22+
"coprolagnia","coprophilia","cornhole","cum","cumming","cunnilingus","cunt","darkie","daterape",
23+
"daterape","deepthroat","deepthroat","dick","dildo","dirtypillows","dirtysanchez","dogstyle",
24+
"doggiestyle","doggiestyle","doggystyle","doggystyle","dolcett","domination","dominatrix",
25+
"dommes","donkeypunch","doubledong","doublepenetration","dpaction","eatmyass","ecchi",
26+
"ejaculation","erotic","erotism","escort","ethicalslut","eunuch","faggot","fecal",
27+
"felch","fellatio","feltch","femalesquirting","femdom","figging","fingering",
28+
"fisting","footfetish","footjob","frotting","fuck","fucking","fuckbuttons",
29+
"fudgepacker","fudgepacker","futanari","g-spot","gangbang","gaysex","genitals",
30+
"giantcock","girlon","girlontop","girlsgonewild","goatcx","goatse","gokkun",
31+
"goldenshower","googirl","goodpoop","goregasm","grope","groupsex","guro","handjob",
32+
"handjob","hardcore","hardcore","hentai","homoerotic","honkey","hooker","hotchick",
33+
"howtokill","howtomurder","hugefat","humping","incest","intercourse","jackoff","jailbait",
34+
"jailbait","jerkoff","jigaboo","jiggaboo","jiggerboo","jizz","juggs","kike","kinbaku",
35+
"kinkster","kinky","knobbing","leatherrestraint","leatherstraightjacket","lemonparty",
36+
"lolita","lovemaking","makemecome","malesquirting","masturbate","menageatrois","milf",
37+
"missionaryposition","motherfucker","moundofvenus","mrhands","muffdiver","muffdiving",
38+
"nambla","nawashi","negro","neonazi","nignog","nigga","nigger","nimphomania","nipple",
39+
"nipples","nsfwimages","nude","nudity","nympho","nymphomania","octopussy","omorashi",
40+
"onecuptwogirls","oneguyonejar","orgasm","orgy","paedophile","panties","panty","pedobear",
41+
"pedophile","pegging","penis","phonesex","pieceofshit","pisspig","pissing","pisspig",
42+
"playboy","pleasurechest","polesmoker","ponyplay","poof","poopchute","poopchute","porn",
43+
"porno","pornography","princealbertpiercing","pthc","pubes","pussy","queaf","raghead",
44+
"ragingboner","rape","raping","rapist","rectum","reversecowgirl","rimjob","rimming","rosypalm",
45+
"rosypalmandher5sisters","rustytrombone","s&m","sadism","scat","schlong","scissoring","semen",
46+
"sex","sexo","sexy","shavedbeaver","shavedpussy","shemale","shibari","shit","shota","shrimping",
47+
"slanteye","slut","smut","snatch","snowballing","sodomize","sodomy","spic","spooge",
48+
"spreadlegs","strapon","strapon","strappado","stripclub","styledoggy","suck","sucks",
49+
"suicidegirls","sultrywomen","swastika","swinger","taintedlove","tastemy","teabagging",
50+
"threesome","throating","tiedup","tightwhite","tit","tits","titties","titty","tongueina",
51+
"topless","tosser","towelhead","tranny","tribadism","tubgirl","tubgirl","tushy","twat",
52+
"twink","twinkie","twogirlsonecup","undressing","upskirt","urethraplay","urophilia",
53+
"vagina","venusmound","vibrator","violetblue","violetwand","vorarephilia","voyeur","vulva",
54+
"wank","wetdream","wetback","whitepower","womenrapping","wrappingmen","wrinkledstarfish",
55+
"xx","xxx","yaoi","yellowshowers","yiffy","zoophilia"
56+
]

Facades/VaahArtisan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php namespace WebReinvent\VaahLaravel\Facades;
1+
<?php namespace WebReinvent\VaahExtend\Facades;
22

33

44
use Illuminate\Support\Facades\Facade;

Facades/VaahAssets.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php namespace WebReinvent\VaahExtend\Facades;
2+
3+
4+
use Illuminate\Support\Facades\Facade;
5+
6+
class VaahAssets extends Facade {
7+
protected static function getFacadeAccessor() {
8+
return 'vaahassets';
9+
}
10+
}

Facades/VaahCountry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php namespace WebReinvent\VaahLaravel\Facades;
1+
<?php namespace WebReinvent\VaahExtend\Facades;
22

33

44
use Illuminate\Support\Facades\Facade;

Facades/VaahFile.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php namespace WebReinvent\VaahExtend\Facades;
2+
3+
4+
use Illuminate\Support\Facades\Facade;
5+
6+
class VaahFile extends Facade {
7+
protected static function getFacadeAccessor() {
8+
return 'vaahfile';
9+
}
10+
}

Facades/VaahMail.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php namespace WebReinvent\VaahExtend\Facades;
2+
3+
4+
use Illuminate\Support\Facades\Facade;
5+
6+
class VaahMail extends Facade {
7+
protected static function getFacadeAccessor() {
8+
return 'vaahmail';
9+
}
10+
}

Facades/VaahModule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php namespace WebReinvent\VaahLaravel\Facades;
1+
<?php namespace WebReinvent\VaahExtend\Facades;
22

33

44
use Illuminate\Support\Facades\Facade;

Facades/VaahUrl.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php namespace WebReinvent\VaahExtend\Facades;
2+
3+
4+
use Illuminate\Support\Facades\Facade;
5+
6+
class VaahUrl extends Facade {
7+
protected static function getFacadeAccessor() {
8+
return 'vaahurl';
9+
}
10+
}

Libraries/VaahArtisan.php

Lines changed: 109 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
<?php namespace WebReinvent\VaahLaravel\Libraries;
1+
<?php namespace WebReinvent\VaahExtend\Libraries;
22

33

44
class VaahArtisan{
55

6-
public $params;
6+
static $params;
7+
static $command;
78

8-
public function __construct()
9+
10+
//-------------------------------------------------
11+
public static function setParams()
912
{
10-
$this->params['--force'] = true;
11-
$this->params['--quiet'] = true;
13+
self::$params = [];
14+
self::$params['--force'] = true;
15+
self::$params['--quiet'] = true;
1216
}
13-
1417
//-------------------------------------------------
15-
public function validateMigrateCommand($command)
18+
public static function validateMigrateCommands($command)
1619
{
1720
//acceptable commands
1821
$commands = [
@@ -23,11 +26,7 @@ public function validateMigrateCommand($command)
2326
"migrate:reset",
2427
"migrate:rollback",
2528
"migrate:status",
26-
"db:seed",
27-
"db:wipe",
2829
];
29-
30-
3130
if(!in_array($command, $commands))
3231
{
3332
$response['status'] = 'failed';
@@ -37,62 +36,61 @@ public function validateMigrateCommand($command)
3736
$response['hint']['acceptable_commands'] = $commands;
3837
}
3938
return $response;
40-
4139
}
42-
4340
$response['status'] = 'success';
4441
$response['data'][] = '';
4542
return $response;
4643
}
4744
//-------------------------------------------------
48-
public function migrate($command, $db_connection_name=null, $path=null )
45+
public static function artisan()
4946
{
50-
51-
$is_valid = $this->validateMigrateCommand($command);
52-
47+
try{
48+
\Artisan::call(self::$command, self::$params);
49+
$response['status'] = 'success';
50+
$response['data'] = [];
51+
$response['messages'][] = 'Migrate command "'.self::$command.'" successfully executed';
52+
}catch(\Exception $e)
53+
{
54+
$response['status'] = 'failed';
55+
$response['errors'][] = $e->getMessage();
56+
}
57+
return $response;
58+
}
59+
//-------------------------------------------------
60+
public static function migrate($command='migrate', $path=null, $db_connection_name=null )
61+
{
62+
self::setParams();
63+
$is_valid = self::validateMigrateCommands($command);
5364
if($is_valid['status'] == 'failed')
5465
{
5566
return $is_valid;
5667
}
57-
5868
if($path)
5969
{
60-
$this->params['--path'] = $path;
70+
self::$params['--path'] = $path;
6171
}
62-
6372
if($path)
6473
{
65-
$this->params['--database'] = $db_connection_name;
74+
self::$params['--database'] = $db_connection_name;
6675
}
6776

68-
$response = [
69-
'status' => 'success'
70-
];
71-
72-
try{
73-
\Artisan::call($command, $this->params);
74-
$response['status'] = 'success';
75-
$response['data'] = [];
76-
$response['messages'][] = 'Migrate command "'.$command.'" successfully executed';
77-
78-
}catch(\Exception $e)
79-
{
80-
$response['status'] = 'failed';
81-
$response['errors'][] = $e->getMessage();
82-
}
83-
return $response;
77+
self::$command = $command;
8478

79+
return self::artisan();
8580
}
8681
//-------------------------------------------------
87-
public function validateSeedCommand($command)
82+
public static function migrationReset($path=null, $db_connection_name=null)
83+
{
84+
return self::migrate('migrate:reset', $db_connection_name, $path);
85+
}
86+
//-------------------------------------------------
87+
public static function validateSeedCommand($command)
8888
{
8989
//acceptable commands
9090
$commands = [
9191
"db:seed",
9292
"db:wipe",
9393
];
94-
95-
9694
if(!in_array($command, $commands))
9795
{
9896
$response['status'] = 'failed';
@@ -102,51 +100,106 @@ public function validateSeedCommand($command)
102100
$response['hint']['acceptable_commands'] = $commands;
103101
}
104102
return $response;
105-
106103
}
107-
108104
$response['status'] = 'success';
109105
$response['data'][] = '';
110106
return $response;
111107
}
112108
//-------------------------------------------------
113-
public function seed($command, $db_connection_name=null, $class=null)
109+
public static function seed($command='db:seed', $class=null, $db_connection_name=null )
114110
{
115-
$is_valid = $this->validateSeedCommand($command);
116-
111+
self::setParams();
112+
$is_valid = self::validateSeedCommand($command);
117113
if($is_valid['status'] == 'failed')
118114
{
119115
return $is_valid;
120116
}
121-
122117
if($class)
123118
{
124-
$this->params['--class'] = $class;
119+
self::$params['--class'] = $class;
125120
}
126-
127121
if($db_connection_name)
128122
{
129-
$this->params['--database'] = $db_connection_name;
123+
self::$params['--database'] = $db_connection_name;
130124
}
125+
self::$command = $command;
131126

132-
$response = [
133-
'status' => 'success'
134-
];
127+
return self::artisan();
128+
}
129+
//-------------------------------------------------
130+
public static function publish($provider=null, $tag=null)
131+
{
132+
self::setParams();
133+
if($provider)
134+
{
135+
self::$params['--provider'] = $provider;
136+
}
137+
138+
if($tag)
139+
{
140+
self::$params['--tag'] = $tag;
141+
}
142+
143+
self::$command = 'vendor:publish';
144+
return self::artisan();
145+
}
146+
//-------------------------------------------------
147+
public static function publishMigrations($provider)
148+
{
149+
self::setParams();
150+
self::$params['--provider'] = $provider;
151+
self::$params['--tag'] = 'migrations';
152+
self::$command = 'vendor:publish';
153+
return self::artisan();
154+
}
155+
//-------------------------------------------------
156+
public static function publishSeeds($provider)
157+
{
158+
self::setParams();
159+
self::$params['--provider'] = $provider;
160+
self::$params['--tag'] = 'seeds';
161+
self::$command = 'vendor:publish';
162+
return self::artisan();
163+
}
164+
//-------------------------------------------------
165+
public static function publishAssets($provider)
166+
{
167+
self::setParams();
168+
self::$params['--provider'] = $provider;
169+
self::$params['--tag'] = 'assets';
170+
self::$command = 'vendor:publish';
171+
return self::artisan();
172+
}
173+
//-------------------------------------------------
174+
public static function clearCache()
175+
{
135176

136177
try{
137-
\Artisan::call($command, $this->params);
178+
\Artisan::call('optimize:clear', self::$params);
179+
\Artisan::call('cache:clear', self::$params);
180+
\Artisan::call('route:clear', self::$params);
181+
\Artisan::call('config:clear', self::$params);
182+
\Artisan::call('view:clear', self::$params);
183+
\Artisan::call('clear-compiled', self::$params);
184+
138185
$response['status'] = 'success';
139186
$response['data'] = [];
140-
$response['messages'][] = 'Database has been seeded successfully';
141-
142187
}catch(\Exception $e)
143188
{
144189
$response['status'] = 'failed';
145190
$response['errors'][] = $e->getMessage();
146191
}
147-
return $response;
148192

193+
return $response;
149194
}
150195
//-------------------------------------------------
196+
public static function optimize()
197+
{
198+
self::setParams();
199+
self::$command = 'optimize';
200+
return self::artisan();
201+
}
202+
//-------------------------------------------------
203+
//-------------------------------------------------
151204

152205
}

Libraries/VaahAssets.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php namespace WebReinvent\VaahExtend\Libraries;
2+
3+
4+
class VaahAssets{
5+
6+
//-------------------------------------------------
7+
public function getStopWords()
8+
{
9+
return json_decode(file_get_contents(__DIR__.'/../Assets/stop-words.json'), true);
10+
}
11+
//-------------------------------------------------
12+
public function hasStopWord($word)
13+
{
14+
$list = $this->getStopWords();
15+
if(in_array($word, $list))
16+
{
17+
return true;
18+
}
19+
return false;
20+
}
21+
//-------------------------------------------------
22+
23+
}

0 commit comments

Comments
 (0)