Create a Hello World component - kulbakin/anahita GitHub Wiki

Anahita by default provides a simple hello world example that showcases a package file structure. To install the helloworld component run the following command

 php anahita package:install example

Now point your browser to http://localhost/myproject/www/helloworld. You should be able to see a hello world there.

Feel free to explore and play around with the code. You can also use any of the existing apps as a starting point either by going directly to vendor/anahita/anahita/src/packages or by simply copying them into the root packages folder.

Here's an example to re-use the photos app. If you have already installed the photos app you need unlink it first

 php anahita package:uninstall photos

Then run the following command from your project root. This will copy the photos package into your root packages directory

 cp -r vendor/anahita/anahita/packages/photos/ packages/photos

Then open the ROOT/packages/photos/composer.json and change the name from "anahita/photos" to "myproject/photos",

If you do php anahita package:list you can see now photo shows under the myproject packages. Those are your packages. Now run the following command to install the photos app

php anahita package:install "myproject/photos" 

Now you can makes changes in the photos code at ROOT/pakcages/photos/src and see the results.

HINT: If you have APC and have enabled the caching, then object paths are cached in the memory for performance reason. To clear the cache you can go in the back-end and turn off and then turn on the cache or go in the 'www' folder find the configuration.php file and set the cahce to 0, refresh the page and then set it back to 1. This will empty the cahce.

You can also use the command line to regenerate the site secret which is used as the cache key.

php anahita site:configuration --new-secret