-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Showing
95 changed files
with
2,263 additions
and
424 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 |
---|---|---|
|
@@ -3,3 +3,4 @@ build | |
composer.lock | ||
vendor/ | ||
.env | ||
data/database.sqlite |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
use Shlinkio\Shlink\CLI\Command\Install\InstallCommand; | ||
use Symfony\Component\Console\Application; | ||
use Zend\Config\Writer\PhpArray; | ||
|
||
chdir(dirname(__DIR__)); | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$app = new Application(); | ||
$app->add(new InstallCommand(new PhpArray())); | ||
$app->setDefaultCommand('shlink:install'); | ||
$app->run(); |
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 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
use Shlinkio\Shlink\CLI\Command\Install\UpdateCommand; | ||
use Symfony\Component\Console\Application; | ||
use Zend\Config\Writer\PhpArray; | ||
|
||
chdir(dirname(__DIR__)); | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$app = new Application(); | ||
$app->add(new UpdateCommand(new PhpArray())); | ||
$app->setDefaultCommand('shlink:install'); | ||
$app->run(); |
Binary file not shown.
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,44 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Usage:" >&2 | ||
echo " $0 {version}" >&2 | ||
exit 1 | ||
fi | ||
|
||
version=$1 | ||
builtcontent=$(readlink -f '../shlink_build_tmp') | ||
projectdir=$(pwd) | ||
|
||
# Copy project content to temp dir | ||
echo 'Copying project files...' | ||
rm -rf "${builtcontent}" | ||
mkdir "${builtcontent}" | ||
cp -R "${projectdir}"/* "${builtcontent}" | ||
cd "${builtcontent}" | ||
|
||
# Install dependencies | ||
rm -r vendor | ||
rm composer.lock | ||
composer self-update | ||
composer install --no-dev --optimize-autoloader | ||
|
||
# Delete development files | ||
echo 'Deleting dev files...' | ||
rm build.sh | ||
rm CHANGELOG.md | ||
rm composer.* | ||
rm LICENSE | ||
rm php* | ||
rm README.md | ||
rm -r build | ||
rm -f data/database.sqlite | ||
rm -rf data/{cache,log,proxies}/{*,.gitignore} | ||
rm -rf config/params/{*,.gitignore} | ||
rm -rf config/autoload/{{,*.}local.php{,.dist},.gitignore} | ||
|
||
# Compressing file | ||
rm -f "${projectdir}"/build/shlink_${version}_dist.zip | ||
zip -r "${projectdir}"/build/shlink_${version}_dist.zip . | ||
rm -rf "${builtcontent}" |
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
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,11 @@ | ||
<?php | ||
return [ | ||
|
||
'phpwkhtmltopdf' => [ | ||
'images' => [ | ||
'binary' => 'bin/wkhtmltoimage', | ||
'type' => 'jpg', | ||
], | ||
], | ||
|
||
]; |
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,8 @@ | ||
<?php | ||
return [ | ||
|
||
'preview_generation' => [ | ||
'files_location' => 'data/cache', | ||
], | ||
|
||
]; |
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,2 @@ | ||
* | ||
!.gitignore |
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,39 @@ | ||
<?php | ||
|
||
namespace ShlinkMigrations; | ||
|
||
use Doctrine\DBAL\Migrations\AbstractMigration; | ||
use Doctrine\DBAL\Schema\Schema; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
class Version20160819142757 extends AbstractMigration | ||
{ | ||
const MYSQL = 'mysql'; | ||
const SQLITE = 'sqlite'; | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
$db = $this->connection->getDatabasePlatform()->getName(); | ||
$table = $schema->getTable('short_urls'); | ||
$column = $table->getColumn('short_code'); | ||
|
||
if ($db === self::MYSQL) { | ||
$column->setPlatformOption('collation', 'utf8_bin'); | ||
} elseif ($db === self::SQLITE) { | ||
$column->setPlatformOption('collate', 'BINARY'); | ||
} | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
$db = $this->connection->getDatabasePlatform()->getName(); | ||
} | ||
} |
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,80 @@ | ||
<?php | ||
|
||
namespace ShlinkMigrations; | ||
|
||
use Doctrine\DBAL\Migrations\AbstractMigration; | ||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\DBAL\Types\Type; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
class Version20160820191203 extends AbstractMigration | ||
{ | ||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
// Check if the tables already exist | ||
$tables = $schema->getTables(); | ||
foreach ($tables as $table) { | ||
if ($table->getName() === 'tags') { | ||
return; | ||
} | ||
} | ||
|
||
$this->createTagsTable($schema); | ||
$this->createShortUrlsInTagsTable($schema); | ||
} | ||
|
||
protected function createTagsTable(Schema $schema) | ||
{ | ||
$table = $schema->createTable('tags'); | ||
$table->addColumn('id', Type::BIGINT, [ | ||
'unsigned' => true, | ||
'autoincrement' => true, | ||
'notnull' => true, | ||
]); | ||
$table->addColumn('name', Type::STRING, [ | ||
'length' => 255, | ||
'notnull' => true, | ||
]); | ||
$table->addUniqueIndex(['name']); | ||
|
||
$table->setPrimaryKey(['id']); | ||
} | ||
|
||
protected function createShortUrlsInTagsTable(Schema $schema) | ||
{ | ||
$table = $schema->createTable('short_urls_in_tags'); | ||
$table->addColumn('short_url_id', Type::BIGINT, [ | ||
'unsigned' => true, | ||
'notnull' => true, | ||
]); | ||
$table->addColumn('tag_id', Type::BIGINT, [ | ||
'unsigned' => true, | ||
'notnull' => true, | ||
]); | ||
|
||
$table->addForeignKeyConstraint('tags', ['tag_id'], ['id'], [ | ||
'onDelete' => 'CASCADE', | ||
'onUpdate' => 'RESTRICT', | ||
]); | ||
$table->addForeignKeyConstraint('short_urls', ['short_url_id'], ['id'], [ | ||
'onDelete' => 'CASCADE', | ||
'onUpdate' => 'RESTRICT', | ||
]); | ||
|
||
$table->setPrimaryKey(['short_url_id', 'tag_id']); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
$schema->dropTable('short_urls_in_tags'); | ||
$schema->dropTable('tags'); | ||
} | ||
} |
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,4 @@ | ||
name: ShlinkMigrations | ||
migrations_namespace: ShlinkMigrations | ||
table_name: migrations | ||
migrations_directory: data/migrations |
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
Binary file not shown.
Oops, something went wrong.