Overview
Comment:Déplacement des objets pour adopter PSR-0
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e1d5bc8368319dad618b33611bc42ff41c0a01db
User & Date: bohwaz on 2014-12-18 18:41:03
Other Links: manifest | tags
Context
2014-12-18
19:41
Passage à PSR-0 + Dépendances simplifiées avec KD2fw check-in: c39efc2c38 user: bohwaz tags: trunk
18:41
Déplacement des objets pour adopter PSR-0 check-in: e1d5bc8368 user: bohwaz tags: trunk
16:43
Possibilité de requérir une version minimale de Garradin pour un plugin. Enregistrement de la configuration déporté à la destruction de l'objet. Instanciation de $plugin avant l'installation. check-in: bcc5556f06 user: bohwaz tags: trunk
Changes

Deleted src/include/index.html version [abe89f9bfb].

1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL was not found on this server.</p></body></html>
<


Modified src/include/init.php from [dff3fd824c] to [d4a4d882d6].

269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302

303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
{
    /**
     * Already loaded filenames
     * @var array
     */
    static protected $loaded = [];

    static protected $libs = [
        'utils',
        'squelette_filtres',
        'static_cache',
        'template'
    ];

    /**
     * Loads a class from the $name
     * @param  stringg $classname
     * @return bool true
     */
    static public function load($classname)
    {
        $classname = ltrim($classname, '\\');
        $filename  = '';
        $namespace = '';

        if ($lastnspos = strripos($classname, '\\')) 
        {
            $namespace = substr($classname, 0, $lastnspos);
            $classname = substr($classname, $lastnspos + 1);

            if ($namespace != 'Garradin')
            {
                $filename  = str_replace('\\', '/', $namespace) . '/';
            }

        }

        $classname = strtolower($classname);

        if (in_array($classname, self::$libs)) {
            $filename = 'lib.' . $classname . '.php';
        } else {
            $filename .= 'class.' . $classname . '.php';
        }

        $filename = ROOT . '/include/' . $filename;

        if (array_key_exists($filename, self::$loaded))
        {
            return true;
        }

        if (!file_exists($filename)) {
            throw new \Exception('File '.$filename.' doesn\'t exists');
        }

        self::$loaded[$filename] = true;

        require $filename;
    }
}

\spl_autoload_register(['Garradin\Loader', 'load'], true);

$n = new Membres;








<
<
<
<
<
<
<








<
<
|
|

<
|
|
<
<
|
|
>

|
<
|
|
|
<
<


<
<
|




|
|


|

|







269
270
271
272
273
274
275







276
277
278
279
280
281
282
283


284
285
286

287
288


289
290
291
292
293

294
295
296


297
298


299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
{
    /**
     * Already loaded filenames
     * @var array
     */
    static protected $loaded = [];








    /**
     * Loads a class from the $name
     * @param  stringg $classname
     * @return bool true
     */
    static public function load($classname)
    {
        $classname = ltrim($classname, '\\');


        
        if (substr($classname, 0, 16) == 'Garradin\\Plugin\\')
        {

            $classname = substr($classname, 16);
            $plugin_name = substr($classname, 0, strpos($classname, '\\'));


            $filename = str_replace('\\', '/', substr($classname, strpos($classname, '\\')+1));
            
            $path = 'phar://' . PLUGINS_ROOT . '/' . strtolower($plugin_name) . '.tar.gz/lib/' . $filename . '.php';
        }
        else

        {
            $filename = str_replace('\\', '/', $classname);
            $path = ROOT . '/include/lib/' . $filename . '.php';


        }



        if (array_key_exists($path, self::$loaded))
        {
            return true;
        }

        if (!file_exists($path)) {
            throw new \Exception('File '.$path.' doesn\'t exists');
        }

        self::$loaded[$path] = true;

        require $path;
    }
}

\spl_autoload_register(['Garradin\Loader', 'load'], true);

$n = new Membres;

Name change from src/include/class.compta_categories.php to src/include/lib/Garradin/Compta/Categories.php.

Name change from src/include/class.compta_comptes.php to src/include/lib/Garradin/Compta/Comptes.php.

Name change from src/include/class.compta_comptes_bancaires.php to src/include/lib/Garradin/Compta/Comptes_Bancaires.php.

Name change from src/include/class.compta_exercices.php to src/include/lib/Garradin/Compta/Exercices.php.

Name change from src/include/class.compta_import.php to src/include/lib/Garradin/Compta/Import.php.

Name change from src/include/class.compta_journal.php to src/include/lib/Garradin/Compta/Journal.php.

Name change from src/include/class.compta_stats.php to src/include/lib/Garradin/Compta/Stats.php.

Name change from src/include/class.config.php to src/include/lib/Garradin/Config.php.

Name change from src/include/class.cotisations.php to src/include/lib/Garradin/Cotisations.php.

Name change from src/include/class.db.php to src/include/lib/Garradin/DB.php.

Name change from src/include/class.membres_categories.php to src/include/lib/Garradin/Membres/Categories.php.

Name change from src/include/class.champs_membres.php to src/include/lib/Garradin/Membres/Champs.php.

Name change from src/include/class.cotisations_membres.php to src/include/lib/Garradin/Membres/Cotisations.php.

Name change from src/include/class.membres_import.php to src/include/lib/Garradin/Membres/Import.php.

Name change from src/include/class.membres.php to src/include/lib/Garradin/Membres/Membres.php.

Name change from src/include/class.plugin.php to src/include/lib/Garradin/Plugin.php.

Name change from src/include/class.rappels.php to src/include/lib/Garradin/Rappels.php.

Name change from src/include/class.rappels_envoyes.php to src/include/lib/Garradin/Rappels_Envoyes.php.

Name change from src/include/class.sauvegarde.php to src/include/lib/Garradin/Sauvegarde.php.

Name change from src/include/class.squelette.php to src/include/lib/Garradin/Squelette.php.

Name change from src/include/lib.squelette_filtres.php to src/include/lib/Garradin/Squelette_Filtres.php.

Name change from src/include/lib.static_cache.php to src/include/lib/Garradin/Static_Cache.php.

Name change from src/include/lib.template.php to src/include/lib/Garradin/Template.php.

Name change from src/include/lib.utils.php to src/include/lib/Garradin/Utils.php.

Name change from src/include/class.wiki.php to src/include/lib/Garradin/Wiki.php.