Skip to content

Commit

Permalink
Removed the custom autoloader
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Jan 5, 2017
1 parent 9deb2f7 commit 25f2c23
Show file tree
Hide file tree
Showing 32 changed files with 42 additions and 194 deletions.
5 changes: 5 additions & 0 deletions composer.json
Expand Up @@ -30,5 +30,10 @@
"psr-4": {
"s9e\\TextFormatter\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"s9e\\TextFormatter\\Tests\\": "tests"
}
}
}
19 changes: 0 additions & 19 deletions docs/Cookbook/00_Getting_started/00_Installation.md
Expand Up @@ -4,14 +4,6 @@ s9e\\TextFormatter is developed on the latest version of PHP and is compatible w

Once installed, you can try this [basic example](https://github.com/s9e/TextFormatter/blob/master/docs/examples/00_quick.php).

### Direct download

Download a snapshot of the library from GitHub directly: [php5.3](https://github.com/s9e/TextFormatter/archive/release/php5.3.zip), [php5.4](https://github.com/s9e/TextFormatter/archive/release/php5.4.zip), [php5.5](https://github.com/s9e/TextFormatter/archive/release/php5.5.zip), [php5.6](https://github.com/s9e/TextFormatter/archive/release/php5.6.zip). Unpack the archive, rename the directory to "TextFormatter" (optional, but it looks nicer) and use the bundled autoloader.

```php
include 'TextFormatter/src/autoloader.php';
```

### Via Composer/[Packagist](https://packagist.org/)

Add the following to your `composer.json`. It will use Composer's autoloader normally.
Expand All @@ -22,14 +14,3 @@ Add the following to your `composer.json`. It will use Composer's autoloader nor
}
}
```

### Via Git

Clone this repository and use the bundled autoloader.

```bash
git clone https://github.com/s9e/TextFormatter.git -b release/php5.3
```
```php
include 'TextFormatter/src/autoloader.php';
```
19 changes: 0 additions & 19 deletions docs/Getting_started/Installation.md
Expand Up @@ -23,22 +23,3 @@ composer require s9e/text-formatter
}
}
```

### Direct download

Download a snapshot of the library from GitHub directly: [php5.3](https://github.com/s9e/TextFormatter/archive/release/php5.3.zip), [php5.4](https://github.com/s9e/TextFormatter/archive/release/php5.4.zip), [php5.5](https://github.com/s9e/TextFormatter/archive/release/php5.5.zip), [php5.6](https://github.com/s9e/TextFormatter/archive/release/php5.6.zip). Unpack the archive, rename the directory to "TextFormatter" (optional, but it looks nicer) and use the bundled autoloader.

```php
include 'TextFormatter/src/autoloader.php';
```

### Via Git

Clone this repository and use the bundled autoloader. Replace `php5.3` with the lowest version of PHP you want to support: `php5.3`, `php5.4`, `php5.5` or `php5.6`. All versions are functionally identical.

```bash
git clone https://github.com/s9e/TextFormatter.git -b release/php5.3
```
```php
include 'TextFormatter/src/autoloader.php';
```
4 changes: 2 additions & 2 deletions docs/examples/00_quick.php
@@ -1,7 +1,7 @@
<?php

// Get the autoloader (unless you have already loaded Composer's)
include __DIR__ . '/../../src/autoloader.php';
// Get the autoloader
include __DIR__ . '/../../vendor/autoload.php';

// Use the Forum bundle. It supports BBCodes, emoticons and autolinking
use s9e\TextFormatter\Bundles\Forum as TextFormatter;
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/01_verbose.php
@@ -1,6 +1,6 @@
<?php

include __DIR__ . '/../../src/autoloader.php';
include __DIR__ . '/../../vendor/autoload.php';

$configurator = new s9e\TextFormatter\Configurator;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/10_verbose_bbcode.php
@@ -1,6 +1,6 @@
<?php

include __DIR__ . '/../../src/autoloader.php';
include __DIR__ . '/../../vendor/autoload.php';

$configurator = new s9e\TextFormatter\Configurator;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/80_benchmark.php
Expand Up @@ -14,7 +14,7 @@
*/

include __DIR__ . '/../../src/autoloader.php';
include __DIR__ . '/../../vendor/autoload.php';

use s9e\TextFormatter\Bundles\Forum as TextFormatter;

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/90_xss.php
@@ -1,6 +1,6 @@
<?php

include __DIR__ . '/../../src/autoloader.php';
include __DIR__ . '/../../vendor/autoload.php';

use s9e\TextFormatter\Bundles\Forum as TextFormatter;

Expand Down
7 changes: 0 additions & 7 deletions docs/testdox.txt
@@ -1,10 +1,3 @@
autoloader
[x] Can load s9e\TextFormatter\Configurator
[x] Can load s9e\TextFormatter\Configurator\\Items\\Tag
[x] Can load s9e\TextFormatter\Parser\Logger
[x] Can load s9e\TextFormatter\Plugins\Emoticons\Parser
[x] Does not attempt to load a class whose name contains dots

s9e\TextFormatter\Tests\Configurator\Collections\Collection
[x] Collection is countable
[x] Collection is iterable with foreach
Expand Down
2 changes: 0 additions & 2 deletions phpunit.xml
Expand Up @@ -22,8 +22,6 @@

<testsuites>
<testsuite name="TextFormatter">
<file>tests/autoloaderTest.php</file>

<!-- Test the base classes and traits first -->
<file>tests/Configurator/Collections/CollectionTest.php</file>
<file>tests/Configurator/Collections/NormalizedCollectionTest.php</file>
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/5.5.convert.php
Expand Up @@ -128,6 +128,6 @@ function convertDir($dir)
}
}

include_once __DIR__ . '/../../src/autoloader.php';
include_once __DIR__ . '/../../vendor/autoload.php';
convertDir(realpath(__DIR__ . '/../../src'));
echo "\n";
2 changes: 1 addition & 1 deletion scripts/build/cacheJavaScriptFunctions.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../../src/autoloader.php';
include __DIR__ . '/../../vendor/autoload.php';

$cache = array();
foreach (glob(realpath(__DIR__ . '/../../src/Configurator/JavaScript/functions') . '/*.js') as $filepath)
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/cacheJavaScriptParsers.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../../src/autoloader.php';
include __DIR__ . '/../../vendor/autoload.php';

$configurator = new s9e\TextFormatter\Configurator;
foreach (glob(realpath(__DIR__ . '/../../src/Plugins') . '/*', GLOB_ONLYDIR) as $dirpath)
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/coalesceConfiguratorFiles.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../../src/autoloader.php';
include __DIR__ . '/../../vendor/autoload.php';
$configurator = new s9e\TextFormatter\Configurator;
$tag = $configurator->tags->add('X');
$tag->attributes->add('x')->filterChain->append('#url');
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateBundles.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

$bundlesDir = __DIR__ . '/../src/Bundles';

Expand Down
2 changes: 1 addition & 1 deletion scripts/generateFatdownDemo.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

$configurator = s9e\TextFormatter\Configurator\Bundles\Fatdown::getConfigurator();
$configurator->enableJavaScript();
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateLiveDemo.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

$configurator = new s9e\TextFormatter\Configurator;
$configurator->enableJavaScript();
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateMediaEmbedTestPage.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

$configurator = new s9e\TextFormatter\Configurator;
$configurator->plugins->load('MediaEmbed', ['captureURLs' => false]);
Expand Down
2 changes: 1 addition & 1 deletion scripts/patchBundledBBCodesCookbook.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

$dom = new DOMDocument;
$dom->load(__DIR__ . '/../src/Plugins/BBCodes/Configurator/repository.xml');
Expand Down
2 changes: 1 addition & 1 deletion scripts/patchCachedSiteDefinitionCollection.php
Expand Up @@ -4,7 +4,7 @@
use s9e\TextFormatter\Configurator\TemplateNormalizer;
use s9e\TextFormatter\Plugins\MediaEmbed\Configurator\Collections\XmlFileDefinitionCollection;

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

function export(array $arr)
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/patchCollectionProxies.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

function getMethodAnnotations($className)
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/patchDocs.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

function patchDir($dirpath)
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/patchExamples.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

function patchDir($dirpath)
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/patchLitedownSyntax.php
Expand Up @@ -27,7 +27,7 @@ function ($m)
}
}

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';
$configurator = new s9e\TextFormatter\Configurator;
$configurator->Litedown;
extract($configurator->finalize());
Expand Down
2 changes: 1 addition & 1 deletion scripts/patchMediaEmbedDoc.php
@@ -1,7 +1,7 @@
#!/usr/bin/php
<?php

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

$html = [];
$html[] = '<table>';
Expand Down
2 changes: 1 addition & 1 deletion scripts/patchRegexpConvertor.php
Expand Up @@ -2,7 +2,7 @@
<?php

use s9e\TextFormatter\Configurator\Helpers\RegexpBuilder;
include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

$filepath = __DIR__ . '/../src/Configurator/JavaScript/RegexpConvertor.php';

Expand Down
2 changes: 1 addition & 1 deletion scripts/patchTemplateHelper.php
Expand Up @@ -4,7 +4,7 @@
use s9e\SimpleDOM\SimpleDOM;
use s9e\TextFormatter\Configurator\Helpers\RegexpBuilder;

include __DIR__ . '/../src/autoloader.php';
include __DIR__ . '/../vendor/autoload.php';

function loadPage($url, $filename = null)
{
Expand Down
11 changes: 9 additions & 2 deletions scripts/travis/installComposer.sh
@@ -1,10 +1,17 @@
#!/bin/bash

cd $(dirname $(dirname $(dirname "$0")))
cd $(dirname "$0")
cd ../..

if [ "$TRAVIS_PHP_VERSION" = '5.3.3' ]
then
composer config disable-tls true
composer config secure-http false
fi

if [ -n "$COVERAGE" ]
then
composer require --no-interaction satooshi/php-coveralls
fi

composer install --no-interaction
composer install --no-interaction --ignore-platform-reqs
4 changes: 2 additions & 2 deletions scripts/travis/setup.sh
Expand Up @@ -24,11 +24,11 @@ echo "Installing Closure Compiler"
# The cache dir lets the MediaEmbed plugin cache scraped content
mkdir ../../tests/.cache

wait

# Prepare the files as for a release branch
../build/prepareFiles.sh

wait

# Start a local webserver for the Http helper's tests
if [ "$TRAVIS_PHP_VERSION" != '5.3.3' ]
then
Expand Down
29 changes: 0 additions & 29 deletions src/autoloader.php

This file was deleted.

0 comments on commit 25f2c23

Please sign in to comment.