-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from sugarcrm/develop
Tidbit bin executable
- Loading branch information
Showing
5 changed files
with
106 additions
and
30 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
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,71 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
/********************************************************************************* | ||
* Tidbit is a data generation tool for the SugarCRM application developed by | ||
* SugarCRM, Inc. Copyright (C) 2004-2016 SugarCRM Inc. | ||
* | ||
* This program is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Affero General Public License version 3 as published by the | ||
* Free Software Foundation with the addition of the following permission added | ||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK | ||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY | ||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License along with | ||
* this program; if not, see http://www.gnu.org/licenses or write to the Free | ||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
* 02110-1301 USA. | ||
* | ||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, | ||
* SW2-130, Cupertino, CA 95014, USA. or at email address [email protected]. | ||
* | ||
* The interactive user interfaces in modified source and object code versions | ||
* of this program must display Appropriate Legal Notices, as required under | ||
* Section 5 of the GNU Affero General Public License version 3. | ||
* | ||
* In accordance with Section 7(b) of the GNU Affero General Public License version 3, | ||
* these Appropriate Legal Notices must retain the display of the "Powered by | ||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for | ||
* technical reasons, the Appropriate Legal Notices must display the words | ||
* "Powered by SugarCRM". | ||
********************************************************************************/ | ||
|
||
/** | ||
* if Tidbit is running independently, the dependencies are in the /vendor | ||
* directory, but if Tidbit is part of a larger composer managed system, the | ||
* dependencies are a couple directories higher. If neither are found, bail | ||
* | ||
* @return boolean | ||
*/ | ||
function checkAutoloader() { | ||
$files = array( | ||
__DIR__ . '/../../../autoload.php', // composer dependency | ||
__DIR__ . '/../vendor/autoload.php', // stand-alone package | ||
); | ||
foreach ($files as $file) { | ||
if (is_file($file)) { | ||
require_once $file; | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
|
||
if (!checkAutoloader()) { | ||
die( | ||
'You need to set up the project dependencies using the following commands:' . PHP_EOL . | ||
'curl -sS https://getcomposer.org/installer | php' . PHP_EOL . | ||
'php composer.phar install' . PHP_EOL | ||
); | ||
} | ||
|
||
define('TIDBIT_CLI_START', true); | ||
|
||
// Start Tidbit | ||
require_once __DIR__ . '/../install_cli.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
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
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
#!/usr/local/bin/php | ||
<?php | ||
|
||
/********************************************************************************* | ||
|