Caching and common Workflow with Typo3 Extension development - caching

I am developing my first typo3 extension with Extbase and Fluid.
Whenever I change something in any PHP file (a controller for example) I have to deactivate and reactivate my extension to see the changes.
That costs a lot of time and is really annoying..
Flushing the caches didn't solve the problem for me.
How can I speed up my typo3 extension development workflow?

You have to clear the caches from the install tool, that also flushes the caches that contain annotation data.
To ease the process of doing so, you could check out the extension typo3_console, it should contain a command to flush the caches from the command line. Although I have never used it myself, I've heard many good things about it.

Related

disabling cache for development Purposes in Typo3 Version 6.2.9

I'm very new to Typo3 and am struggling with a few cached images that refuse to update.
There has to be a option to deactivate all caching somewhere, and to flush everything. I need to know how.
What I have been expecting to find was one button that fixes it all. What I actually found was the following:
The directory /fileadmin/_processed_ contains resized images that the website creates and stores for later reuse, deleting the folder's content prompts the website to recreate everything from scratch, thus reflecting any changes to the original images that are stored elsewhere.
The directory /typo3temp/ runs a similar role like the one mentioned above, it contains semitemporary data from some installed extensions (unlike above not limited to image files). If a particular extension is causing trouble you might find (and empty) it's cache in this directory
/typo3temp/Cache appears to be of interest.
The Install tool accesible from the backend provides a few useful functions, most notably the clear all cache found under the tab important functions.
Furthermore there is a tab clean up which allow clearing cache_imagesizes, cache_md5params, cache_typo3temp_log amongst some other things that don't seem to be of greater interest.
I had the same problem when I switched to TYPO3 6.0
It was caused by the FAL (file abstraction layer).
The only way, displaying a newer verion of the picture was to rename it such like:
oldpicture = _picture
newpicture = oldpicture

Magento site still not updating after changes to files

I have been trying to get my Magento site to take some changes but it is still not refreshing the changes. I have disabled caching and flushed all of them on every single occasion I have also cleared my browser cache and it still does not take changes. I have gone as far to delete several files from the server that the theme relies on but it still functions like nothing was ever removed! What could be my issue?
You keep editing those files. I do not think those files are the files you think they are.
You question is pretty short on details, but my first guess if your system is running with the compiler enabled, which means it's loading its class files from
includes/src
Googling around to learn about the compiler would be a good idea.
I'd try adding the following to the end of your index.php file
echo '<--';
print_r(get_included_files());
echo '-->';
This will list every file PHP used during the request. Compare the full paths with the ones you're editing, and I bet you'll find a discrepancy.

Does it "damage" a joomla website to test extensions?

I have a bit of bad habbit, I install joomla on xampp and test all extensions and things im planning to add on the website there. Then I go to live website and try to start it from scratch, but it get very confusing and stressing this way..
I am thinking of just uploading the xampp joomla site to a live server but I am worried about these things:
I have installed/uninstalled some extensions (10+) do these leave behind any corrupted files in general or cause any problems?
Any tips cause im really worried now, the website has grown a lot and I cant start it from start even looking at the notes I took while making it. Uninstalled extensions do they leave any files behind or cause any problems? Right now the website works good on XAMPP.
Any tips or suggestions greatly appreciated,
Ammy
Most extensions uninstall fairly cleanly. You can be sure by using an FTP client and looking under /components, /plugins, and /modules (and/or their counterparts under /administrator) for leftover directories with the extension's name. You can also use PHPMyAdmin or somesuch to look for leftover database tables with similar names.
Even if files and tables are left behind, they're unlikely to cause problems with the site. I understand the desire to keep a tidy codebase, but that's not a good reason to build a site twice.
Most extensions delete their files on an uninstall. This is because Joomla does this job itself, the extension doesn't have to do anything for this to work.
However the tables are a different beast. While it would be very easy for extensions to delete their tables on uninstall, there are different ideas about this. Some argue that they don't want to be responsible for deleted data and thus leave the tables behind.
Also entries in the assets, categories, tags mappings and menu tables are likely to be lying around after an uninstall. Most extensions will not clean those tables up during uninstall.
There may also be leftovers in files, if the extension used some library like fof or similar. There is no ckeck if the uninstalled extension was the last one that used that library. So you need to uninstall those manually, but you need to know if it's used or not.
The leftover tables and entries don't generate any problems except for a bit more memory usage. However a leftover library may be a huge security issue as it may contain a bug which could be abused. Since no extension is using it anymore, it will never get updated and the bug doesn't get fixed.

Clearing cache in the server

This is related to my problem here:
Editing velocity template of Liferay changes not showing or takes a while
I've tried to investigate the caching problem and tried different things. Here's what I found out.
I just found out that my css is also delayed in showing the updates. I tweak my css file adding comment and testing it on my browser. Now just requesting it on the URL it will just give me an older version of the file. now if i put a query asking for version, (eg. mystyle.css?v2) it will pull the latest file and it records it. I can even see different version, eg. (mystyle.css?v1) or (mystyle.css?v2. I've cleaned my cache so it's definitely on the server side (i think).
Is there a way I can clear my cache?
Thank You!
you can activate Liferay's developer setting by including the properties that are in ROOT/WEB-INF/classes/portal-developer.properties.
Explanation: Liferay minifies and caches CSS and Javascript - once this is done it will not examine those for changes. The developer settings will disable that.
However, you don't want this setting active in production as this will mean that you'll have to load dozens of files instead of very few combined+minified, well cached, files.
I assume you are using this for development, not in production.
If you're having these problems in production, you should rather work with a proper theme plugin and redeploy that.

TYPO3 extensions and symlinks

Can I create a symlink to the local extension from aonther project folder? I have a common local-server and i need to implement same extension on all local project-installations. I tried to put the symlink, but some times i do not get expected output. I get it only after clearing the cache of that perticular project.
Your scenario is a common one I guess. But as Omar said, linking to the same code base of the extension through several typo3 instances is not a good practice.
But we have the same structure as yours, we realize this through SVN. All of our projects got a SVN repository and common extensions have their own repository. Through svn:externals the extensions are linked into the concrete project. This has the advantage that you can change the extension in the concrete project and after committing all other projects (that do have to update from svn though) contribute from it. I Think this would fit your needs, too.
If I understand your question correctly you have several Typo3 sites on the same server and want to share an extension between them using a symlink. I don't think that is a very great idea because many extensions use tables and every site normally has it's own database so you would have to do a lot of tinkering to get that to work.
Instead you could make all the modifications to the extension files in the typo3conf/ext/extension_name folder and then export the extension to a t3x file (Ext Manager in the Backend). This t3x file can be installed as a extension (Import extension) on all your other sites.
If you extension does not use a database and you are planning to make frequent changes then I guess you should be able to make that work (the symlink). Otherwise I recommend you use the first approach I described.
I have not tried this, but you should be able to install extensions globally in Typo3. What this means is that the given extension is placed inside '(typo3_src/)typo3/ext/' instead of 'typo3conf/ext/', presuming both sites use the same Typo3 Core/Source (and thus typo3_src is a symlink to the location of the core).
You can enable installing global extensions via the Install Tool. Once inside the tool, click on 'All Configuration', then search for allowGlobalInstall. Or put the following line into your localconf.php:
$TYPO3_CONF_VARS['EXT']['allowGlobalInstall'] = '1';
At last, but not least, you need to make sure the 'typo3/ext/' directory is writeable.
Hope this will be to some help. If you have any further questions, let me know :)
As Björn mentioned, I'd sugegst to install them globally. Mind you, updating the source will require to move the extensions accordingly..
As for "expected output": be aware that the code in these folders is cached in various ways (mainly page content and config settings), and hence not always run. This is the reason a change done from "outside" the current installation is likely not to propagate to your output without clearing these caches (as you have observed).
When you actually install an extension via the extension manager, the cache should (if correctly configured) be cleared (interested parties may search for clearCacheOnLoad in class.em_index.php to reveal a clear_cacheCmd('all')). There is a small checkbox, which is normally checked, during the installation process to accomplish this.
Omar's first approach is therefore, as I see it, the more easy way to get "expected output" and less jumbling around with global extensions.

Resources