PHP Classes

Importer: Load classes, images, CSS and JavaScript

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 95 All time: 9,869 This week: 47Up
Version License PHP version Categories
importer 1.1.5Artistic License5HTML, PHP 5, Language
Description 

Author

This package can be used to load classes, images, CSS and JavaScript.

It provides an autoloader that can load classes either from local directories or remote servers passing a given base URL to load classes files.

The package can also load JavaScript, CSS and images from a local directory or a remote server to be used in the current Web page.

Versions of this package for JavaScript and Python are also provided.

Picture of Nikos M.
Name: Nikos M. is available for providing paid consulting. Contact Nikos M. .
Classes: 18 packages by
Country: Greece Greece
Age: 48
All time rank: 8459 in Greece Greece
Week rank: 227 Up2 in Greece Greece Up
Innovation award
Innovation award
Nominee: 7x

Winner: 2x

Example

<?php
require( '../src/php/Importer.php' );

echo(
'Importer.VERSION = ' . Importer::VERSION . PHP_EOL);

echo(
'Importer.BASE = ' . Importer::$BASE . PHP_EOL);

function
console_log()
{
   
$args = func_get_args();
    echo (
'Callback'.PHP_EOL);
   
print_r($args);
}

$importer = Importer::_( dirname(__FILE__), 'http://_mygit/Importer/test/' )
    ->
register('classes', array(

     array(
'Test1', 'Test1', './classes/Test1.php')

    )
/*global ctx*/)
    ->
register('classes', array(

    array(
'Test2', 'Test2', './classes/Test2.php', array('Test1'))

    ),
'my-ctx')
    ->
register('assets', array(

     array(
'styles', 'asset1', './assets/asset1.css')
    ,array(
'styles', 'asset2', './assets/asset2.css', array('asset1'))

    )
/*global ctx*/)
    ->
register('assets', array(

    array(
'styles', 'asset3', array('/* asset 3 */'), array('asset1','asset2'))

    ),
'my-ctx')
    ->
on('import-class-Test2', 'console_log', 'my-ctx')
;


$importer->load('Test2', 'my-ctx');

echo
$importer->get('./classes/Test1.php') . PHP_EOL;
$importer->enqueue('styles', 'asset3', 'my-ctx');
echo(
$importer->assets('styles', 'my-ctx'));


Details

Importer

Importer, a simple &amp; flexible loader manager for namespaces (psr-4, psr-0), classes &amp; assets with dependencies for PHP, Python, Javascript

Importer

see also:

  • ModelView a simple, fast, powerful and flexible MVVM framework for JavaScript
  • tico a tiny, super-simple MVC framework for PHP
  • LoginManager a simple, barebones agnostic login manager for PHP, JavaScript, Python
  • SimpleCaptcha a simple, image-based, mathematical captcha with increasing levels of difficulty for PHP, JavaScript, Python
  • Dromeo a flexible, and powerful agnostic router for PHP, JavaScript, Python
  • PublishSubscribe a simple and flexible publish-subscribe pattern implementation for PHP, JavaScript, Python
  • Importer simple class &amp; dependency manager and loader for PHP, JavaScript, Python
  • Contemplate a fast and versatile isomorphic template engine for PHP, JavaScript, Python
  • HtmlWidget html widgets, made as simple as possible, both client and server, both desktop and mobile, can be used as (template) plugins and/or standalone for PHP, JavaScript, Python (can be used as plugins for Contemplate)
  • Paginator simple and flexible pagination controls generator for PHP, JavaScript, Python
  • Formal a simple and versatile (Form) Data validation framework based on Rules for PHP, JavaScript, Python
  • Dialect a cross-vendor &amp; cross-platform SQL Query Builder, based on GrammarTemplate, for PHP, JavaScript, Python
  • DialectORM an Object-Relational-Mapper (ORM) and Object-Document-Mapper (ODM), based on Dialect, for PHP, JavaScript, Python
  • Unicache a simple and flexible agnostic caching framework, supporting various platforms, for PHP, JavaScript, Python
  • Xpresion a simple and flexible eXpression parser engine (with custom functions and variables support), based on GrammarTemplate, for PHP, JavaScript, Python
  • Regex Analyzer/Composer Regular Expression Analyzer and Composer for PHP, JavaScript, Python

  Files folder image Files (23)  
File Role Description
Files folder imagesrc (3 directories)
Files folder imagetest (7 files, 4 directories)
Accessible without login Image file importer.jpg Icon Icon image
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (23)  /  src  
File Role Description
Files folder imagejs (2 files)
Files folder imagephp (1 file)
Files folder imagepython (1 file)

  Files folder image Files (23)  /  src  /  js  
File Role Description
  Accessible without login Plain text file Importer.js Data Auxiliary data
  Accessible without login Plain text file Importer.min.js Data Auxiliary data

  Files folder image Files (23)  /  src  /  php  
File Role Description
  Plain text file Importer.php Class Class source

  Files folder image Files (23)  /  src  /  python  
File Role Description
  Accessible without login Plain text file todo.txt Doc. Documentation

  Files folder image Files (23)  /  test  
File Role Description
Files folder imageassets (2 files)
Files folder imageclasses (4 files)
Files folder imagenamespaces (2 directories)
Files folder imagenamespaces0 (1 directory)
  Accessible without login Plain text file out-js Data Auxiliary data
  Accessible without login Plain text file out-ns-php Data Auxiliary data
  Plain text file out-php Class Class source
  Accessible without login HTML file test.html Doc. Documentation
  Accessible without login Plain text file test.js Data Auxiliary data
  Accessible without login Plain text file test.php Example Example script
  Accessible without login Plain text file test_ns.php Example Example script

  Files folder image Files (23)  /  test  /  assets  
File Role Description
  Accessible without login Plain text file asset1.css Data Auxiliary data
  Accessible without login Plain text file asset2.css Data Auxiliary data

  Files folder image Files (23)  /  test  /  classes  
File Role Description
  Accessible without login Plain text file Test1.js Data Auxiliary data
  Plain text file Test1.php Class Class source
  Accessible without login Plain text file Test2.js Data Auxiliary data
  Plain text file Test2.php Class Class source

  Files folder image Files (23)  /  test  /  namespaces  
File Role Description
Files folder imageBar (1 file)
Files folder imageFoo (1 file)

  Files folder image Files (23)  /  test  /  namespaces  /  Bar  
File Role Description
  Plain text file FooClass.php Class Class source

  Files folder image Files (23)  /  test  /  namespaces  /  Foo  
File Role Description
  Plain text file FooClass.php Class Class source

  Files folder image Files (23)  /  test  /  namespaces0  
File Role Description
Files folder imagens (2 directories)

  Files folder image Files (23)  /  test  /  namespaces0  /  ns  
File Role Description
Files folder imageBar (1 file)
Files folder imageFoo (1 file)

  Files folder image Files (23)  /  test  /  namespaces0  /  ns  /  Bar  
File Role Description
  Plain text file FooClass.php Class Class source

  Files folder image Files (23)  /  test  /  namespaces0  /  ns  /  Foo  
File Role Description
  Plain text file FooClass.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:95
This week:0
All time:9,869
This week:47Up