Coder Social home page Coder Social logo

class-alias-loader's Introduction

TYPO3 CMS

TYPO3 is an open source PHP based web content management system released under the GNU GPL. TYPO3 is copyright © 1999-2024 by Kasper Skårhøj.

This document provides a basic introduction to TYPO3.

Getting Started

TYPO3 requires a web server with PHP and a database (e.g. MySQL). The backend is accessed via a supported browser.

Please see the Installation Guide in order to set up a basic TYPO3 installation on your web server.

What is TYPO3?

TYPO3 is a free and open source Content Management Framework. It is released under the GNU General Public License. It can run on several web servers, such as Apache, nginx or IIS, on top of many operating systems, among them Linux, Microsoft Windows, FreeBSD or macOS.

TYPO3 was initially authored by Kasper Skårhøj and is now further developed by a community of contributors and the TYPO3 Core Development Team.

To get more info about the GPL license, visit https://opensource.org/licenses/gpl-license

What is a Content Management Framework?

A Content Management Framework is more than just a content management system, due to the separation of the streamlined core and optional plugins (extensions). TYPO3 has an open API that allows you to extend the frontend (website) and/or backend (administration) functionality.

The concept of extensions makes TYPO3 capable of being developed and used in almost any way you can imagine, either by using any of the many extensions which are available for download, or by writing your own.

TYPO3 System requirements

TYPO3 is based upon PHP and uses a database management system like MySQL.

For more specific information regarding requirements see the file INSTALL.md in this folder.

TYPO3 resources

Here is an overview of the most important TYPO3 resources to help you get started:

Get more information

  • https://typo3.org/ is the main project website. It provides up-to-date official news, information about events and the TYPO3 community.

  • https://docs.typo3.org/: TYPO3 is one of the most thoroughly documented OpenSource products around, with manuals covering basic tutorials, TypoScript, administration, development, core structure, etc. You should make the time to locate the various documents, and read those that apply to the work you want to do.

  • https://get.typo3.org/ is the platform where you can download TYPO3 and find all release notes and change logs of TYPO3 releases.

  • https://extensions.typo3.org/ is the platform where you can search for and download TYPO3 extensions.

Chat with us

The TYPO3 community is using a tool called Slack to openly communicate with each other and with the public. Several TYPO3 teams use Slack as a way to communicate internally and most channels are a welcome place for you to join and get yourself involved.

Exchange information, ask questions, get help

Slack is nice for short discussions, but when asking questions, most answers are lost in the noise after a few minutes.

StackOverflow

To let everyone profit from an answer, we recommend to ask questions on StackOverflow. If you like, you can then post a link into the corresponding Slack channel to raise attention. And please, do not forget to tag your questions correctly with typo3 (and possibly other tags like typo3-9.5.x, Fluid or Extbase).

Official meet the TYPO3 Community overview:

Visit https://typo3.org/community/meet/

Contributing

If you want to contribute to the TYPO3 source code, take a look at our Contributors Walkthrough and Review System:

Please use the TYPO3 Slack chat, if you need help in setting up your contribution environment. The community is very helpful and get you up and running! (Please post your questions in Slack Channel #typo3-cms-coredev regarding contribution support)

The repository at GitHub is a synchronized mirror of the primary TYPO3 core git repository:

If you want to file a bug report, take a look at:

Security

If you learn about a potential security issue in the TYPO3 core or in an extension, please always contact the TYPO3 Security Team via [email protected]. Please always include the version number where you've discovered the issue. If we can confirm a problem in a third-party extension, we will inform the author immediately.

If you discover a security problem in your own extension, please inform the TYPO3 Security Team as well. They can help you to fix it, and they may want to issue an advisory once it is fixed.

For more details see TYPO3 Security Team.

Final notes

TYPO3 is said to be one of the most sophisticated PHP / Internet related applications available, and the more you play with it, the more you will agree.

Due to the advanced level of the code and functionality, a degree of study, time and perseverance is required to fully understand it, and get the best from it. You should keep trying, as we say it's definitely worth it. TYPO3 is the Enterprise Content Management System "for all".

The GPL license allows for developments that are based upon TYPO3 to also be freely available under the GPL. Please remember this, because TYPO3 is about "Inspiring People To Share". If you are making money with TYPO3 you can donate or become a member of the TYPO3 Association.

By becoming a supporting member, individuals and organisations mainly fund core development of TYPO3. The decision about what the funds are used for, is made by all members of the Association and the TYPO3 Association Board. The decisions will be made transparent to the community and especially the supporting members. Your funds will also serve for other purposes as laid out in the bylaws.

Copyleft

This document is a part of the TYPO3 project.

class-alias-loader's People

Contributors

arrgson avatar coding46 avatar franzholz avatar froemken avatar helhum avatar hoogi91 avatar lolli42 avatar mbrodala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

class-alias-loader's Issues

Issue #22 and #21 is not solved!!!!

The function TYPO3\ClassAliasLoader::loadOriginalClassAndSetAliases($originalClassName) don't use the fixed function TYPO3\ClassAliasLoader::getOriginalClassName($aliasOrClassName) from Issue #20. And so this issue , Issue #22 and #21 is not solved!

Update from v1.0.1 to v1.1.0 fails with TypeError

The commit a63a582 changed the signature of ClassAliasMapGenerator::__construct which causes a TypeError because versions seem to be mixed during a composer update.

Writing lock file
Generating autoload files
Generating class alias map file
Inserting class alias loader into main autoload.php file
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Updating typo3/class-alias-loader (1.0.1 => v1.1.0): Loading from cache
Writing lock file
Generating autoload files
PHP Fatal error:  Uncaught TypeError: Argument 3 passed to TYPO3\ClassAliasLoader\ClassAliasMapGenerator::__construct() must be an instance of TYPO3\ClassAliasLoader\Config or null, bool given, called in phar:///home/ben/.local/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code on line 83 and defined in /home/ben/tmp/test-class-alias-loader/vendor/typo3/class-alias-loader/src/ClassAliasMapGenerator.php:49
Stack trace:
#0 phar:///home/ben/.local/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code(83): TYPO3\ClassAliasLoader\ClassAliasMapGenerator->__construct(Object(Composer\Composer), Object(Composer\IO\ConsoleIO), false)
#1 [internal function]: TYPO3\ClassAliasLoader\Plugin_composer_tmp1->onPostAutoloadDump(Object(Composer\Script\Event))
#2 phar:///home/ben/.local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(176): call_user_func(Array, Object(Composer\Script\Event))
#3 phar:///home/ben/.local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(96): Composer\E in /home/ben/tmp/test-class-alias-loader/vendor/typo3/class-alias-loader/src/ClassAliasMapGenerator.php on line 49

Fatal error: Uncaught TypeError: Argument 3 passed to TYPO3\ClassAliasLoader\ClassAliasMapGenerator::__construct() must be an instance of TYPO3\ClassAliasLoader\Config or null, bool given, called in phar:///home/ben/.local/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code on line 83 and defined in /home/ben/tmp/test-class-alias-loader/vendor/typo3/class-alias-loader/src/ClassAliasMapGenerator.php:49
Stack trace:
#0 phar:///home/ben/.local/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code(83): TYPO3\ClassAliasLoader\ClassAliasMapGenerator->__construct(Object(Composer\Composer), Object(Composer\IO\ConsoleIO), false)
#1 [internal function]: TYPO3\ClassAliasLoader\Plugin_composer_tmp1->onPostAutoloadDump(Object(Composer\Script\Event))
#2 phar:///home/ben/.local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(176): call_user_func(Array, Object(Composer\Script\Event))
#3 phar:///home/ben/.local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(96): Composer\E in /home/ben/tmp/test-class-alias-loader/vendor/typo3/class-alias-loader/src/ClassAliasMapGenerator.php on line 49

Steps to reproduce:

mkdir test-class-alias-loader
cd test-class-alias-loader
composer init -n
composer require typo3/cms-base-distribution typo3/class-alias-loader:1.0.1
composer require typo3/class-alias-loader:1.1.0

Note: This was discovered by TYPO3 nightly tests:
https://bamboo.typo3.com/browse/CORE-GTN95-81
https://bamboo.typo3.com/browse/CORE-GTN-84

Class not found with 1.1.1

SInce update from 1.0.2 to 1.1.1 I get exceptions from class loader

Class 'TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper' not found
in /app/web/typo3conf/ext/vhs/Classes/ViewHelpers/Uri/TypolinkViewHelper.php line 45

this shipped ViewHelper in vhs version 5.2.0 is marked as deprecated and yes, the mentioned class can't be loaded. The error is shown even if the VH is not used.

downgrading to version 1.0.2 fixes the problem

"require": {
        "php": "^7.2",
        "ext-curl": "*",
        "ext-json": "*",
        "apache-solr-for-typo3/solr": "^9",
        "bithost-gmbh/powermail_fastexport": "^1.0",
        "fluidtypo3/fluidpages": "^5",
        "fluidtypo3/flux": "9.2.0",
        "fluidtypo3/vhs": "^5",
        "helhum/typo3-console": "^5",
        "ichhabrecht/mask-export": "^2.4",
        "in2code/powermail": "^7",
        "koninklijke-collective/my-redirects": "^4.2",
        "mask/mask": "^4",
        "netresearch/rte-ckeditor-image": "^9.0",
        "sup7even/mailchimp": "dev-master",
        "t3g/blog": "^9",
        "typo3/cms-belog": "^9.5",
        "typo3/cms-beuser": "^9.5",
        "typo3/cms-extbase": "^9.5",
        "typo3/cms-extensionmanager": "^9.5",
        "typo3/cms-felogin": "^9.5",
        "typo3/cms-filelist": "^9.5",
        "typo3/cms-fluid": "^9.5",
        "typo3/cms-fluid-styled-content": "^9.5",
        "typo3/cms-frontend": "^9.5",
        "typo3/cms-info": "^9.5",
        "typo3/cms-info-pagetsconfig": "^9.5",
        "typo3/cms-install": "^9.5",
        "typo3/cms-lang": "^9.5",
        "typo3/cms-linkvalidator": "^9.5",
        "typo3/cms-lowlevel": "^9.5",
        "typo3/cms-recordlist": "^9.5",
        "typo3/cms-recycler": "^9.5",
        "typo3/cms-reports": "^9.5",
        "typo3/cms-rte-ckeditor": "^9.5",
        "typo3/cms-saltedpasswords": "^9.5",
        "typo3/cms-scheduler": "^9.5",
        "typo3/cms-setup": "^9.5",
        "typo3/cms-sv": "^9.5",
        "typo3/cms-redirects": "^9.5",
        "typo3/cms-tstemplate": "^9.5",
        "typo3/cms-viewpage": "^9.5",
        "typo3/class-alias-loader": "^1.1"
    },

no mapping of namespace class

I have added an entry for the missing TYPO3 8.x class TYPO3\CMS\Core\Utility\MonitorUtility as it is done here: https://github.com/FriendsOfTYPO3/compatibility7/blob/master/Migrations/Code/ClassAliasMap.php into the extension migration_core file ClassAliasMap.php:

't3lib_utility_Monitor' => \JambageCom\MigrationsCore\Utility\MonitorUtility::class,
'TYPO3\\CMS\\Core\\Utility\\MonitorUtility' => \JambageCom\MigrationsCore\Utility\MonitorUtility::class,   

However when I make a call in this format:

	// Check memory usage
	$callingClassNameMonitor = '\\TYPO3\\CMS\\Core\\Utility\\MonitorUtility';
	call_user_func($callingClassNameMonitor . '::peakMemoryUsage');

Then I always get an exception:

    Uncaught TYPO3 Exception: #1476107295: PHP Warning: call_user_func() expects parameter 1 to be a valid callback, class '\TYPO3\CMS\Core\Utility\MonitorUtility' not found in /home/www/doc/path/demoshop/typo3conf/ext/div2007/class.tx_div2007_alpha5.php line 2227 \| TYPO3\CMS\Core\Error\Exception thrown in file /home/www/doc/path/demoshop/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 107. Requested URL: http://demoshop.jambage.com/index.php?id=11&product=9&no_cache=1&eID=tt_products

This is not compatible with PHP 5.6 anymore

In v1.1 some features were added which are not compatible with PHP 5.6 anymore, mainly due to usage of type hints ("string"), i.e. in IncludeFile.php:

protected function getIncludeFileContent(string $includeFilePath)

Type hinting for the main scalars was only introduced in PHP 7.0. This change was not reflected in this packages main composer requirements, which still shows "php": ">=5.3.7",.

While this might sound like ancient history and irrelevant, it breaks updating on older installations (running with PHP 5.6) which still want to keep up-to-date with composer (i.e. when using ELTS versions of all software):

Generating autoload files

                                                                                                                                                          
  [ErrorException]                                                                                                                                        
  Argument 1 passed to TYPO3\ClassAliasLoader\IncludeFile::getIncludeFileContent() must be an instance of TYPO3\ClassAliasLoader\string, string given, c  
  alled in /app/vendor/typo3/class-alias-loader/src/IncludeFile.php on line 63 and defined                                                                

Solution for my project was to pin to the older version in composer.json:

  "require": {
    "typo3/cms": "^7.6",
    "typo3/class-alias-loader": "~1.0.2",
    ...

So this issue is a request to keep the main composer.json dependencies in mind and up-to-date when adding new code, and also as a note for people stumbling over the issue and error with a proven solution.

Improve performance of ClassAliasLoader

Abstract: The ClassAliasLoader adds unnecessary overhead if autoload_classaliasmap.php is holding no entries and the API is never used.

I set up a TYPO3 7.6.6 installation with the official bootstrap package and profiled the frontend request on the root page. Profiling proves, that 3.5 % of the whole request time is simply "lost" because of the class alias loading, which does not have any impact. This might sound negligible, but most TYPO3 installations i know have 10+ extensions. The more classes, the greater the impact. I also profiled some of these installations and i got results between 2 % and 4 % request time spent on class alias loading.
Not talking about percentages: The class alias loading is delaying the request from 2 to 14 ms.
BTW: The memory usage impact is insignificant.

I won't hold speeches about the importance of fast websites, user (dis-)satisfaction or else. Just let us fix this.

My proposal:
If both arrays are empty, the do not register the ClassAliasLoader, but add a factory callback or such instead of the instance to ClassAliasMap. At the moment the API gets called we can still resolve the ClassAliasLoader and register it as spl_autoload function.

A PR will follow

Request Namespaced Alias Wildcards

it seems to be difficult if there are a lot of classes in a namespace and you must define them one by one, so its would be nice if supported wilcards, something like

'Model\*' => 'My\Project\Model\$1' 

and act like

$article = new Model\Article(); // My\Project\Model\Article;

whether this is possible or already available ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.