Download the PHP package innoscience/comrade-opml without Composer

On this page you can find all versions of the php package innoscience/comrade-opml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package comrade-opml

ComradeOPML

Comrade need help with OPML, da? We read and write OPML data together no problem. It to spec & simple too, with PHP.

Build Status

Copyright (C) 2014 Brandon Fenning

Requirements

Compatible with PHP 5.3+

Installation

Add innoscience/comrade-opml to the composer.json file:

"require": {
    "innoscience/comrade-opml": "dev-master"
}

After this, run composer update

ComradeOPML is namespaced to Innoscience\ComradeOPML, use this in the top of any files that require it:

use Innoscience\ComradeOPML\ComradeOPML;

Usage

Importing & Reading an OPML File

$document = ComradeOPML::importFile('file.opml');

foreach ($document->getAllCategories() as $category) {

    echo '<h2>'.$category->getText().'</h2>';

    foreach ($category->getAllFeeds() as $feed) {
        echo $feed->getText().' - '.$feed->getXmlUrl().'</br>';
    }
}

Creating & Exporting an OPML File

$document = ComradeOPML::newDocument();

$document->addCategory('News')
    ->addFeed('Awesome News', 'http//awesome.news/rss')
    ->addFeed('Good Times', 'http//good.times/rss')
    ->addFeed('Best News', 'http//best.news/rss');

$document->addFeed('Food', 'Recipe Site', 'http://recipe.site/rss');
$document->addFeed('Food', 'Succulent Soups', 'http://succulent.soups/rss');

echo $document;

// # Or write to a file

ComradeOPML::exportFile($document, __DIR__.'/data/new.opml');

Manipulating OPML Data

$document = ComradeOPML::newDocument();

$document->addCategory('Superfluous')
    ->addFeed('Useless Things', 'http//uselesss.things/rss');

$document->addCategory('News')
    ->addFeed('Horrible News', 'http//horribe.news/rss')
    ->addFeed('Good Times', 'http//good.times/rss');

$document->removeCategory('Superfluous');
$document->getCategory('News')->removeFeed('http//horribe.news/rss');

Classes & Methods

Innoscience\ComradeOPML\ComradeOPML

The ComradeOPML class is just a super-helpful factory class for ComradeOPML components.

Comrade::importString($string) : Import an OPML file in string format, returns a Document

Comrade::importFile($filePath) : Import an OPML file directly, returns a Document

Comrade::newDocument() : Creates a new Document instance. It's also a fancy way to write new \Innoscience\ComradeOPML\Resource\Document;

Comrade::exportFile(Document $document, $filePath) : Exports a Document to an OPML file

Innoscience\ComradeOPML\Resource\Document

The Innoscience\ComradeOPML\Resource\Document class, (we call it Document amongst friends) is where much of the magic happens.

$document->addCategory($category, $title = '') : Add a category, returns the created Category instance. The required $category argument is the text attribute, the $title is the title attribute.

$document->getCategory($category) : Get a category by its text attribute, returns the created Category instance.

$document->getAllCategories() : Get all categories, returns an array of Category instances.

$document->removeCategory() : Remove a category & its feeds by its text attribute. Returns the Document instance.

$document->addFeed($category, $text, $xmlUrl, $title = '', $htmlUrl = '', $type = 'rss') : Adds a feed to the given category. Returns Document instance.

$document->parse($xmlString) : Parses OPML data into the Document instance, appending to the document if it has existing data. Returns the Document instance.

$document->setDomInstance($instance) : Pass an alternative instance of DOMDocument for exporting.

$document->output() : Returns the OPML formatted document.

echo $document : Same as above, returns the OPML formatted document.

Header Property Methods

$document->setTitle($string) : Sets the Document title property in head

$document->getTitle() : Gets the Document title property in head

$document->setDateCreated($string) : Sets the Document dateCreated property in head

$document->getDateCreated() : Gets the Document dateCreated property in head

$document->setDateModified($string) : Sets the Document dateModified property in head

$document->getDateModified() : Gets the Document dateModified property in head

$document->setOwnerName($string) : Sets the Document ownerName property in head

$document->getOwnerName() : Gets the Document ownerName property in head

$document->setOwnerEmail($string) : Sets the Document ownerEmail property in head

$document->setOwnerEmail() : Gets the Document ownerEmail property in head

$document->setExpansionState($string) : Sets the Document expansionState property in head

$document->getExpansionState() : Gets the Document expansionState property in head

$document->setVertScrollState($string) : Sets the Document vertScrollState property in head

$document->getVertScrollState() : Gets the Document vertScrollState property in head

$document->setWindowTop($string) : Sets the Document windowTop property in head

$document->getWindowTop() : Gets the Document windowTop property in head

$document->setWindowLeft($string) : Sets the Document windowLeft property in head

$document->getWindowLeft() : Gets the Document windowLeft property in head

$document->setWindowBottom($string) : Sets the Document windowBottom property in head

$document->getWindowBottom() : Gets the Document windowBottom property in head

$document->setWindowRight($string) : Sets the Document windowRight property in head

$document->getWindowRight() : Gets the Document windowRight property in head

Innoscience\ComradeOPML\Resource\Category

$category->addFeed($text, $xmlUrl, $title = '', $htmlUrl = '', $type = 'rss') : Add a Feed to the Category, returns the Category instance.

$category->getFeed($xmlUrl) : Returns a Feed instance for the given feed.

$category->getAllFeeds() : Returns an array of Feed instances for the given Category

$category->removeFeed($xmlurl) : Removes the given feed from the Category

$category->setText($string) : Sets the Category text property, which is required. Returns the Category instance.

$category->getText() : Gets the Category text property.

$category->setTitle($string) : Sets the Category title property. Returns the Category instance.

$category->getTitle() : Gets the Category title property.

Innoscience\ComradeOPML\Resource\Feed

$feed->getCategory() : Returns the feed's Category text property

$feed->getText() : Returns the Feed text property

$feed->setText($string) : Sets the Feed text property

$feed->getXmlUrl() : Returns the Feed xmlUrl property

$feed->setXmlUrl($string) : Sets the Feed xmlUrl property

$feed->getTitle() : Returns the Feed title property

$feed->setTitle($string) : Sets the Feed title property

$feed->getHtmlUrl() : Returns the Feed htmlUrl property

$feed->setHtmlUrl($string) : Sets the Feed htmlUrl property

$feed->getType() : Returns the Feed type property

$feed->setType($string) : Sets the Feed type property

Tests

ComradeOPML is fully unit tested. Tests are located in the tests directory of the ComradeOPML package and can be run with phpunit in the package's base directory.

License

ComradeOPML is licensed under GPLv2


All versions of comrade-opml with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package innoscience/comrade-opml contains the following files

Loading the files please wait ....