Code Monkey home page Code Monkey logo

meff's Introduction

The purpose of this utility is to list all the files responsible for a Magento extension and their locations. Think of it as an experiment in building a automatic modman file generator. Key word "experiment" :)

Usage:

Simple clone this repo and run the meff.php file via the command line passing it a extension name and full path to your Magento root directory.

php meff.php Extension_Name MagentoDir

# or if you are in the current working directory
php meff.php Extension_Name

You can also install this via modman:

modman clone https://github.com/empiricompany/meff.git
Example:

Comparison >

โžœ php meff.php SchumacherFM_OpCachePanel /var/www/site
FILES IDENTIFIED FOR: SchumacherFM_OpCachePanel
/var/www/site/app/code/community/SchumacherFM/OpCachePanel
/var/www/site/app/etc/modules/SchumacherFM_OpCachePanel.xml
/var/www/site/app/design/adminhtml/default/default/layout/opcachepanel.xml
/var/www/site/app/locale/de_DE/SchumacherFM_OpCachePanel.csv
/var/www/site/app/locale/en_US/SchumacherFM_OpCachePanel.csv
/var/www/site/app/design/adminhtml/default/default/template/opcachepanel/unloaded.phtml
/var/www/site/app/design/adminhtml/default/default/template/opcachepanel/graph.phtml
System config entries: SchumacherFM_OpCachePanel
n98-magerun config:delete system/opcachepanel/api_key
n98-magerun config:delete system/opcachepanel/api_key_name
n98-magerun config:delete advanced/modules_disable_output/OpCachePanel

Debug Mode:

This extension has some built in debug modes you can enable to see what it is doing behind the scenes. In the meff.php file there are two constants you can use to control the debug output.

    const DEBUG_MODE = true;
    /*
    log levels:
        0 = all
        1 = normal
        2 = file list only
    */
    const DEBUG_LEVEL = 2;

Caveats:

I haven't tested this on all possible senarios. I appreciate the communities support in testing it with extensions. Magento allows you to construct extensions that can pull files in from a wide variety of sources. I attempt parse the source code looking for mentions of this files and then attempt to determine their existances passed on a few testable assumptions. I'm still working on a few things:

  • Magento allows you to define a helper function to assist in returning a filename using the addItem method. Since this extension currently doesn't instantiate the Magento framework I haven't added this feature.
  • I attempt to pickup any files the extension places in the /lib folder by parsing the source of the php files in the extension and looking for new class declarations. In my tests it is working, but if an issue is found please submit a PR.
  • The code is a bit messy and documentation is limited in some places. I appreciate PR's for refactoring.

Contribution

To contribute:

This repo uses the git flow branching model. Pull requests should be issued to the develop branch.


The MIT License

Copyright 2015 - Tegan Snyder, All Rights Reserved

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

meff's People

Contributors

empiricompany avatar orthographic-pedant avatar tegansnyder avatar

Stargazers

 avatar

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.