-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c16a711
Showing
230 changed files
with
263,299 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto | ||
*.css linguist-vendored | ||
*.scss linguist-vendored | ||
*.js linguist-vendored | ||
CHANGELOG.md export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/node_modules | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
/.idea | ||
/.vscode | ||
/.vagrant | ||
Homestead.json | ||
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log | ||
.env |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
namespace ProcessMaker; | ||
|
||
use Igaster\LaravelTheme\Facades\Theme; | ||
use Illuminate\Foundation\Application as IlluminateApplication; | ||
use Illuminate\Support\Facades\Auth; | ||
|
||
/** | ||
* Class Application | ||
* @package ProcessMaker | ||
* | ||
* This represents our top level processmaker application. | ||
*/ | ||
class Application extends IlluminateApplication | ||
{ | ||
// Our ProcessMaker Version | ||
const VERSION = '4.0.0'; | ||
|
||
protected $namespace = 'ProcessMaker'; | ||
|
||
/** | ||
* Sets the timezone for the application and for php with the specified timezone | ||
* @param $tz string The timezone to set to | ||
*/ | ||
public function setTimezone($tz) | ||
{ | ||
config(['app.timezone' => $tz]); | ||
date_default_timezone_set(config('app.timezone')); | ||
} | ||
|
||
/** | ||
* Retrieves the currently set timezone | ||
* @return string The timezone for the system | ||
*/ | ||
public function getTimezone() | ||
{ | ||
return config('app.timezone'); | ||
} | ||
|
||
/** | ||
* Return the System defined constants and Application variables | ||
* Constants: SYS_* | ||
* Sessions : USER_* , URS_* | ||
* | ||
* @note: This is ported from Gulliver System. This will most likely need to be refactored/removed | ||
* @return array Contents of system contents. | ||
*/ | ||
public function getSystemConstants() | ||
{ | ||
$sysCon = []; | ||
$sysCon['SYS_LANG'] = $this->getLocale(); | ||
|
||
// Get the current theme | ||
$sysCon['SYS_SKIN'] = Theme::get(); | ||
|
||
// The following items should be refactored to no longer use $_SESSION | ||
// Since these items should be request scope specific and not session specific | ||
$sysCon["APPLICATION"] = (isset($_SESSION["APPLICATION"]))? $_SESSION["APPLICATION"] : ""; | ||
$sysCon["PROCESS"] = (isset($_SESSION["PROCESS"]))? $_SESSION["PROCESS"] : ""; | ||
$sysCon["TASK"] = (isset($_SESSION["TASK"]))? $_SESSION["TASK"] : ""; | ||
$sysCon["INDEX"] = (isset($_SESSION["INDEX"]))? $_SESSION["INDEX"] : ""; | ||
$sysCon['USER_LOGGED'] = Auth::user() ? Auth::user()->USR_UID : ''; | ||
$sysCon['USER_USERNAME'] = Auth::user() ? Auth::user()->USR_USERNAME : ''; | ||
|
||
return $sysCon; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
namespace ProcessMaker\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* The Artisan commands provided by your application. | ||
* | ||
* @var array | ||
*/ | ||
protected $commands = [ | ||
// @todo Add our ProcessMaker specific commands to this list | ||
]; | ||
|
||
/** | ||
* Define the application's command schedule. | ||
* | ||
* @param \Illuminate\Console\Scheduling\Schedule $schedule | ||
* @return void | ||
*/ | ||
protected function schedule(Schedule $schedule) | ||
{ | ||
/** | ||
* Currently no scheduled tasks exists, however once scheduled cron tasks are required, they should | ||
* be placed here. | ||
*/ | ||
} | ||
|
||
/** | ||
* Register the Closure based commands for the application. | ||
* | ||
* @return void | ||
*/ | ||
protected function commands() | ||
{ | ||
$this->load(__DIR__.'/Commands'); | ||
require base_path('routes/console.php'); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
ProcessMaker/Exception/DatabaseConnectionFailedException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace ProcessMaker\Exception; | ||
|
||
use Exception; | ||
|
||
/** | ||
* Thrown if the connection fails | ||
* | ||
* @package ProcessMaker\Exceptions | ||
*/ | ||
|
||
class DatabaseConnectionFailedException extends Exception | ||
{ | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
ProcessMaker/Exception/DatabaseConnectionTypeNotSupportedException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace ProcessMaker\Exception; | ||
|
||
use Exception; | ||
|
||
/** | ||
* Exception thrown when a connection to a not supported driver (mysql, oracle, etc.) is tried. | ||
* | ||
* @package ProcessMaker\Exceptions | ||
*/ | ||
class DatabaseConnectionTypeNotSupportedException extends Exception | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace ProcessMaker\Exception; | ||
|
||
use Exception; | ||
|
||
/** | ||
* Description of InvalidFileManagerExtension | ||
* | ||
*/ | ||
class FileManagerExtensionException extends Exception | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace ProcessMaker\Exception; | ||
|
||
use Exception; | ||
|
||
/** | ||
* Description of FileManagerFileExistsException | ||
* | ||
*/ | ||
class FileManagerFileExistsException extends Exception | ||
{ | ||
//put your code here | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace ProcessMaker\Exception; | ||
|
||
use Exception; | ||
use Throwable; | ||
|
||
/** | ||
* Invalid File Manager path exception. | ||
* | ||
*/ | ||
class FileManagerPathException extends Exception | ||
{ | ||
|
||
public function __construct($code = 0, Throwable $previous = null) | ||
{ | ||
$message = G::LoadTranslation("ID_INVALID_PRF_PATH"); | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
ProcessMaker/Exception/FileManagerRemoveEmailTemplateException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace ProcessMaker\Exception; | ||
|
||
use Exception; | ||
|
||
/** | ||
* Description of FileManagerRemoveEmailTemplateException | ||
* | ||
*/ | ||
class FileManagerRemoveEmailTemplateException extends Exception | ||
{ | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
ProcessMaker/Exception/FileManagerUnableToEditException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace ProcessMaker\Exception; | ||
|
||
use Exception; | ||
|
||
/** | ||
* Description of FileManagerUnableToEditException | ||
* | ||
*/ | ||
class FileManagerUnableToEditException extends Exception | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
namespace ProcessMaker\Exception; | ||
|
||
use Exception; | ||
use Illuminate\Auth\AuthenticationException; | ||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||
use Illuminate\Support\Facades\App; | ||
|
||
/** | ||
* Our general exception handler | ||
* @package ProcessMaker\Exception | ||
*/ | ||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* A list of the exception types that should not be reported. | ||
* | ||
* @var array | ||
*/ | ||
protected $dontReport = [ | ||
\Illuminate\Auth\AuthenticationException::class, | ||
\Illuminate\Auth\Access\AuthorizationException::class, | ||
\Symfony\Component\HttpKernel\Exception\HttpException::class, | ||
\Illuminate\Database\Eloquent\ModelNotFoundException::class, | ||
\Illuminate\Session\TokenMismatchException::class, | ||
\Illuminate\Validation\ValidationException::class, | ||
]; | ||
|
||
|
||
/** | ||
* Report our exception. If in testing with verbosity, it will also dump exception information to the console | ||
* @param Exception $exception | ||
* @throws Exception | ||
*/ | ||
public function report(Exception $exception) | ||
{ | ||
if (App::environment() == 'testing' && env('TESTING_VERBOSE')) { | ||
// If we're verbose, we should print ALL Exceptions to the screen | ||
print($exception->getMessage() . "\n"); | ||
print($exception->getFile() . ": Line: " . $exception->getLine() . "\n"); | ||
print($exception); | ||
} | ||
parent::report($exception); | ||
} | ||
|
||
/** | ||
* Render an exception into an HTTP response. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Exception $exception | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function render($request, Exception $exception) | ||
{ | ||
return parent::render($request, $exception); | ||
} | ||
|
||
/** | ||
* Convert an authentication exception into an unauthenticated response. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Illuminate\Auth\AuthenticationException $exception | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
protected function unauthenticated($request, AuthenticationException $exception) | ||
{ | ||
if ($request->expectsJson()) { | ||
return response()->json(['error' => 'Unauthenticated.'], 401); | ||
} | ||
return redirect()->guest('login'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace ProcessMaker\Exception; | ||
|
||
use Illuminate\Validation\ValidationException as ValidationExceptionBase; | ||
use Illuminate\Validation\Validator; | ||
|
||
/** | ||
* Description of ValidationException | ||
* | ||
*/ | ||
class ValidationException extends ValidationExceptionBase | ||
{ | ||
const ERROR_CODE = 422; | ||
|
||
public function __construct(Validator $validator) | ||
{ | ||
$errors = $validator->errors()->getMessages(); | ||
foreach ($errors as $key => $messages) { | ||
$message = $messages[0]; | ||
break; | ||
} | ||
$error = [ | ||
'error' => [ | ||
'code' => 422, | ||
'message' => $message, | ||
], | ||
'errors' => $errors | ||
]; | ||
$response = response()->json($error, static::ERROR_CODE); | ||
parent::__construct($validator, $response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
namespace ProcessMaker\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* Facade for our Database Manager | ||
* @package ProcessMaker\Facades | ||
* @see \ProcessMaker\Managers\DatabaseManager | ||
*/ | ||
class DatabaseManager extends Facade | ||
{ | ||
/** | ||
* Get the registered name of the component. | ||
* | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return 'database.manager'; | ||
} | ||
} |
Oops, something went wrong.